spi: spi-topcliff-pch: use generic power management
authorVaibhav Gupta <vaibhavgupta40@gmail.com>
Mon, 20 Jul 2020 15:57:15 +0000 (21:27 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jul 2020 00:55:52 +0000 (01:55 +0100)
commitf185bcc779808df5d31bc332b79b5f1455ee910b
treea2bea23262013c21f6cef1d10cf75c14eaca2330
parent4726773292bfdb2917a0b4d369ddccd5e2f30991
spi: spi-topcliff-pch: use generic power management

Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

This driver makes use of PCI helper functions like
pci_save/restore_state(), pci_enable/disable_device(), pci_enable_wake()
and pci_set_power_state() to do required operations. In generic mode, they
are no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.

Compile-tested only.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Link: https://lore.kernel.org/r/20200720155714.714114-1-vaibhavgupta40@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-topcliff-pch.c