of_regulator_dev_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ of_regulator_dev_lookup(9) πŸ‘‘

okay so bestie, this is the Kernel API Manual page for of_regulator_dev_lookup(9), and it's here to spill the tea on looking up a regulator device using device tree only. No extra sources, no side quests β€” just device tree vibes. ✨


πŸ’– NAME πŸ’–

of_regulator_dev_lookup β€” lookup a regulator device with device tree only.

✨ SYNOPSIS ✨

struct regulator_dev * of_regulator_dev_lookup (struct device *dev , struct device_node *np , const char *supply );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” Device pointer for regulator supply lookup. Like, the device bestie you're checking for a supply. 🫢
  • np β€” Device node pointer for regulator supply lookup. The device-node bestie in the mix. πŸ¦‹
  • supply β€” Supply name or regulator ID. This is the name/ID you're hunting for, periodt. πŸ’…

πŸ”₯ RETURN πŸ”₯

On success, you get a pointer to the struct regulator_dev β€” iconic. On error, you get an ERR_PTR encoded value. That's the whole return vibe. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

If it succeeds, it returns a pointer to the struct regulator_dev that corresponds to the name supply, and the embedded struct device refcount is incremented by one. ✨ The refcount must be dropped by calling put_device. No cap, don't forget that part β€” it's important. 🫢

On failure, one of these ERR_PTR encoded values comes back:

  • -ENODEV if lookup fails permanently. It's giving "nope, not happening, ever." πŸ’€
  • -EPROBE_DEFER if lookup could succeed in the future. It's giving "not right now bestie, maybe later." ⏳

🌈 SEE ALSO 🌈

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


xoxo bestie πŸ’… this of_regulator_dev_lookup(9) page's source/version is ./drivers/regulator, and it's dated October 2026. slay. πŸŽ€

πŸ“¦ where this page comes from