mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Jerry Ray <jerry.ray@microchip.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH 2/2] net: dsa: LAN9303: Add basic support for LAN9354
Date: Mon, 29 Aug 2022 21:20:29 +0200	[thread overview]
Message-ID: <Yw0RfRXGZKl+ZwOi@lunn.ch> (raw)
In-Reply-To: <20220829180037.31078-2-jerry.ray@microchip.com>

> -	if ((reg >> 16) != LAN9303_CHIP_ID) {
> -		dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
> +	if (((reg >> 16) != LAN9303_CHIP_ID) &&
> +	    ((reg >> 16) != LAN9354_CHIP_ID)) {
> +		dev_err(chip->dev, "unexpected device found: LAN%4.4X\n",
>  			reg >> 16);
>  		return -ENODEV;
>  	}
> @@ -884,7 +889,7 @@ static int lan9303_check_device(struct lan9303 *chip)
>  	if (ret)
>  		dev_warn(chip->dev, "failed to disable switching %d\n", ret);
>  
> -	dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff);
> +	dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg & 0xffff);
>  
>  	ret = lan9303_detect_phy_setup(chip);
>  	if (ret) {
> diff --git a/drivers/net/dsa/lan9303_mdio.c b/drivers/net/dsa/lan9303_mdio.c
> index bbb7032409ba..d12c55fdc811 100644
> --- a/drivers/net/dsa/lan9303_mdio.c
> +++ b/drivers/net/dsa/lan9303_mdio.c
> @@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
>  
>  static const struct of_device_id lan9303_mdio_of_match[] = {
>  	{ .compatible = "smsc,lan9303-mdio" },
> +	{ .compatible = "microchip,lan9354-mdio" },

Please validate that what you find on the board actually is what the
compatible says it should be. If you don't validate it, there will be
some DT blobs that have the wrong value, but probe fine. But then you
cannot actually make use of the compatible string in the driver to do
something different between the 9303 and the 9354 because some boards
have the wrong compatible....

     Andrew

  reply	other threads:[~2022-08-29 19:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 18:00 [PATCH 1/2] " Jerry Ray
2022-08-29 18:00 ` [PATCH 2/2] " Jerry Ray
2022-08-29 19:20   ` Andrew Lunn [this message]
2022-09-02 20:18     ` Jerry.Ray
2022-09-02 20:29       ` Andrew Lunn
2022-08-29 19:22   ` Andrew Lunn
2022-09-02 20:24     ` Jerry.Ray
2022-08-30 10:33 ` [PATCH 1/2] " Vladimir Oltean
2022-09-02 20:10   ` Jerry.Ray

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=Yw0RfRXGZKl+ZwOi@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jerry.ray@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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®