Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: introduce mtd_resume interface

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Artem Bityutskiy and committed by
David Woodhouse
ead995f8 3fe4bae8

+15 -12
+1 -1
drivers/mtd/maps/physmap.c
··· 192 192 for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) 193 193 if (info->mtd[i]->suspend && info->mtd[i]->resume) 194 194 if (mtd_suspend(info->mtd[i]) == 0) 195 - info->mtd[i]->resume(info->mtd[i]); 195 + mtd_resume(info->mtd[i]); 196 196 } 197 197 #else 198 198 #define physmap_flash_shutdown NULL
+1 -1
drivers/mtd/maps/pxa2xx-flash.c
··· 126 126 struct pxa2xx_flash_info *info = platform_get_drvdata(dev); 127 127 128 128 if (info && mtd_suspend(info->mtd) == 0) 129 - info->mtd->resume(info->mtd); 129 + mtd_resume(info->mtd); 130 130 } 131 131 #else 132 132 #define pxa2xx_flash_shutdown NULL
+1 -1
drivers/mtd/maps/rbtx4939-flash.c
··· 121 121 122 122 if (info->mtd->suspend && info->mtd->resume) 123 123 if (mtd_suspend(info->mtd) == 0) 124 - info->mtd->resume(info->mtd); 124 + mtd_resume(info->mtd); 125 125 } 126 126 #else 127 127 #define rbtx4939_flash_shutdown NULL
+1 -1
drivers/mtd/maps/sa1100-flash.c
··· 378 378 { 379 379 struct sa_info *info = platform_get_drvdata(dev); 380 380 if (info && mtd_suspend(info->mtd) == 0) 381 - info->mtd->resume(info->mtd); 381 + mtd_resume(info->mtd); 382 382 } 383 383 #else 384 384 #define sa1100_mtd_shutdown NULL
+1 -1
drivers/mtd/mtdconcat.c
··· 644 644 645 645 for (i = 0; i < concat->num_subdev; i++) { 646 646 struct mtd_info *subdev = concat->subdev[i]; 647 - subdev->resume(subdev); 647 + mtd_resume(subdev); 648 648 } 649 649 } 650 650
+1 -1
drivers/mtd/mtdcore.c
··· 129 129 struct mtd_info *mtd = dev_to_mtd(dev); 130 130 131 131 if (mtd && mtd->resume) 132 - mtd->resume(mtd); 132 + mtd_resume(mtd); 133 133 return 0; 134 134 } 135 135
+1 -1
drivers/mtd/mtdpart.c
··· 313 313 static void part_resume(struct mtd_info *mtd) 314 314 { 315 315 struct mtd_part *part = PART(mtd); 316 - part->master->resume(part->master); 316 + mtd_resume(part->master); 317 317 } 318 318 319 319 static int part_block_isbad(struct mtd_info *mtd, loff_t ofs)
+1 -1
drivers/mtd/nand/nomadik_nand.c
··· 209 209 { 210 210 struct nomadik_nand_host *host = dev_get_drvdata(dev); 211 211 if (host) 212 - host->mtd.resume(&host->mtd); 212 + mtd_resume(&host->mtd); 213 213 return 0; 214 214 } 215 215
+1 -1
drivers/mtd/nand/pxa3xx_nand.c
··· 1291 1291 nand_writel(info, NDSR, NDSR_MASK); 1292 1292 for (cs = 0; cs < pdata->num_cs; cs++) { 1293 1293 mtd = info->host[cs]->mtd; 1294 - mtd->resume(mtd); 1294 + mtd_resume(mtd); 1295 1295 } 1296 1296 1297 1297 return 0;
+6 -3
include/linux/mtd/mtd.h
··· 211 211 int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 212 212 int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 213 213 int (*suspend) (struct mtd_info *mtd); 214 + void (*resume) (struct mtd_info *mtd); 214 215 215 216 /* Backing device capabilities for this device 216 217 * - provides mmap capabilities 217 218 */ 218 219 struct backing_dev_info *backing_dev_info; 219 - 220 - /* Power Management functions */ 221 - void (*resume) (struct mtd_info *mtd); 222 220 223 221 /* Bad block management functions */ 224 222 int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); ··· 399 401 static inline int mtd_suspend(struct mtd_info *mtd) 400 402 { 401 403 return mtd->suspend(mtd); 404 + } 405 + 406 + static inline void mtd_resume(struct mtd_info *mtd) 407 + { 408 + mtd->resume(mtd); 402 409 } 403 410 404 411 static inline struct mtd_info *dev_to_mtd(struct device *dev)