linux/drivers/net/ethernet/qlogic/netxen
Vaibhav Gupta 063ad9bcc2 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>
2020-07-04 18:02:06 -07:00
..
Makefile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15 2019-05-21 11:28:46 +02:00
netxen_nic.h qlogic: Replace zero-length array with flexible-array member 2020-02-26 16:43:09 -08:00
netxen_nic_ctx.c ethernet: remove redundant memset 2019-07-15 11:06:27 -07:00
netxen_nic_ethtool.c net: netxen: let core reject the unsupported coalescing parameters 2020-03-14 21:13:55 -07:00
netxen_nic_hdr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15 2019-05-21 11:28:46 +02:00
netxen_nic_hw.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15 2019-05-21 11:28:46 +02:00
netxen_nic_hw.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15 2019-05-21 11:28:46 +02:00
netxen_nic_init.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 15 2019-05-21 11:28:46 +02:00
netxen_nic_main.c netxen_nic: use generic power management 2020-07-04 18:02:06 -07:00