mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Arun.Ramadoss@microchip.com>
To: <Woojung.Huh@microchip.com>, <d.dulov@aladdin.ru>
Cc: <andrew@lunn.ch>, <olteanv@gmail.com>, <davem@davemloft.net>,
	<vivien.didelot@gmail.com>, <helmut.grohne@intenta.de>,
	<linux-kernel@vger.kernel.org>, <f.fainelli@gmail.com>,
	<alexandre.belloni@bootlin.com>, <UNGLinuxDriver@microchip.com>,
	<kuba@kernel.org>, <lvc-project@linuxtesting.org>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH 18/18] net: dsa: microchip: Check return value of of_get_phy_mode()
Date: Tue, 13 Feb 2024 03:19:35 +0000	[thread overview]
Message-ID: <e36f633f99040aa5864008d2afca586b0af5d6f1.camel@microchip.com> (raw)
In-Reply-To: <20240211150804.3893-1-d.dulov@aladdin.ru>

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
> 

  parent reply	other threads:[~2024-02-13  3:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-11 15:08 Daniil Dulov
2024-02-13  0:50 ` Jakub Kicinski
2024-02-13  3:19 ` Arun.Ramadoss [this message]
2024-02-16  1:09 ` Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e36f633f99040aa5864008d2afca586b0af5d6f1.camel@microchip.com \
    --to=arun.ramadoss@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=d.dulov@aladdin.ru \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=helmut.grohne@intenta.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®