[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e36f633f99040aa5864008d2afca586b0af5d6f1.camel@microchip.com>
Date: Tue, 13 Feb 2024 03:19:35 +0000
From: <Arun.Ramadoss@...rochip.com>
To: <Woojung.Huh@...rochip.com>, <d.dulov@...ddin.ru>
CC: <andrew@...n.ch>, <olteanv@...il.com>, <davem@...emloft.net>,
<vivien.didelot@...il.com>, <helmut.grohne@...enta.de>,
<linux-kernel@...r.kernel.org>, <f.fainelli@...il.com>,
<alexandre.belloni@...tlin.com>, <UNGLinuxDriver@...rochip.com>,
<kuba@...nel.org>, <lvc-project@...uxtesting.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH 18/18] net: dsa: microchip: Check return value of
of_get_phy_mode()
Hi Daniil,
On Sun, 2024-02-11 at 07:08 -0800, Daniil Dulov wrote:
> drivers/net/dsa/microchip/ksz_common.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz_common.c
> b/drivers/net/dsa/microchip/ksz_common.c
> index e3c338624b95..faffce6ea1e1 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -434,8 +434,10 @@ int ksz_switch_register(struct ksz_device *dev,
> continue;
> if (port_num >= dev->mib_port_cnt)
> return -EINVAL;
> - of_get_phy_mode(port,
> + ret = of_get_phy_mode(port,
> &dev-
> >ports[port_num].interface);
> + if (ret)
> + return ret;
If phy mode is not defined in device tree, can phy mode have some
default mode like internal or rgmii_tx_id.
If this field is mandatory to be specified in device tree, Then instead
of just returning, it will be good to return with dev_err message, so
the user will be aware of whats wrong with the driver.
> }
> dev->synclko_125 = of_property_read_bool(dev->dev-
> >of_node,
> "microchip,s
> ynclko-125");
> --
> 2.25.1
>
Powered by blists - more mailing lists