devm_regulator_get_optional(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– devm_regulator_get_optional β€” the Kernel API Manual tea 🫢

okay so bestie, welcome to the devm_regulator_get_optional(9) page ✨ this is a Kernel API Manual moment, and honestly it's giving "small page, big energy" πŸ’…


✨ NAME ✨

devm_regulator_get_optional β€” the resource-managed glow-up of regulator_get_optional() 🌸

like, same vibe, but the kernel cleans up after you. iconic behavior tbh πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

struct regulator * devm_regulator_get_optional (struct device *dev ,
   const char *id );

yep that's the whole signature, no cap πŸ“ she takes a device and an id string and hands you back a struct regulator * πŸŽ€


🌈 ARGUMENTS 🌈

  • dev β€” the device that's getting supplied πŸ”Œ like, who's the consumer here, bestie?
  • id β€” the supply name or the regulator ID 🏷️ either one, she's flexible

πŸ’œ DESCRIPTION πŸ’œ

so. it's a managed regulator_get_optional. that's the whole bit 🫢

regulators that come back from this function are automatically regulator_put on driver detach β€” no manual cleanup era, we love a self-cleaning queen 🧚✨

for more info, go peek at regulator_get_optional β€” that's where the real lore lives πŸ“–

ngl bestie, regulator_get_optional is the un-managed one, so this page is basically saying "same thing but devm handles the put for you" πŸ’€ don't @ me, that's literally what it says

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group πŸ«‚ and also the kernel file she lives in:

./drivers/regulator/devres.c πŸ“

like, that is a long list and every single one of them made it in here because we do not skip entries in this house πŸŽ€πŸ”₯


and that's the page!! πŸ’– big sign-off energy: this one lives out of ./drivers/regulator, dated October 2026, and the whole family is filed under devm_regulator_get_optional(9) πŸ¦‹ slay, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from