pm_runtime_get_if_in_use(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pm_runtime_get_if_in_use(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” today’s main character is pm_runtime_get_if_in_use, and it’s giving conditional runtime PM counter bump energy. πŸ’…βœ¨


✨ NAME ✨

pm_runtime_get_if_in_use β€” conditionally bump up the runtime PM usage counter. That’s the whole vibe. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

int pm_runtime_get_if_in_use (struct device *dev );

🌸 ARGUMENTS 🌸

  • dev β€” target device. The one and only device we’re checking, bestie. 🫢

πŸ’… DESCRIPTION πŸ’…

okay so here’s the tea β˜•: this function increments the runtime PM usage counter of dev only if the conditions line up. The bump happens if dev’s runtime PM status is RPM_ACTIVE and its runtime PM usage counter is greater than 0 or it is not ignoring children and its active child count is nonzero. When that happens, 1 is returned. slay. ✨

If dev is in a different state or it is not in use β€” meaning its usage counter is 0, or it is ignoring children, or its active child count is 0 β€” then 0 is returned. No bump, no drama. πŸ’€

And if runtime PM is disabled for the device, -EINVAL is returned. In that case the usage counter of dev is not updated either. so no sneaky increment, okay? πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file: ./drivers/base/power/runtime.c πŸ“

Related functions, exact names and all:


πŸ’– cute sign-off: source/version ./drivers/base/power, date October 2026, page for pm_runtime_get_if_in_use(9). bye bestie β€” go bump those counters responsibly! πŸ’…βœ¨

πŸ“¦ where this page comes from