led_get_default_pattern(9)
π led_get_default_pattern(9) β like, the Kernel API Manual page, bestie π
Okay so welcome to led_get_default_pattern(9), straight out of the Kernel API Manual β¨ grab a lil snack, this one's short and sweet π
πΈ NAME πΈ
led_get_default_pattern β returns the default pattern π lowkey does exactly what it says on the tin, no cap
β¨ SYNOPSIS β¨
u32 * led_get_default_pattern (struct led_classdev *led_cdev , unsigned
int *size );
That's the whole vibe right there π a u32 * coming back at you, takes a struct led_classdev * and an unsigned int *, iconic signature honestly π
π¦ ARGUMENTS π¦
led_cdevβ the LED you're getting the default pattern for π‘ it's giving "which LED bestie"sizeβ a pointer for storing the number of elements in the returned array π and here's the tea: it's modified only if the return is!= NULLπ so don't go reading it if you got nothing back
π RETURN π
You get an allocated array of integers with the default pattern from the device tree, or NULL if there isn't one π§
β οΈ Bestie, listen: the caller is responsible for kfree. That array is yours now. You allocated it (well, the function did, for you), you free it. Periodt π
π SEE ALSO π
Kernel file ./include/linux/leds.h β go read it, iykyk π and also all of these cuties:
struct led_lookup_data(9)led_classdev_register_ext(9)led_classdev_register(9)led_blink_set(9)led_blink_set_nosleep(9)led_blink_set_oneshot(9)led_set_brightness(9)led_set_brightness_sync(9)led_mc_set_brightness(9)led_update_brightness(9)led_sysfs_disable(9)led_sysfs_enable(9)led_compose_name(9)led_get_color_name(9)led_sysfs_is_disabled(9)struct led_pattern(9)
mwah π that's the page! This lil beauty lives in ./include/linux and the version/date stamp on it is October 2026, filed under led_get_default_pattern(9) π«Ά go forth and free your arrays, bestie πβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms