can: pch_can: use generic power management
authorVaibhav Gupta <vaibhavgupta40@gmail.com>
Tue, 28 Jul 2020 08:57:57 +0000 (14:27 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 21 Sep 2020 08:13:18 +0000 (10:13 +0200)
commit306df0b00b90c5786ca3c6310f4008bebd9fc6da
tree9e6a4db739835eba687add375e18aa33edc4e69b
parentb060585d92cb0fe9c4f29ea412ea6b3da3ab136b
can: pch_can: use generic power management

Drivers using legacy power management .suspen()/.resume() callbacks have to
manage PCI states and device's PM states themselves. They also need to take
care of standard configuration registers.

Switch to generic power management framework using a single "struct dev_pm_ops"
variable to take the unnecessary load from the driver. This also avoids the
need for the driver to directly call most of the PCI helper functions and
device power state control functions, as through the generic framework PCI Core
takes care of the necessary operations, and drivers are required to do only
device-specific jobs.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Link: https://lore.kernel.org/r/20200728085757.888620-1-vaibhavgupta40@gmail.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/pch_can.c