NET: smc91x: convert to dev_pm_ops
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/net/smc91x.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
drivers/net/smc91x.c +12 -6
@@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)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 (netif_running (ndev)) {
@@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)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) {struct smc_local *lp =netdev_priv (ndev);
@@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)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 = { .probe = smc_drv_probe, .remove =__devexit_p (smc_drv_remove), - .suspend = smc_drv_suspend, - .resume = smc_drv_resume, .driver = { .name =CARDNAME , .owner =THIS_MODULE , + .pm = &smc_drv_pm_ops, }, };
Signature · 1 line
1.6.5.1
Quoted 5 lines · Kevin Hilman
Convert smc91x driver from legacy PM hooks over to using
dev_pm_ops.Tested on OMAP3 platform.
Signed-off-by Kevin Hilman <[email protected]>
Acked-by Nicolas Pitre <[email protected]>
Quoted 58 lines
--- drivers/net/smc91x.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)drivers/net/smc91x.c +12
-6@@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)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 (netif_running (ndev)) {@@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)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) {struct smc_local *lp =netdev_priv (ndev);@@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)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 = { .probe = smc_drv_probe, .remove =__devexit_p (smc_drv_remove), - .suspend = smc_drv_suspend, - .resume = smc_drv_resume, .driver = { .name =CARDNAME , .owner =THIS_MODULE , + .pm = &smc_drv_pm_ops, }, };Signature · 1 line
1.6.5.1
From: Nicolas Pitre <[email protected]>
Date: Tue, 24 Nov 2009 20:13:15 -0500 (EST)
Quoted 9 lines · Kevin Hilman
Quoted 6 lines
Convert smc91x driver from legacy PM hooks over to using
dev_pm_ops.Tested on OMAP3 platform.
Signed-off-by Kevin Hilman <[email protected]>Acked-by Nicolas Pitre <[email protected]>
Applied to net-next-2.6, thanks.
Quoted 3 lines · Kevin Hilman
Convert smc91x driver from legacy PM hooks over to using
dev_pm_ops.Tested on OMAP3 platform.
It seems to be missing the hibernation hooks, at least .freeze() and .restore(), but I guess .thaw() as well.
Quoted 1 line
Signed-off-by Kevin Hilman <[email protected]>
Thanks (and sorry for the late response),
Rafael
Quoted 54 lines
--- drivers/net/smc91x.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)drivers/net/smc91x.c +12
-6@@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev)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 (netif_running (ndev)) {@@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)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) {struct smc_local *lp =netdev_priv (ndev);@@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev)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 = { .probe = smc_drv_probe, .remove =__devexit_p (smc_drv_remove), - .suspend = smc_drv_suspend, - .resume = smc_drv_resume, .driver = { .name =CARDNAME , .owner =THIS_MODULE , + .pm = &smc_drv_pm_ops, }, };