r8169: use new PM macros
commit 8fe6e67064
upstream.
This is based on series [0] that extended the PM core. Now the compiler
can see the PM callbacks also on systems not defining CONFIG_PM.
The optimizer will remove the functions then in this case.
[0] https://lore.kernel.org/netdev/20211207002102.26414-1-paul@crapouillou.net/
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b7f3fac6d3
commit
da6cabc198
@ -4897,8 +4897,6 @@ static void rtl8169_net_suspend(struct rtl8169_private *tp)
|
|||||||
rtl8169_down(tp);
|
rtl8169_down(tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
|
|
||||||
static int rtl8169_runtime_resume(struct device *dev)
|
static int rtl8169_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct rtl8169_private *tp = dev_get_drvdata(dev);
|
struct rtl8169_private *tp = dev_get_drvdata(dev);
|
||||||
@ -4914,7 +4912,7 @@ static int rtl8169_runtime_resume(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused rtl8169_suspend(struct device *device)
|
static int rtl8169_suspend(struct device *device)
|
||||||
{
|
{
|
||||||
struct rtl8169_private *tp = dev_get_drvdata(device);
|
struct rtl8169_private *tp = dev_get_drvdata(device);
|
||||||
|
|
||||||
@ -4927,7 +4925,7 @@ static int __maybe_unused rtl8169_suspend(struct device *device)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __maybe_unused rtl8169_resume(struct device *device)
|
static int rtl8169_resume(struct device *device)
|
||||||
{
|
{
|
||||||
struct rtl8169_private *tp = dev_get_drvdata(device);
|
struct rtl8169_private *tp = dev_get_drvdata(device);
|
||||||
|
|
||||||
@ -4969,13 +4967,11 @@ static int rtl8169_runtime_idle(struct device *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops rtl8169_pm_ops = {
|
static const struct dev_pm_ops rtl8169_pm_ops = {
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(rtl8169_suspend, rtl8169_resume)
|
SYSTEM_SLEEP_PM_OPS(rtl8169_suspend, rtl8169_resume)
|
||||||
SET_RUNTIME_PM_OPS(rtl8169_runtime_suspend, rtl8169_runtime_resume,
|
RUNTIME_PM_OPS(rtl8169_runtime_suspend, rtl8169_runtime_resume,
|
||||||
rtl8169_runtime_idle)
|
rtl8169_runtime_idle)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp)
|
static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp)
|
||||||
{
|
{
|
||||||
/* WoL fails with 8168b when the receiver is disabled. */
|
/* WoL fails with 8168b when the receiver is disabled. */
|
||||||
|
Reference in New Issue
Block a user