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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Please ignore, V2 is coming with a trivial fix for variable rename.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux