Skip to content

Commit ead995f

Browse files
dedekindDavid Woodhouse
authored andcommitted
mtd: introduce mtd_resume interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 3fe4bae commit ead995f

10 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎drivers/mtd/maps/physmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static void physmap_flash_shutdown(struct platform_device *dev)
192192
for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
193193
if (info->mtd[i]->suspend && info->mtd[i]->resume)
194194
if (mtd_suspend(info->mtd[i]) == 0)
195-
info->mtd[i]->resume(info->mtd[i]);
195+
mtd_resume(info->mtd[i]);
196196
}
197197
#else
198198
#define physmap_flash_shutdown NULL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void pxa2xx_flash_shutdown(struct platform_device *dev)
126126
struct pxa2xx_flash_info *info = platform_get_drvdata(dev);
127127

128128
if (info && mtd_suspend(info->mtd) == 0)
129-
info->mtd->resume(info->mtd);
129+
mtd_resume(info->mtd);
130130
}
131131
#else
132132
#define pxa2xx_flash_shutdown NULL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static void rbtx4939_flash_shutdown(struct platform_device *dev)
121121

122122
if (info->mtd->suspend && info->mtd->resume)
123123
if (mtd_suspend(info->mtd) == 0)
124-
info->mtd->resume(info->mtd);
124+
mtd_resume(info->mtd);
125125
}
126126
#else
127127
#define rbtx4939_flash_shutdown NULL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static void sa1100_mtd_shutdown(struct platform_device *dev)
378378
{
379379
struct sa_info *info = platform_get_drvdata(dev);
380380
if (info && mtd_suspend(info->mtd) == 0)
381-
info->mtd->resume(info->mtd);
381+
mtd_resume(info->mtd);
382382
}
383383
#else
384384
#define sa1100_mtd_shutdown NULL

‎drivers/mtd/mtdconcat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static void concat_resume(struct mtd_info *mtd)
644644

645645
for (i = 0; i < concat->num_subdev; i++) {
646646
struct mtd_info *subdev = concat->subdev[i];
647-
subdev->resume(subdev);
647+
mtd_resume(subdev);
648648
}
649649
}
650650

‎drivers/mtd/mtdcore.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int mtd_cls_resume(struct device *dev)
129129
struct mtd_info *mtd = dev_to_mtd(dev);
130130

131131
if (mtd && mtd->resume)
132-
mtd->resume(mtd);
132+
mtd_resume(mtd);
133133
return 0;
134134
}
135135

‎drivers/mtd/mtdpart.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static int part_suspend(struct mtd_info *mtd)
313313
static void part_resume(struct mtd_info *mtd)
314314
{
315315
struct mtd_part *part = PART(mtd);
316-
part->master->resume(part->master);
316+
mtd_resume(part->master);
317317
}
318318

319319
static int part_block_isbad(struct mtd_info *mtd, loff_t ofs)

‎drivers/mtd/nand/nomadik_nand.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static int nomadik_nand_resume(struct device *dev)
209209
{
210210
struct nomadik_nand_host *host = dev_get_drvdata(dev);
211211
if (host)
212-
host->mtd.resume(&host->mtd);
212+
mtd_resume(&host->mtd);
213213
return 0;
214214
}
215215

‎drivers/mtd/nand/pxa3xx_nand.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ static int pxa3xx_nand_resume(struct platform_device *pdev)
12911291
nand_writel(info, NDSR, NDSR_MASK);
12921292
for (cs = 0; cs < pdata->num_cs; cs++) {
12931293
mtd = info->host[cs]->mtd;
1294-
mtd->resume(mtd);
1294+
mtd_resume(mtd);
12951295
}
12961296

12971297
return 0;

‎include/linux/mtd/mtd.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,13 @@ struct mtd_info {
211211
int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
212212
int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
213213
int (*suspend) (struct mtd_info *mtd);
214+
void (*resume) (struct mtd_info *mtd);
214215

215216
/* Backing device capabilities for this device
216217
* - provides mmap capabilities
217218
*/
218219
struct backing_dev_info *backing_dev_info;
219220

220-
/* Power Management functions */
221-
void (*resume) (struct mtd_info *mtd);
222-
223221
/* Bad block management functions */
224222
int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
225223
int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
@@ -403,6 +401,11 @@ static inline int mtd_suspend(struct mtd_info *mtd)
403401
return mtd->suspend(mtd);
404402
}
405403

404+
static inline void mtd_resume(struct mtd_info *mtd)
405+
{
406+
mtd->resume(mtd);
407+
}
408+
406409
static inline struct mtd_info *dev_to_mtd(struct device *dev)
407410
{
408411
return dev ? dev_get_drvdata(dev) : NULL;

0 commit comments

Comments
 (0)