regulator_dev_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… regulator_dev_lookup(9) πŸ’…

okay bestie, welcome to the Kernel API Manual page for regulator_dev_lookup. This one is lowkey iconic: it looks up a regulator device, and it has rules about refcounts. Let’s get into it. ✨


πŸŽ€ NAME πŸŽ€

regulator_dev_lookup β€” lookup a regulator device. πŸ’–


✨ SYNOPSIS ✨

struct regulator_dev * regulator_dev_lookup (struct device *dev , const
       char *supply );

🫢 ARGUMENTS 🫢

  • dev β€” device for regulator "consumer". like, the device that’s being all consumer-y about its regulator. πŸ“
  • supply β€” Supply name or regulator ID. that’s the thing you’re looking up, bestie.

πŸ’– RETURN πŸ’–

pointer to struct regulator_dev or ERR_PTR encoded negative error number. πŸ‘‘


🌸 DESCRIPTION 🌸

okay so if it succeeds, it returns a struct regulator_dev that corresponds to the name supply and with the embedded struct device refcount incremented by one. πŸ”₯

and listen: that refcount must be dropped by calling put_device. do not forget, bestie, that’s the whole vibe check. πŸ™ˆ

on failure, one of these ERR_PTR encoded values is returned:

  • -ENODEV β€” if lookup fails permanently. πŸ’€
  • -EPROBE_DEFER β€” if lookup could succeed in the future. ⭐

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./drivers/regulator/core.c

the whole regulator squad is here, no cap:


xoxo, bestie πŸ’– this page is from source/version ./drivers/regulator, and the date is October 2026. go look up those regulators and remember the put_device, periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from