diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-24 07:57:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 03:21:29 -0500 |
commit | 9f950f72e57fe4bf9b16ace67e4cc5ffcee79d00 (patch) | |
tree | cb6c1411f650c13613cfa9a7558b23f127b239bc /drivers/net/smc91x.c | |
parent | 5656b6ca19c602a7074effae360e5a4dcfdc8170 (diff) |
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>
Diffstat (limited to 'drivers/net/smc91x.c')
-rw-r--r-- | drivers/net/smc91x.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 0b56ab468d28..2ab90260d4a6 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2365,9 +2365,10 @@ static int __devexit smc_drv_remove(struct platform_device *pdev) | |||
2365 | return 0; | 2365 | return 0; |
2366 | } | 2366 | } |
2367 | 2367 | ||
2368 | static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) | 2368 | static int smc_drv_suspend(struct device *dev) |
2369 | { | 2369 | { |
2370 | struct net_device *ndev = platform_get_drvdata(dev); | 2370 | struct platform_device *pdev = to_platform_device(dev); |
2371 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2371 | 2372 | ||
2372 | if (ndev) { | 2373 | if (ndev) { |
2373 | if (netif_running(ndev)) { | 2374 | if (netif_running(ndev)) { |
@@ -2379,9 +2380,10 @@ static int smc_drv_suspend(struct platform_device *dev, pm_message_t state) | |||
2379 | return 0; | 2380 | return 0; |
2380 | } | 2381 | } |
2381 | 2382 | ||
2382 | static int smc_drv_resume(struct platform_device *dev) | 2383 | static int smc_drv_resume(struct device *dev) |
2383 | { | 2384 | { |
2384 | struct net_device *ndev = platform_get_drvdata(dev); | 2385 | struct platform_device *pdev = to_platform_device(dev); |
2386 | struct net_device *ndev = platform_get_drvdata(pdev); | ||
2385 | 2387 | ||
2386 | if (ndev) { | 2388 | if (ndev) { |
2387 | struct smc_local *lp = netdev_priv(ndev); | 2389 | struct smc_local *lp = netdev_priv(ndev); |
@@ -2397,14 +2399,18 @@ static int smc_drv_resume(struct platform_device *dev) | |||
2397 | return 0; | 2399 | return 0; |
2398 | } | 2400 | } |
2399 | 2401 | ||
2402 | static struct dev_pm_ops smc_drv_pm_ops = { | ||
2403 | .suspend = smc_drv_suspend, | ||
2404 | .resume = smc_drv_resume, | ||
2405 | }; | ||
2406 | |||
2400 | static struct platform_driver smc_driver = { | 2407 | static struct platform_driver smc_driver = { |
2401 | .probe = smc_drv_probe, | 2408 | .probe = smc_drv_probe, |
2402 | .remove = __devexit_p(smc_drv_remove), | 2409 | .remove = __devexit_p(smc_drv_remove), |
2403 | .suspend = smc_drv_suspend, | ||
2404 | .resume = smc_drv_resume, | ||
2405 | .driver = { | 2410 | .driver = { |
2406 | .name = CARDNAME, | 2411 | .name = CARDNAME, |
2407 | .owner = THIS_MODULE, | 2412 | .owner = THIS_MODULE, |
2413 | .pm = &smc_drv_pm_ops, | ||
2408 | }, | 2414 | }, |
2409 | }; | 2415 | }; |
2410 | 2416 | ||