gpio_led_register_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ gpio_led_register_device(9) ✨

okay bestie, welcome to the Kernel API Manual page for gpio_led_register_device(9) β€” manual name folded in right here, cute and accounted for πŸ’…. This one is all about registering a gpio-led device, and it’s lowkey iconic.


🌸 NAME 🌸

gpio_led_register_device β€” register a gpio-led device πŸŽ€


✨ SYNOPSIS ✨

struct platform_device * gpio_led_register_device (int id , const struct
       gpio_led_platform_data *pdata );

πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” the platform ID. That’s the whole vibe check for this one 🫢
  • pdata β€” the platform data used for the new device. It’s giving β€œblueprint for the new leds-gpio device” ✨

πŸ’– DESCRIPTION πŸ’–

okay so here’s the tea β˜•: this function makes a copy of pdata and pdata->leds, and registers a new leds-gpio device with the result. The way that works is honestly kind of a slay πŸ’….

It lets pdata and pdata-leds live in .init.rodata, and that saves some bytes compared to a static struct platform_device with static platform data. no cap, that’s the glow-up 🌈.

It returns the registered device or an error pointer. Those are the options, bestie πŸ’–.


πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/leds/leds-gpio-register.c β€” go peek, bestie πŸ‘€

🫢 that’s the whole page! source/version is ./drivers/leds, dated October 2026 β€” mwah πŸ’‹

πŸ“¦ where this page comes from