Skip to content

Commit ccd9385

Browse files
David WoodhouseDavid Woodhouse
authored andcommitted
[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>
1 parent 15bce40 commit ccd9385

5 files changed

Lines changed: 0 additions & 113 deletions

File tree

‎drivers/mtd/maps/physmap.c‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -195,42 +195,6 @@ static int physmap_flash_probe(struct platform_device *dev)
195195
}
196196

197197
#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-
234198
static void physmap_flash_shutdown(struct platform_device *dev)
235199
{
236200
struct physmap_flash_info *info = platform_get_drvdata(dev);
@@ -242,16 +206,12 @@ static void physmap_flash_shutdown(struct platform_device *dev)
242206
info->mtd[i]->resume(info->mtd[i]);
243207
}
244208
#else
245-
#define physmap_flash_suspend NULL
246-
#define physmap_flash_resume NULL
247209
#define physmap_flash_shutdown NULL
248210
#endif
249211

250212
static struct platform_driver physmap_flash_driver = {
251213
.probe = physmap_flash_probe,
252214
.remove = physmap_flash_remove,
253-
.suspend = physmap_flash_suspend,
254-
.resume = physmap_flash_resume,
255215
.shutdown = physmap_flash_shutdown,
256216
.driver = {
257217
.name = "physmap-flash",

‎drivers/mtd/maps/pxa2xx-flash.c‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,6 @@ static int __devexit pxa2xx_flash_remove(struct platform_device *dev)
140140
}
141141

142142
#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-
}
161143
static void pxa2xx_flash_shutdown(struct platform_device *dev)
162144
{
163145
struct pxa2xx_flash_info *info = platform_get_drvdata(dev);
@@ -166,8 +148,6 @@ static void pxa2xx_flash_shutdown(struct platform_device *dev)
166148
info->mtd->resume(info->mtd);
167149
}
168150
#else
169-
#define pxa2xx_flash_suspend NULL
170-
#define pxa2xx_flash_resume NULL
171151
#define pxa2xx_flash_shutdown NULL
172152
#endif
173153

@@ -178,8 +158,6 @@ static struct platform_driver pxa2xx_flash_driver = {
178158
},
179159
.probe = pxa2xx_flash_probe,
180160
.remove = __devexit_p(pxa2xx_flash_remove),
181-
.suspend = pxa2xx_flash_suspend,
182-
.resume = pxa2xx_flash_resume,
183161
.shutdown = pxa2xx_flash_shutdown,
184162
};
185163

‎drivers/mtd/maps/rbtx4939-flash.c‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -145,25 +145,6 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
145145
}
146146

147147
#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-
167148
static void rbtx4939_flash_shutdown(struct platform_device *dev)
168149
{
169150
struct rbtx4939_flash_info *info = platform_get_drvdata(dev);
@@ -173,16 +154,12 @@ static void rbtx4939_flash_shutdown(struct platform_device *dev)
173154
info->mtd->resume(info->mtd);
174155
}
175156
#else
176-
#define rbtx4939_flash_suspend NULL
177-
#define rbtx4939_flash_resume NULL
178157
#define rbtx4939_flash_shutdown NULL
179158
#endif
180159

181160
static struct platform_driver rbtx4939_flash_driver = {
182161
.probe = rbtx4939_flash_probe,
183162
.remove = rbtx4939_flash_remove,
184-
.suspend = rbtx4939_flash_suspend,
185-
.resume = rbtx4939_flash_resume,
186163
.shutdown = rbtx4939_flash_shutdown,
187164
.driver = {
188165
.name = "rbtx4939-flash",

‎drivers/mtd/maps/sa1100-flash.c‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -415,42 +415,19 @@ static int __exit sa1100_mtd_remove(struct platform_device *pdev)
415415
}
416416

417417
#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-
437418
static void sa1100_mtd_shutdown(struct platform_device *dev)
438419
{
439420
struct sa_info *info = platform_get_drvdata(dev);
440421
if (info && info->mtd->suspend(info->mtd) == 0)
441422
info->mtd->resume(info->mtd);
442423
}
443424
#else
444-
#define sa1100_mtd_suspend NULL
445-
#define sa1100_mtd_resume NULL
446425
#define sa1100_mtd_shutdown NULL
447426
#endif
448427

449428
static struct platform_driver sa1100_mtd_driver = {
450429
.probe = sa1100_mtd_probe,
451430
.remove = __exit_p(sa1100_mtd_remove),
452-
.suspend = sa1100_mtd_suspend,
453-
.resume = sa1100_mtd_resume,
454431
.shutdown = sa1100_mtd_shutdown,
455432
.driver = {
456433
.name = "sa1100-mtd",

‎drivers/mtd/nand/mxc_nand.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,6 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
10151015
int ret = 0;
10161016

10171017
DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
1018-
if (info)
1019-
ret = info->suspend(info);
10201018

10211019
/* Disable the NFC clock */
10221020
clk_disable(nfc_clk); /* FIXME */
@@ -1033,9 +1031,6 @@ static int mxcnd_resume(struct platform_device *pdev)
10331031
/* Enable the NFC clock */
10341032
clk_enable(nfc_clk); /* FIXME */
10351033

1036-
if (info)
1037-
info->resume(info);
1038-
10391034
return ret;
10401035
}
10411036

0 commit comments

Comments
 (0)