OSDN Git Service

r8169: Avoid misuse of pm_ptr() macro
authorPaul Cercueil <paul@crapouillou.net>
Tue, 7 Dec 2021 00:20:58 +0000 (00:20 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 17 Dec 2021 15:04:14 +0000 (16:04 +0100)
The pm_ptr() macro should be used when the suspend and resume functions
can be compiled independently of the CONFIG_PM Kconfig option.

In the case of this driver, the suspend and resume functions are inside
a section protected by a #ifdef CONFIG_PM guard. Therefore pm_ptr()
should not be used.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/net/ethernet/realtek/r8169_main.c

index 86c44bc..6b81f95 100644 (file)
@@ -5441,7 +5441,9 @@ static struct pci_driver rtl8169_pci_driver = {
        .probe          = rtl_init_one,
        .remove         = rtl_remove_one,
        .shutdown       = rtl_shutdown,
-       .driver.pm      = pm_ptr(&rtl8169_pm_ops),
+#ifdef CONFIG_PM
+       .driver.pm      = &rtl8169_pm_ops,
+#endif
 };
 
 module_pci_driver(rtl8169_pci_driver);