devm_of_regu...get_optional(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 for dev_printk messages 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 🧚

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