i2c: eg20t: use generic power management
authorVaibhav Gupta <vaibhavgupta40@gmail.com>
Wed, 5 Aug 2020 19:36:16 +0000 (01:06 +0530)
committerWolfram Sang <wsa@kernel.org>
Mon, 10 Aug 2020 13:47:38 +0000 (15:47 +0200)
commit82c8eb22095fa747517845e7d5748ae2e4967359
tree820f45f0bd1790fe9dccb20ab2cdbbcf2f86ffc1
parent536e785f533f5a65ce5238e202d527d70fd4ab17
i2c: eg20t: 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>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-eg20t.c