diff options
author | Vaibhav Gupta <vaibhavgupta40@gmail.com> | 2020-07-02 20:01:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-05 04:02:06 +0300 |
commit | 063ad9bcc297c1f4cfd3a35a6a709b3fd52031f3 (patch) | |
tree | 36b3ecdf511cf5e5fe1f36e860d321484857f31d /drivers/net/ethernet/8390/etherh.c | |
parent | b20a6b29a811bee0e44b64958d415eb50436154c (diff) | |
download | linux-063ad9bcc297c1f4cfd3a35a6a709b3fd52031f3.tar.xz |
netxen_nic: 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:
netxen_nic_resume() calls netxen_nic_attach_func() which then invokes PCI
helper functions like pci_enable_device(), pci_set_power_state() and
pci_restore_state(). Other function:
- netxen_io_slot_reset()
also calls netxen_nic_attach_func().
Also, netxen_io_slot_reset() returns specific value based on the return value
of netxen_nic_attach_func() as whole. Thus, cannot simply move some piece of
code from netxen_nic_attach_func() to it.
Hence, define a new function netxen_nic_attach_late_func() to do the tasks
which has to be done after PCI helper functions have done their job.
Now, netxen_nic_attach_func() invokes netxen_nic_attach_late_func(), thus
netxen_io_slot_reset() behaves normally.
And, netxen_nic_resume() calls netxen_nic_attach_late_func() to avoid PCI
helper functions calls.
Compile-tested only.
Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/8390/etherh.c')
0 files changed, 0 insertions, 0 deletions