Skip to content

Commit 483ed89

Browse files
Wei Yongjungregkh
authored andcommitted
net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
commit 7ec05a6 upstream Get rid of the CONFIG_PM_SLEEP ifdefery to fix the build error and use __maybe_unused for the suspend()/resume() hooks to avoid build warning: drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:21: error: 'stmmac_runtime_suspend' undeclared here (not in a function); did you mean 'stmmac_suspend'? 769 | SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL) | ^~~~~~~~~~~~~~~~~~~~~~ ./include/linux/pm.h:342:21: note: in definition of macro 'SET_RUNTIME_PM_OPS' 342 | .runtime_suspend = suspend_fn, \ | ^~~~~~~~~~ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:45: error: 'stmmac_runtime_resume' undeclared here (not in a function) 769 | SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL) | ^~~~~~~~~~~~~~~~~~~~~ ./include/linux/pm.h:343:20: note: in definition of macro 'SET_RUNTIME_PM_OPS' 343 | .runtime_resume = resume_fn, \ | ^~~~~~~~~ Fixes: 5ec5582 ("net: stmmac: add clocks management for gmac driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Meng Li <Meng.Li@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3afe11b commit 483ed89

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,15 +720,14 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
720720
}
721721
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
722722

723-
#ifdef CONFIG_PM_SLEEP
724723
/**
725724
* stmmac_pltfr_suspend
726725
* @dev: device pointer
727726
* Description: this function is invoked when suspend the driver and it direcly
728727
* call the main suspend function and then, if required, on some platform, it
729728
* can call an exit helper.
730729
*/
731-
static int stmmac_pltfr_suspend(struct device *dev)
730+
static int __maybe_unused stmmac_pltfr_suspend(struct device *dev)
732731
{
733732
int ret;
734733
struct net_device *ndev = dev_get_drvdata(dev);
@@ -749,7 +748,7 @@ static int stmmac_pltfr_suspend(struct device *dev)
749748
* the main resume function, on some platforms, it can call own init helper
750749
* if required.
751750
*/
752-
static int stmmac_pltfr_resume(struct device *dev)
751+
static int __maybe_unused stmmac_pltfr_resume(struct device *dev)
753752
{
754753
struct net_device *ndev = dev_get_drvdata(dev);
755754
struct stmmac_priv *priv = netdev_priv(ndev);
@@ -761,7 +760,7 @@ static int stmmac_pltfr_resume(struct device *dev)
761760
return stmmac_resume(dev);
762761
}
763762

764-
static int stmmac_runtime_suspend(struct device *dev)
763+
static int __maybe_unused stmmac_runtime_suspend(struct device *dev)
765764
{
766765
struct net_device *ndev = dev_get_drvdata(dev);
767766
struct stmmac_priv *priv = netdev_priv(ndev);
@@ -771,14 +770,13 @@ static int stmmac_runtime_suspend(struct device *dev)
771770
return 0;
772771
}
773772

774-
static int stmmac_runtime_resume(struct device *dev)
773+
static int __maybe_unused stmmac_runtime_resume(struct device *dev)
775774
{
776775
struct net_device *ndev = dev_get_drvdata(dev);
777776
struct stmmac_priv *priv = netdev_priv(ndev);
778777

779778
return stmmac_bus_clks_config(priv, true);
780779
}
781-
#endif /* CONFIG_PM_SLEEP */
782780

783781
const struct dev_pm_ops stmmac_pltfr_pm_ops = {
784782
SET_SYSTEM_SLEEP_PM_OPS(stmmac_pltfr_suspend, stmmac_pltfr_resume)

0 commit comments

Comments
 (0)