sun/sungem: use generic power management
authorVaibhav Gupta <vaibhavgupta40@gmail.com>
Mon, 6 Jul 2020 08:57:44 +0000 (14:27 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2020 19:24:15 +0000 (12:24 -0700)
commitd4ce70b3b6b777e6a76e18b5c4ca9cb50085efb8
tree2d5961ea4d68d68dcee07bd4cddfabbf055fa93e
parent5bd6ff0c6fe6c138aebe8d3bf7163420386c7ca7
sun/sungem: use generic power management

With legacy PM, drivers themselves were responsible for managing the
device's power states and takes care of register states. And they use PCI
helper functions to do it.

After upgrading to the generic structure, PCI core will take care of
required tasks and drivers should do only device-specific operations.

In this driver:
gem_suspend() calls gem_do_stop() which in turn invokes
pci_disable_device(). As the PCI helper function is not called at the
end/start of the function body, breaking the function in two parts
may change its behavior.

The only other function invoking gem_do_stop() is gem_close(). Hence,
gem_close() and gem_suspend() can do the required end steps on their own.

The same case is with gem_resume(). Both gem_resume() and gem_open()
invoke gem_do_start(). Again, make the caller functions do the required
steps on their own.

Compile-tested only.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sungem.c