]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: make mdio_bus_phy_suspend/resume as __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Thu, 25 Feb 2021 14:57:27 +0000 (15:57 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Feb 2021 23:43:25 +0000 (15:43 -0800)
commit9d77d62a22f9f519a4d58839b25ebe53d505ef92
treeb14cc70ca9ec21d001fbb35c74b4b1dcffb6d932
parenta003422afb322d66712e34503175ed7ee3e79e0b
net: phy: make mdio_bus_phy_suspend/resume as __maybe_unused

When CONFIG_PM_SLEEP is disabled, the compiler warns about unused
functions:

drivers/net/phy/phy_device.c:273:12: error: unused function 'mdio_bus_phy_suspend' [-Werror,-Wunused-function]
static int mdio_bus_phy_suspend(struct device *dev)
drivers/net/phy/phy_device.c:293:12: error: unused function 'mdio_bus_phy_resume' [-Werror,-Wunused-function]
static int mdio_bus_phy_resume(struct device *dev)

The logic is intentional, so just mark these two as __maybe_unused
and remove the incorrect #ifdef.

Fixes: 964a774e0fd3 ("net: phy: consider that suspend2ram may cut off PHY power")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210225145748.404410-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c