mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 20:04:16 +08:00
NET: smc91x: convert to dev_pm_ops
Convert smc91x driver from legacy PM hooks over to using dev_pm_ops. Tested on OMAP3 platform. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5656b6ca19
commit
9f950f72e5
@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
|
static int smc_drv_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = platform_get_drvdata(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
if (ndev) {
|
if (ndev) {
|
||||||
if (netif_running(ndev)) {
|
if (netif_running(ndev)) {
|
||||||
@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int smc_drv_resume(struct platform_device *dev)
|
static int smc_drv_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = platform_get_drvdata(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
|
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
if (ndev) {
|
if (ndev) {
|
||||||
struct smc_local *lp = netdev_priv(ndev);
|
struct smc_local *lp = netdev_priv(ndev);
|
||||||
@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct dev_pm_ops smc_drv_pm_ops = {
|
||||||
|
.suspend = smc_drv_suspend,
|
||||||
|
.resume = smc_drv_resume,
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver smc_driver = {
|
static struct platform_driver smc_driver = {
|
||||||
.probe = smc_drv_probe,
|
.probe = smc_drv_probe,
|
||||||
.remove = __devexit_p(smc_drv_remove),
|
.remove = __devexit_p(smc_drv_remove),
|
||||||
.suspend = smc_drv_suspend,
|
|
||||||
.resume = smc_drv_resume,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = CARDNAME,
|
.name = CARDNAME,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.pm = &smc_drv_pm_ops,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user