lan78xx_conf...leds_from_dt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lan78xx_configure_leds_from_dt β€” bestie's guide

okay so this is a page from the Kernel API Manual, section 9, and it's all about lan78xx_configure_leds_from_dt. yes the name is a whole mouthful, i know 😭 but it's literally just "turn on the right LEDs because the device tree said so." stick with me 🫢


✨ NAME ✨

lan78xx_configure_leds_from_dt β€” configure LED enables based on DT


πŸŽ€ SYNOPSIS πŸŽ€

int lan78xx_configure_leds_from_dt (struct lan78xx_net *dev , struct
       phy_device *phydev );

🌸 ARGUMENTS 🌸

  • dev β€” the LAN78xx device πŸ’–
  • phydev β€” the PHY device, and heads up: it must be valid (no cap, no exceptions, she checks nothing, she just trusts you πŸ™ˆ)

πŸ¦‹ DESCRIPTION πŸ¦‹

So what she does is: she reads the "microchip,led-modes" property from the PHY's DT node, and then she enables the corresponding number of LEDs by writing to HW_CFG. that's the whole vibe, honestly ✨

This helper preserves the original logic, and it enables up to 4 LEDs, periodt. πŸ”₯

And if the property isn't there at all? she does nothing. no drama, no fallback, just vibes and an early exit πŸ’…

lowkey important: "property not present" = function does nothing. no secret default behaviour, bestie, don't go inventing one 🌈

⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • a negative error code if it goes sideways 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/net/usb/lan78xx.c β€” go read the source, it's giving main character energy:


k that's the page!! πŸ’œ this one's brought to you by the fine folks over in ./drivers/net/usb, stamped October 2026, and yeah β€” that's the source and the date, so you can cite me. mwah πŸ“πŸ§šπŸ’–

πŸ“¦ where this page comes from