From: Paul Cercueil Date: Tue, 7 Dec 2021 00:20:58 +0000 (+0000) Subject: r8169: Avoid misuse of pm_ptr() macro X-Git-Tag: block-5.17-2022-01-21~88^2~1^3~1^2~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=5ef11c56b2332613cacd5e7ac17cfb1a073b66ab;p=linux-2.6-block.git r8169: Avoid misuse of pm_ptr() macro 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 Reviewed-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 86c44bc5f73f..6b81f95698f0 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -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);