of_regulator_get_optional(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ 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 for dev_printk messages. 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, iykyk
  • id β€” 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 🌟

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