Skip to content

Commit

Permalink
net: davinci_mdio: add hibernation callbacks
Browse files Browse the repository at this point in the history
Setting a dev_pm_ops suspend_late/resume_early pair but not a
set of hibernation functions means those pm functions will
not be called upon hibernation.
Fix this by using SET_LATE_SYSTEM_SLEEP_PM_OPS, which appropriately
assigns the suspend and hibernation handlers and move
davinci_mdio_x callbacks under CONFIG_PM_SLEEP to avoid build warnings.

Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Grygorii Strashko authored and David S. Miller committed Mar 1, 2015
1 parent cac5e65 commit 2f5c54c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/ti/davinci_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ static int davinci_mdio_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int davinci_mdio_suspend(struct device *dev)
{
struct davinci_mdio_data *data = dev_get_drvdata(dev);
Expand Down Expand Up @@ -464,10 +465,10 @@ static int davinci_mdio_resume(struct device *dev)

return 0;
}
#endif

static const struct dev_pm_ops davinci_mdio_pm_ops = {
.suspend_late = davinci_mdio_suspend,
.resume_early = davinci_mdio_resume,
SET_LATE_SYSTEM_SLEEP_PM_OPS(davinci_mdio_suspend, davinci_mdio_resume)
};

#if IS_ENABLED(CONFIG_OF)
Expand Down

0 comments on commit 2f5c54c

Please sign in to comment.