Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM: Drop generic_subsys_pm_ops

Since the PM core is now going to execute driver callbacks directly
if the corresponding subsystem callbacks are not present,
forward-only subsystem callbacks (i.e. such that only execute the
corresponding driver callbacks) are not necessary any more. Thus
it is possible to remove generic_subsys_pm_ops, because the only
callback in there that is not forward-only, .runtime_idle, is not
really used by the only user of generic_subsys_pm_ops, which is
vio_bus_type.

However, the generic callback routines themselves cannot be removed
from generic_ops.c, because they are used individually by a number
of subsystems.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

-39
-1
arch/powerpc/kernel/vio.c
··· 1406 1406 .match = vio_bus_match, 1407 1407 .probe = vio_bus_probe, 1408 1408 .remove = vio_bus_remove, 1409 - .pm = GENERIC_SUBSYS_PM_OPS, 1410 1409 }; 1411 1410 1412 1411 /**
-25
drivers/base/power/generic_ops.c
··· 276 276 pm_runtime_idle(dev); 277 277 } 278 278 #endif /* CONFIG_PM_SLEEP */ 279 - 280 - struct dev_pm_ops generic_subsys_pm_ops = { 281 - #ifdef CONFIG_PM_SLEEP 282 - .prepare = pm_generic_prepare, 283 - .suspend = pm_generic_suspend, 284 - .suspend_noirq = pm_generic_suspend_noirq, 285 - .resume = pm_generic_resume, 286 - .resume_noirq = pm_generic_resume_noirq, 287 - .freeze = pm_generic_freeze, 288 - .freeze_noirq = pm_generic_freeze_noirq, 289 - .thaw = pm_generic_thaw, 290 - .thaw_noirq = pm_generic_thaw_noirq, 291 - .poweroff = pm_generic_poweroff, 292 - .poweroff_noirq = pm_generic_poweroff_noirq, 293 - .restore = pm_generic_restore, 294 - .restore_noirq = pm_generic_restore_noirq, 295 - .complete = pm_generic_complete, 296 - #endif 297 - #ifdef CONFIG_PM_RUNTIME 298 - .runtime_suspend = pm_generic_runtime_suspend, 299 - .runtime_resume = pm_generic_runtime_resume, 300 - .runtime_idle = pm_generic_runtime_idle, 301 - #endif 302 - }; 303 - EXPORT_SYMBOL_GPL(generic_subsys_pm_ops);
-13
include/linux/pm.h
··· 300 300 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 301 301 } 302 302 303 - /* 304 - * Use this for subsystems (bus types, device types, device classes) that don't 305 - * need any special suspend/resume handling in addition to invoking the PM 306 - * callbacks provided by device drivers supporting both the system sleep PM and 307 - * runtime PM, make the pm member point to generic_subsys_pm_ops. 308 - */ 309 - #ifdef CONFIG_PM 310 - extern struct dev_pm_ops generic_subsys_pm_ops; 311 - #define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops) 312 - #else 313 - #define GENERIC_SUBSYS_PM_OPS NULL 314 - #endif 315 - 316 303 /** 317 304 * PM_EVENT_ messages 318 305 *