diff options
-rw-r--r-- | drivers/net/smsc911x.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 94b6d2658ddc..c2667855a005 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/swab.h> | 50 | #include <linux/swab.h> |
51 | #include <linux/phy.h> | 51 | #include <linux/phy.h> |
52 | #include <linux/smsc911x.h> | 52 | #include <linux/smsc911x.h> |
53 | #include <linux/device.h> | ||
53 | #include "smsc911x.h" | 54 | #include "smsc911x.h" |
54 | 55 | ||
55 | #define SMSC_CHIPNAME "smsc911x" | 56 | #define SMSC_CHIPNAME "smsc911x" |
@@ -2114,10 +2115,12 @@ out_0: | |||
2114 | /* This implementation assumes the devices remains powered on its VDDVARIO | 2115 | /* This implementation assumes the devices remains powered on its VDDVARIO |
2115 | * pins during suspend. */ | 2116 | * pins during suspend. */ |
2116 | 2117 | ||
2117 | static int smsc911x_suspend(struct platform_device *pdev, pm_message_t state) | 2118 | /* TODO: implement freeze/thaw callbacks for hibernation.*/ |
2119 | |||
2120 | static int smsc911x_suspend(struct device *dev) | ||
2118 | { | 2121 | { |
2119 | struct net_device *dev = platform_get_drvdata(pdev); | 2122 | struct net_device *ndev = dev_get_drvdata(dev); |
2120 | struct smsc911x_data *pdata = netdev_priv(dev); | 2123 | struct smsc911x_data *pdata = netdev_priv(ndev); |
2121 | 2124 | ||
2122 | /* enable wake on LAN, energy detection and the external PME | 2125 | /* enable wake on LAN, energy detection and the external PME |
2123 | * signal. */ | 2126 | * signal. */ |
@@ -2128,10 +2131,10 @@ static int smsc911x_suspend(struct platform_device *pdev, pm_message_t state) | |||
2128 | return 0; | 2131 | return 0; |
2129 | } | 2132 | } |
2130 | 2133 | ||
2131 | static int smsc911x_resume(struct platform_device *pdev) | 2134 | static int smsc911x_resume(struct device *dev) |
2132 | { | 2135 | { |
2133 | struct net_device *dev = platform_get_drvdata(pdev); | 2136 | struct net_device *ndev = dev_get_drvdata(dev); |
2134 | struct smsc911x_data *pdata = netdev_priv(dev); | 2137 | struct smsc911x_data *pdata = netdev_priv(ndev); |
2135 | unsigned int to = 100; | 2138 | unsigned int to = 100; |
2136 | 2139 | ||
2137 | /* Note 3.11 from the datasheet: | 2140 | /* Note 3.11 from the datasheet: |
@@ -2149,19 +2152,25 @@ static int smsc911x_resume(struct platform_device *pdev) | |||
2149 | return (to == 0) ? -EIO : 0; | 2152 | return (to == 0) ? -EIO : 0; |
2150 | } | 2153 | } |
2151 | 2154 | ||
2155 | static struct dev_pm_ops smsc911x_pm_ops = { | ||
2156 | .suspend = smsc911x_suspend, | ||
2157 | .resume = smsc911x_resume, | ||
2158 | }; | ||
2159 | |||
2160 | #define SMSC911X_PM_OPS (&smsc911x_pm_ops) | ||
2161 | |||
2152 | #else | 2162 | #else |
2153 | #define smsc911x_suspend NULL | 2163 | #define SMSC911X_PM_OPS NULL |
2154 | #define smsc911x_resume NULL | ||
2155 | #endif | 2164 | #endif |
2156 | 2165 | ||
2157 | static struct platform_driver smsc911x_driver = { | 2166 | static struct platform_driver smsc911x_driver = { |
2158 | .probe = smsc911x_drv_probe, | 2167 | .probe = smsc911x_drv_probe, |
2159 | .remove = __devexit_p(smsc911x_drv_remove), | 2168 | .remove = __devexit_p(smsc911x_drv_remove), |
2160 | .driver = { | 2169 | .driver = { |
2161 | .name = SMSC_CHIPNAME, | 2170 | .name = SMSC_CHIPNAME, |
2171 | .owner = THIS_MODULE, | ||
2172 | .pm = SMSC911X_PM_OPS, | ||
2162 | }, | 2173 | }, |
2163 | .suspend = smsc911x_suspend, | ||
2164 | .resume = smsc911x_resume, | ||
2165 | }; | 2174 | }; |
2166 | 2175 | ||
2167 | /* Entry point for loading the module */ | 2176 | /* Entry point for loading the module */ |