]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbfc820361f83d8242fced6dc291df3f6e7f1fe17
tree2d5961ea4d68d68dcee07bd4cddfabbf055fa93e
parent71fbe3d6ef42c73fbfbb9aae47fa96bf9b566d20
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