diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-04-05 10:49:48 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-05-26 11:45:44 -0400 |
commit | ccd93854d44710adaa02cecf0ef5f24ab383dd20 (patch) | |
tree | 4e1f3d835631cec271f6ea7ec19c45b2f5a98925 /drivers/mtd/maps | |
parent | 15bce40cb3133bcc07d548013df97e4653d363c1 (diff) |
[MTD] Remove mtd->{suspend,resume} calls from board drivers
Now the MTD core will do this for us, we don't need to hook it up from
the board drivers.
Shame we can't do shutdown from the class too...
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/physmap.c | 40 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 22 | ||||
-rw-r--r-- | drivers/mtd/maps/rbtx4939-flash.c | 23 | ||||
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 23 |
4 files changed, 0 insertions, 108 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 29a901157352..380648e9051a 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -195,42 +195,6 @@ err_out: | |||
195 | } | 195 | } |
196 | 196 | ||
197 | #ifdef CONFIG_PM | 197 | #ifdef CONFIG_PM |
198 | static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state) | ||
199 | { | ||
200 | struct physmap_flash_info *info = platform_get_drvdata(dev); | ||
201 | int ret = 0; | ||
202 | int i; | ||
203 | |||
204 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) | ||
205 | if (info->mtd[i]->suspend) { | ||
206 | ret = info->mtd[i]->suspend(info->mtd[i]); | ||
207 | if (ret) | ||
208 | goto fail; | ||
209 | } | ||
210 | |||
211 | return 0; | ||
212 | fail: | ||
213 | for (--i; i >= 0; --i) | ||
214 | if (info->mtd[i]->suspend) { | ||
215 | BUG_ON(!info->mtd[i]->resume); | ||
216 | info->mtd[i]->resume(info->mtd[i]); | ||
217 | } | ||
218 | |||
219 | return ret; | ||
220 | } | ||
221 | |||
222 | static int physmap_flash_resume(struct platform_device *dev) | ||
223 | { | ||
224 | struct physmap_flash_info *info = platform_get_drvdata(dev); | ||
225 | int i; | ||
226 | |||
227 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) | ||
228 | if (info->mtd[i]->resume) | ||
229 | info->mtd[i]->resume(info->mtd[i]); | ||
230 | |||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | static void physmap_flash_shutdown(struct platform_device *dev) | 198 | static void physmap_flash_shutdown(struct platform_device *dev) |
235 | { | 199 | { |
236 | struct physmap_flash_info *info = platform_get_drvdata(dev); | 200 | struct physmap_flash_info *info = platform_get_drvdata(dev); |
@@ -242,16 +206,12 @@ static void physmap_flash_shutdown(struct platform_device *dev) | |||
242 | info->mtd[i]->resume(info->mtd[i]); | 206 | info->mtd[i]->resume(info->mtd[i]); |
243 | } | 207 | } |
244 | #else | 208 | #else |
245 | #define physmap_flash_suspend NULL | ||
246 | #define physmap_flash_resume NULL | ||
247 | #define physmap_flash_shutdown NULL | 209 | #define physmap_flash_shutdown NULL |
248 | #endif | 210 | #endif |
249 | 211 | ||
250 | static struct platform_driver physmap_flash_driver = { | 212 | static struct platform_driver physmap_flash_driver = { |
251 | .probe = physmap_flash_probe, | 213 | .probe = physmap_flash_probe, |
252 | .remove = physmap_flash_remove, | 214 | .remove = physmap_flash_remove, |
253 | .suspend = physmap_flash_suspend, | ||
254 | .resume = physmap_flash_resume, | ||
255 | .shutdown = physmap_flash_shutdown, | 215 | .shutdown = physmap_flash_shutdown, |
256 | .driver = { | 216 | .driver = { |
257 | .name = "physmap-flash", | 217 | .name = "physmap-flash", |
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 572d32fdf38a..643aa06b599e 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -140,24 +140,6 @@ static int __devexit pxa2xx_flash_remove(struct platform_device *dev) | |||
140 | } | 140 | } |
141 | 141 | ||
142 | #ifdef CONFIG_PM | 142 | #ifdef CONFIG_PM |
143 | static int pxa2xx_flash_suspend(struct platform_device *dev, pm_message_t state) | ||
144 | { | ||
145 | struct pxa2xx_flash_info *info = platform_get_drvdata(dev); | ||
146 | int ret = 0; | ||
147 | |||
148 | if (info->mtd && info->mtd->suspend) | ||
149 | ret = info->mtd->suspend(info->mtd); | ||
150 | return ret; | ||
151 | } | ||
152 | |||
153 | static int pxa2xx_flash_resume(struct platform_device *dev) | ||
154 | { | ||
155 | struct pxa2xx_flash_info *info = platform_get_drvdata(dev); | ||
156 | |||
157 | if (info->mtd && info->mtd->resume) | ||
158 | info->mtd->resume(info->mtd); | ||
159 | return 0; | ||
160 | } | ||
161 | static void pxa2xx_flash_shutdown(struct platform_device *dev) | 143 | static void pxa2xx_flash_shutdown(struct platform_device *dev) |
162 | { | 144 | { |
163 | struct pxa2xx_flash_info *info = platform_get_drvdata(dev); | 145 | struct pxa2xx_flash_info *info = platform_get_drvdata(dev); |
@@ -166,8 +148,6 @@ static void pxa2xx_flash_shutdown(struct platform_device *dev) | |||
166 | info->mtd->resume(info->mtd); | 148 | info->mtd->resume(info->mtd); |
167 | } | 149 | } |
168 | #else | 150 | #else |
169 | #define pxa2xx_flash_suspend NULL | ||
170 | #define pxa2xx_flash_resume NULL | ||
171 | #define pxa2xx_flash_shutdown NULL | 151 | #define pxa2xx_flash_shutdown NULL |
172 | #endif | 152 | #endif |
173 | 153 | ||
@@ -178,8 +158,6 @@ static struct platform_driver pxa2xx_flash_driver = { | |||
178 | }, | 158 | }, |
179 | .probe = pxa2xx_flash_probe, | 159 | .probe = pxa2xx_flash_probe, |
180 | .remove = __devexit_p(pxa2xx_flash_remove), | 160 | .remove = __devexit_p(pxa2xx_flash_remove), |
181 | .suspend = pxa2xx_flash_suspend, | ||
182 | .resume = pxa2xx_flash_resume, | ||
183 | .shutdown = pxa2xx_flash_shutdown, | 161 | .shutdown = pxa2xx_flash_shutdown, |
184 | }; | 162 | }; |
185 | 163 | ||
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c index d39f0adac846..83ed64512c5e 100644 --- a/drivers/mtd/maps/rbtx4939-flash.c +++ b/drivers/mtd/maps/rbtx4939-flash.c | |||
@@ -145,25 +145,6 @@ err_out: | |||
145 | } | 145 | } |
146 | 146 | ||
147 | #ifdef CONFIG_PM | 147 | #ifdef CONFIG_PM |
148 | static int rbtx4939_flash_suspend(struct platform_device *dev, | ||
149 | pm_message_t state) | ||
150 | { | ||
151 | struct rbtx4939_flash_info *info = platform_get_drvdata(dev); | ||
152 | |||
153 | if (info->mtd->suspend) | ||
154 | return info->mtd->suspend(info->mtd); | ||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | static int rbtx4939_flash_resume(struct platform_device *dev) | ||
159 | { | ||
160 | struct rbtx4939_flash_info *info = platform_get_drvdata(dev); | ||
161 | |||
162 | if (info->mtd->resume) | ||
163 | info->mtd->resume(info->mtd); | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static void rbtx4939_flash_shutdown(struct platform_device *dev) | 148 | static void rbtx4939_flash_shutdown(struct platform_device *dev) |
168 | { | 149 | { |
169 | struct rbtx4939_flash_info *info = platform_get_drvdata(dev); | 150 | struct rbtx4939_flash_info *info = platform_get_drvdata(dev); |
@@ -173,16 +154,12 @@ static void rbtx4939_flash_shutdown(struct platform_device *dev) | |||
173 | info->mtd->resume(info->mtd); | 154 | info->mtd->resume(info->mtd); |
174 | } | 155 | } |
175 | #else | 156 | #else |
176 | #define rbtx4939_flash_suspend NULL | ||
177 | #define rbtx4939_flash_resume NULL | ||
178 | #define rbtx4939_flash_shutdown NULL | 157 | #define rbtx4939_flash_shutdown NULL |
179 | #endif | 158 | #endif |
180 | 159 | ||
181 | static struct platform_driver rbtx4939_flash_driver = { | 160 | static struct platform_driver rbtx4939_flash_driver = { |
182 | .probe = rbtx4939_flash_probe, | 161 | .probe = rbtx4939_flash_probe, |
183 | .remove = rbtx4939_flash_remove, | 162 | .remove = rbtx4939_flash_remove, |
184 | .suspend = rbtx4939_flash_suspend, | ||
185 | .resume = rbtx4939_flash_resume, | ||
186 | .shutdown = rbtx4939_flash_shutdown, | 163 | .shutdown = rbtx4939_flash_shutdown, |
187 | .driver = { | 164 | .driver = { |
188 | .name = "rbtx4939-flash", | 165 | .name = "rbtx4939-flash", |
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index 05e9362dc7f0..c6210f5118d1 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c | |||
@@ -415,25 +415,6 @@ static int __exit sa1100_mtd_remove(struct platform_device *pdev) | |||
415 | } | 415 | } |
416 | 416 | ||
417 | #ifdef CONFIG_PM | 417 | #ifdef CONFIG_PM |
418 | static int sa1100_mtd_suspend(struct platform_device *dev, pm_message_t state) | ||
419 | { | ||
420 | struct sa_info *info = platform_get_drvdata(dev); | ||
421 | int ret = 0; | ||
422 | |||
423 | if (info) | ||
424 | ret = info->mtd->suspend(info->mtd); | ||
425 | |||
426 | return ret; | ||
427 | } | ||
428 | |||
429 | static int sa1100_mtd_resume(struct platform_device *dev) | ||
430 | { | ||
431 | struct sa_info *info = platform_get_drvdata(dev); | ||
432 | if (info) | ||
433 | info->mtd->resume(info->mtd); | ||
434 | return 0; | ||
435 | } | ||
436 | |||
437 | static void sa1100_mtd_shutdown(struct platform_device *dev) | 418 | static void sa1100_mtd_shutdown(struct platform_device *dev) |
438 | { | 419 | { |
439 | struct sa_info *info = platform_get_drvdata(dev); | 420 | struct sa_info *info = platform_get_drvdata(dev); |
@@ -441,16 +422,12 @@ static void sa1100_mtd_shutdown(struct platform_device *dev) | |||
441 | info->mtd->resume(info->mtd); | 422 | info->mtd->resume(info->mtd); |
442 | } | 423 | } |
443 | #else | 424 | #else |
444 | #define sa1100_mtd_suspend NULL | ||
445 | #define sa1100_mtd_resume NULL | ||
446 | #define sa1100_mtd_shutdown NULL | 425 | #define sa1100_mtd_shutdown NULL |
447 | #endif | 426 | #endif |
448 | 427 | ||
449 | static struct platform_driver sa1100_mtd_driver = { | 428 | static struct platform_driver sa1100_mtd_driver = { |
450 | .probe = sa1100_mtd_probe, | 429 | .probe = sa1100_mtd_probe, |
451 | .remove = __exit_p(sa1100_mtd_remove), | 430 | .remove = __exit_p(sa1100_mtd_remove), |
452 | .suspend = sa1100_mtd_suspend, | ||
453 | .resume = sa1100_mtd_resume, | ||
454 | .shutdown = sa1100_mtd_shutdown, | 431 | .shutdown = sa1100_mtd_shutdown, |
455 | .driver = { | 432 | .driver = { |
456 | .name = "sa1100-mtd", | 433 | .name = "sa1100-mtd", |