@@ -4821,7 +4821,7 @@ static void rtl8169_net_suspend(struct rtl8169_private *tp)
4821
4821
4822
4822
#ifdef CONFIG_PM
4823
4823
4824
- static int rtl8169_suspend (struct device * device )
4824
+ static int __maybe_unused rtl8169_suspend (struct device * device )
4825
4825
{
4826
4826
struct rtl8169_private * tp = dev_get_drvdata (device );
4827
4827
@@ -4847,7 +4847,7 @@ static void __rtl8169_resume(struct rtl8169_private *tp)
4847
4847
rtl_unlock_work (tp );
4848
4848
}
4849
4849
4850
- static int rtl8169_resume (struct device * device )
4850
+ static int __maybe_unused rtl8169_resume (struct device * device )
4851
4851
{
4852
4852
struct rtl8169_private * tp = dev_get_drvdata (device );
4853
4853
@@ -4909,24 +4909,12 @@ static int rtl8169_runtime_idle(struct device *device)
4909
4909
}
4910
4910
4911
4911
static const struct dev_pm_ops rtl8169_pm_ops = {
4912
- .suspend = rtl8169_suspend ,
4913
- .resume = rtl8169_resume ,
4914
- .freeze = rtl8169_suspend ,
4915
- .thaw = rtl8169_resume ,
4916
- .poweroff = rtl8169_suspend ,
4917
- .restore = rtl8169_resume ,
4918
- .runtime_suspend = rtl8169_runtime_suspend ,
4919
- .runtime_resume = rtl8169_runtime_resume ,
4920
- .runtime_idle = rtl8169_runtime_idle ,
4912
+ SET_SYSTEM_SLEEP_PM_OPS (rtl8169_suspend , rtl8169_resume )
4913
+ SET_RUNTIME_PM_OPS (rtl8169_runtime_suspend , rtl8169_runtime_resume ,
4914
+ rtl8169_runtime_idle )
4921
4915
};
4922
4916
4923
- #define RTL8169_PM_OPS (&rtl8169_pm_ops)
4924
-
4925
- #else /* !CONFIG_PM */
4926
-
4927
- #define RTL8169_PM_OPS NULL
4928
-
4929
- #endif /* !CONFIG_PM */
4917
+ #endif /* CONFIG_PM */
4930
4918
4931
4919
static void rtl_wol_shutdown_quirk (struct rtl8169_private * tp )
4932
4920
{
@@ -5458,7 +5446,9 @@ static struct pci_driver rtl8169_pci_driver = {
5458
5446
.probe = rtl_init_one ,
5459
5447
.remove = rtl_remove_one ,
5460
5448
.shutdown = rtl_shutdown ,
5461
- .driver .pm = RTL8169_PM_OPS ,
5449
+ #ifdef CONFIG_PM
5450
+ .driver .pm = & rtl8169_pm_ops ,
5451
+ #endif
5462
5452
};
5463
5453
5464
5454
module_pci_driver (rtl8169_pci_driver );
0 commit comments