mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Dimitri Fedrau <dima.fedrau@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"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
Subject: Re: [PATCH net-next] net: phy: dp83822: Add support for PHY LEDs on DP83822
Date: Wed, 18 Dec 2024 18:13:08 +0100	[thread overview]
Message-ID: <1627e8c1-e9f9-438e-9ca2-6a931c814e70@lunn.ch> (raw)
In-Reply-To: <20241217175906.GB716460@debian>

> > index is taken direct from DT. Somebody might have:
> > 
> >            leds {
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> > 
> >                 led@42 {
> >                     reg = <42>;
> >                     color = <LED_COLOR_ID_WHITE>;
> >                     function = LED_FUNCTION_LAN;
> >                     default-state = "keep";
> >                 };
> >             };
> > 
> > so you should not assume if it is not 0, 1 or 2, then it must be
> > 3. Please always validate index.
> >
> dp83822_of_init_leds does a check that index is 0, 1, 2 or 3. Is this
> sufficient ? Otherwise I would validate the index.

Ah, i missed that. I'm just used to the usual pattern that every PHY
driver has a check for the MAX LEDs in their callback.

	Andrew

  reply	other threads:[~2024-12-18 17:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17  9:16 Dimitri Fedrau
2024-12-17 16:32 ` Simon Horman
2024-12-17 17:54   ` Dimitri Fedrau
2024-12-17 17:13 ` Andrew Lunn
2024-12-17 17:59   ` Dimitri Fedrau
2024-12-18 17:13     ` Andrew Lunn [this message]
2024-12-18  8:54   ` Dimitri Fedrau
2024-12-18 17:16     ` Andrew Lunn
2024-12-18 18:17       ` Dimitri Fedrau
2024-12-18 20:19         ` Andrew Lunn
2024-12-18 20:44           ` Dimitri Fedrau
2024-12-18  8:32 ` kernel test robot

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=1627e8c1-e9f9-438e-9ca2-6a931c814e70@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dima.fedrau@gmail.com \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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®