Skip to content

Commit

Permalink
net: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused
Browse files Browse the repository at this point in the history
[ Upstream commit 9b97123 ]

The newly added runtime-pm support causes a harmless warning
when CONFIG_PM is disabled:

drivers/net/phy/mdio-bcm-unimac.c:330:12: error: 'unimac_mdio_resume' defined but not used [-Werror=unused-function]
 static int unimac_mdio_resume(struct device *d)
drivers/net/phy/mdio-bcm-unimac.c:321:12: error: 'unimac_mdio_suspend' defined but not used [-Werror=unused-function]
 static int unimac_mdio_suspend(struct device *d)

Marking the functions as __maybe_unused is the easiest workaround
and avoids adding #ifdef checks.

Fixes: b78ac6e ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed Nov 20, 2019
1 parent 24adb0e commit 7fdedf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/mdio-bcm-unimac.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int unimac_mdio_remove(struct platform_device *pdev)
return 0;
}

static int unimac_mdio_suspend(struct device *d)
static int __maybe_unused unimac_mdio_suspend(struct device *d)
{
struct unimac_mdio_priv *priv = dev_get_drvdata(d);

Expand All @@ -325,7 +325,7 @@ static int unimac_mdio_suspend(struct device *d)
return 0;
}

static int unimac_mdio_resume(struct device *d)
static int __maybe_unused unimac_mdio_resume(struct device *d)
{
struct unimac_mdio_priv *priv = dev_get_drvdata(d);
int ret;
Expand Down

0 comments on commit 7fdedf0

Please sign in to comment.