of_regulator_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– of_regulator_get(9) β€” from the Kernel API Manual, bestie πŸ’–

okay so real talk, this one lives in the kernel API manual and it's literally the "grab me a regulator straight from the device tree" girlie. let's get into it ✨


🌸 NAME 🌸

of_regulator_get β€” get a regulator via device tree lookup. that's the whole vibe, no cap πŸŽ€


✨ SYNOPSIS ✨

struct regulator * of_regulator_get (struct device *dev , struct
device_node *node , const char *id );

like, she takes three things and hands you back a pointer. iconic behavior honestly πŸ¦‹


🫢 ARGUMENTS 🫢

  • dev β€” the device used for dev_printk messages. so if something goes sideways, this is who's gonna be doing the talking πŸ“’
  • node β€” the device node for the regulator "consumer". i.e. you, bestie, you're the consumer here πŸ’…
  • id β€” the supply name. this is how she knows which one you're asking for 🎯

πŸ’œ RETURN πŸ’œ

a pointer to the struct regulator that corresponds to the regulator producer β€” yay πŸŽ‰ β€” or a PTR_ERR encoded error number, which is the "it did not slay" path 😭 (check it with IS_ERR/PTR_ERR family, standard kernel pointer-error business β€” the manpage just tells you it's PTR_ERR encoded, so handle it accordingly).


πŸ”₯ DESCRIPTION πŸ”₯

so this function is intended for use by consumers that want to get a regulator supply directly from a device node. that's the whole assignment, periodt.

heads up: this will not consider supply aliases. like, at all. zero aliases acknowledged. πŸ™ˆ

and then: see regulator_dev_lookup for the actual lookup guts, iykyk.


🌈 SEE ALSO 🌈

kernel file ./drivers/regulator/of_regulator.c β€” that's where she lives, go say hi 🧚

like a whole friend group of regulator functions, obsessed πŸ’–


⭐ and that's the page!! brought to you by ./drivers/regulator (that's the source/version, mwah), dated October 2026, and honestly? she ate. πŸ“πŸ‘‘πŸ’«

πŸ“¦ where this page comes from