Skip to content

Commit 6b69f8a

Browse files
committed
net: intel: implement modern PM ops declarations
Author: Jesse Brandeburg <jesse.brandeburg@intel.com> Switch the Intel networking drivers to use the new power management ops declaration formats and macros, which allows us to drop __maybe_unused, as well as a bunch of ifdef checking CONFIG_PM. This is safe to do because the compiler drops the unused functions, verified by checking for any of the power management function symbols being present in System.map for a build without CONFIG_PM. If a driver has runtime PM, define the ops with pm_ptr(), and if the driver has Simple PM, use pm_sleep_ptr(), as well as the new versions of the macros for declaring the members of the pm_ops structs. Checked with network-enabled allnoconfig, allyesconfig, allmodconfig on x64_64. Reviewed-by: Alan Brady <alan.brady@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> (cherry picked from commit 75a3f93) Conflicts: Partial backport JIRA: https://issues.redhat.com/browse/RHEL-17488 Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
1 parent 5eacfb7 commit 6b69f8a

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/intel/igbvf

1 file changed

+3
-3
lines changed

drivers/net/ethernet/intel/igbvf/netdev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ static int igbvf_suspend(struct device *dev_d)
24702470
return 0;
24712471
}
24722472

2473-
static int __maybe_unused igbvf_resume(struct device *dev_d)
2473+
static int igbvf_resume(struct device *dev_d)
24742474
{
24752475
struct pci_dev *pdev = to_pci_dev(dev_d);
24762476
struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2957,15 +2957,15 @@ static const struct pci_device_id igbvf_pci_tbl[] = {
29572957
};
29582958
MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
29592959

2960-
static SIMPLE_DEV_PM_OPS(igbvf_pm_ops, igbvf_suspend, igbvf_resume);
2960+
static DEFINE_SIMPLE_DEV_PM_OPS(igbvf_pm_ops, igbvf_suspend, igbvf_resume);
29612961

29622962
/* PCI Device API Driver */
29632963
static struct pci_driver igbvf_driver = {
29642964
.name = igbvf_driver_name,
29652965
.id_table = igbvf_pci_tbl,
29662966
.probe = igbvf_probe,
29672967
.remove = igbvf_remove,
2968-
.driver.pm = &igbvf_pm_ops,
2968+
.driver.pm = pm_sleep_ptr(&igbvf_pm_ops),
29692969
.shutdown = igbvf_shutdown,
29702970
.err_handler = &igbvf_err_handler
29712971
};

0 commit comments

Comments
 (0)