dpm_for_each_dev(9)
π dpm_for_each_dev(9) π
okay so bestie, welcome to the Kernel API Manual β¨ this one's a lil cutie from the device power management corner of the kernel, and honestly? it's giving "simple but iconic." let's get into it π«Ά
β¨ NAME β¨
dpm_for_each_dev β the device iterator. that's it, that's the vibe π¦ it walks the list and hits you with a callback for every single device.
πΈ SYNOPSIS πΈ
void dpm_for_each_dev (void *data , void (*fn)(struct device *, void *)
);
no cap, that's the whole signature. two args, zero drama π
π ARGUMENTS π
dataβ literally just the data you wanna hand off to the callback. it gets passed straight through, no questions asked πfnβ the function that gets called for each device. your main character callback, fr fr π
π¦ DESCRIPTION π¦
so here's the tea β β dpm_for_each_dev iterates over the devices in dpm_list, and for each and every device it calls fn, passing along data. that's the entire plot. no plot twists, no hidden lore, just a clean lil loop through the list π
β¨
like, it's a for-each. it does the for-each thing. and it ate. periodt π
π SEE ALSO π
bestie there are SO many siblings in this family, buckle up π first the kernel file: ./drivers/base/power/main.c
pm_hibernate_is_recovering(9)device_pm_sleep_init(9)device_pm_lock(9)device_pm_unlock(9)device_pm_add(9)device_pm_remove(9)device_pm_move_before(9)device_pm_move_after(9)device_pm_move_last(9)dpm_wait(9)pm_op(9)pm_late_early_op(9)pm_noirq_op(9)dpm_watchdog_handler(9)dpm_watchdog_set(9)dpm_watchdog_clear(9)dev_pm_skip_resume(9)device_resume_noirq(9)dpm_resume_noirq(9)device_resume_early(9)dpm_resume_early(9)dpm_resume_start(9)device_resume(9)dpm_resume(9)device_complete(9)dpm_complete(9)dpm_resume_end(9)resume_event(9)device_suspend_noirq(9)dpm_suspend_noirq(9)device_suspend_late(9)dpm_suspend_late(9)dpm_suspend_end(9)legacy_suspend(9)device_suspend(9)dpm_suspend(9)device_prepare(9)dpm_prepare(9)dpm_suspend_start(9)device_pm_wait_for_dev(9)
go read them all, iykyk ππ
lowkey a reminder: this page only tells you what the function does β iteratedpm_list, callfnper device withdata. don't go reading extra behaviour into it, bestie π
and that's a wrap, gorgeous πΈ this gem comes from ./drivers/base/power, dated October 2026 β go off, you absolute icon ππ
β
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms