Thread (3 messages) 3 messages, 2 authors, 2025-01-20

Re: [PATCH] net: phy: Handle both led@0 and led subnode name for single-LED PHYs

From: Marek Vasut <marex@denx.de>
Date: 2025-01-20 09:02:39
Also in: linux-leds

On 1/20/25 9:25 AM, Marek Vasut wrote:
In case a PHY supports only one LED in total, like ADIN1300, and this LED
is described in DT, it is currently necessary to include unit address in
the LED node name and the address-cells have to be set to 1:

leds {
   #address-cells = <1>;
   ...
   led@0 {
     reg = <0>;
     ...
   };
};

For a single LED PHY, this should not be necessary and plain 'led' node
without unit should be acceptable as well:

leds {
   ...
   led {
     ...
   };
};

Handle this special case. In case reg property is not present in the leds
node subnode, test whether the leds node contains exactly one subnode, and
if so, assume this is the one single LED with reg property set to 0.

Signed-off-by: Marek Vasut <marex@denx.de>
Please ignore, V2 is coming with a trivial fix for variable rename.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help