regulator_get_exclusive(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

regulator_get_exclusive β€” obtain exclusive access to a regulator. Slay, that's the whole name. πŸ’…


✨ SYNOPSIS ✨

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

🫢 ARGUMENTS 🫢

  • dev β€” device for regulator "consumer", bestie. That's the one asking for the regulator.
  • id β€” Supply name or regulator ID. The way that this can be either one is lowkey important, iykyk. πŸ¦‹

πŸ’… DESCRIPTION πŸ’…

Okay so the whole point: while you're holding this reference, other consumers will be unable to obtain this regulator, and the use count for the regulator will be initialised to reflect the current state of the regulator. No cap, it's giving exclusive main character energy. πŸ‘‘

This is intended for use by consumers which cannot tolerate shared use of the regulator β€” such as those which need to force the regulator off for correct operation of the hardware they are controlling. Like, they literally cannot share, and that's valid. Periodt. πŸ”₯

Use of supply names configured via set_consumer_device_supply is strongly encouraged. It is recommended that the supply name used should match the name used for the supply and/or the relevant device pins in the datasheet. Fr fr, do that. πŸ“βœ¨


🌈 RETURN 🌈

Vibe check: you get a pointer to a struct regulator corresponding to the regulator producer, or an ERR_PTR encoded negative error number. That's the return situation, bestie. πŸ«ΆπŸ’–


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/regulator/core.c, plus this whole iconic crew:


With love from the Kernel API Manual, source/version ./drivers/regulator, dated October 2026 β€” page: regulator_get_exclusive(9) πŸŽ€βœ¨

πŸ“¦ where this page comes from