ide: use generic power management
Earlier, drivers had to manage the device's power states, and related
operations, themselves. With the generic approach, these are done by PCI
The ide_pci_suspend() and ide_pci_resume(), declared in
include/linux/ide.h and defined in drivers/ide/setup-pci.c, were external
and were exported. Those were then used by other source files.
Now, as they have to bind with dev_pm_ops object, there is no need to
export them and they can be made static.
Declare an extern const dev_pm_ops object in include/linux/ide.h and define
it in drivers/ide/setup-pci.c with SIMPLE_DEV_PM_OPS macro, binding
suspend, and resume callbacks with it. This object can now be used by other
The following source files are binding same dev_pm_ops object in their PM:
The drivers/ide/triflex.c driver was also using ide_pci_resume() callback
but it had its own definition for .suspend() as it does not want to power
off the device during suspend. Hence, disable its PM explicitly inside
triflex_init_one() as "dev->pm_caps = 0".
Signed-off-by: Vaibhav Gupta <email@example.com>
Signed-off-by: David S. Miller <firstname.lastname@example.org>
30 files changed