devm_of_regu...get_optional(9)
π devm_of_regu...get_optional(9) β a whole entire kernel API manual, bestie
okay so this is from the Kernel API Manual and the star of the show is devm_of_regulator_get_optional, which is the resource-managed version of of_regulator_get_optional(). yes the title is truncated with dots, no we're not gonna be normal about it β¨
β¨ NAME β¨
devm_of_regulator_get_optional β it's literally just of_regulator_get_optional() but with the "devm" glow-up, aka Resource managed. π«Ά
πΈ SYNOPSIS πΈ
struct regulator * devm_of_regulator_get_optional (struct device *dev ,
struct device_node *node , const char *id );
that's the whole vibe. three args, one pointer back, no cap. π
π ARGUMENTS π
devβ the device, bestie. it's what gets used fordev_printkmessages and it's the thing that owns the resource lifetime management (so like, it decides how long this whole situationship lasts π¦).nodeβ the device node for the regulator "consumer". yes the quotes are in the original, it's giving very "we don't know what you're doing with it either" πidβ the supply name or the regulator ID. pick one, it's your label β¨
π DESCRIPTION π
so this is the Managed regulator_get_optional. what does managed mean in this context? it means the regulators you get back from this function are automatically regulator_put on driver detach. like you don't have to clean up after yourself, the kernel does it for you. main character behaviour fr fr. π
want more tea on how the actual getting works? the original says to see of_regulator_get_optional for more information β so go read that one, iykyk π
π SEE ALSO π
so the kernel file here is ./drivers/regulator/devres.c and honestly the friend group is large, let's go through them one by one π§
devm_regulator_get(9)devm_regulator_get_exclusive(9)devm_regulator_get_enable_optional(9)devm_regulator_get_enable(9)devm_regulator_get_optional(9)devm_regulator_get_enable_read_voltage(9)devm_regulator_put(9)devm_regulator_bulk_get(9)devm_regulator_bulk_get_exclusive(9)devm_regulator_bulk_get_const(9)devm_regulator_bulk_put(9)devm_regulator_bulk_get_enable(9)devm_regulator_register(9)devm_regulator_register_supply_alias(9)devm_regulator_bulk_register_supply_alias(9)devm_regulator_register_notifier(9)devm_regulator_unregister_notifier(9)devm_regulator_irq_helper(9)devm_of_regulator_get(9)
like i said. huge friend group. all iconic. π₯
ok that's the whole page, go get your regulator (optionally) π
and that's a wrap on this one, bestie β brought to you by the ./drivers/regulator source and version, dated October 2026, signing off with devm_of_regu...get_optional(9) energy forever βππΈ
π¦ 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