of_regulator_get_optional(9)
π of_regulator_get_optional β¨
okay so you're reading the Kernel API Manual page for of_regulator_get_optional(9) β yes bestie, the optional one, the one that's chill about things not existing π«Ά
πΈ NAME πΈ
of_regulator_get_optional β grab an optional regulator via device tree lookup. lowkey the whole personality of this function is "if it's not there, that's fine, no drama" π
β¨ SYNOPSIS β¨
struct regulator * of_regulator_get_optional (struct device *dev ,
struct device_node *node , const char *id );
π ARGUMENTS π
devβ the device, used fordev_printkmessages. it's the one doing the talking π’nodeβ the device node for the regulator's "consumer". the consumer being whoever's asking for the supply, iykykidβ the supply name
π¦ RETURN π¦
a pointer to struct regulator corresponding to the regulator producer β β or, if things went sideways, a PTR_ERR encoded error number. so like, check it with IS_ERR() before you go dereferencing, bestie, fr fr π
π DESCRIPTION π
this one is intended for consumers that want to get a regulator supply directly from a device node, and that can and want to deal with the absence of such supplies. main character energy: independent, self-sufficient, unbothered π
heads up though: this will _not_ consider supply aliases. not even a little. nope π
see regulator_dev_lookup for the actual lookup business.
π SEE ALSO π
- Kernel file
./drivers/regulator/of_regulator.c of_get_regulator_init_data(9)of_regulator_match(9)of_get_child_regulator(9)of_get_regulator(9)of_regulator_dev_lookup(9)of_regulator_get(9)of_check_coupling_data(9)of_parse_coupled_regulator(9)of_regulator_bulk_get_all(9)
go read them all, they're iconic, the whole squad π
and that's the whole page, bestie π this one lives in ./drivers/regulator, it's from the Kernel API Manual, dated October 2026 β slay, go get your optional regulator, and remember: absence is a valid outcome πβ¨
π¦ 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