of_regulator_get(9)
π 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 fordev_printkmessages. 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 π§
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_optional(9)of_check_coupling_data(9)of_parse_coupled_regulator(9)of_regulator_bulk_get_all(9)
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
- 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