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

mtd: introduce mtd_suspend 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
3fe4bae8 e95e9786

+15 -10
+1 -1
drivers/mtd/maps/physmap.c
··· 191 191 192 192 for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) 193 193 if (info->mtd[i]->suspend && info->mtd[i]->resume) 194 - if (info->mtd[i]->suspend(info->mtd[i]) == 0) 194 + if (mtd_suspend(info->mtd[i]) == 0) 195 195 info->mtd[i]->resume(info->mtd[i]); 196 196 } 197 197 #else
+1 -1
drivers/mtd/maps/pxa2xx-flash.c
··· 125 125 { 126 126 struct pxa2xx_flash_info *info = platform_get_drvdata(dev); 127 127 128 - if (info && info->mtd->suspend(info->mtd) == 0) 128 + if (info && mtd_suspend(info->mtd) == 0) 129 129 info->mtd->resume(info->mtd); 130 130 } 131 131 #else
+1 -1
drivers/mtd/maps/rbtx4939-flash.c
··· 120 120 struct rbtx4939_flash_info *info = platform_get_drvdata(dev); 121 121 122 122 if (info->mtd->suspend && info->mtd->resume) 123 - if (info->mtd->suspend(info->mtd) == 0) 123 + if (mtd_suspend(info->mtd) == 0) 124 124 info->mtd->resume(info->mtd); 125 125 } 126 126 #else
+1 -1
drivers/mtd/maps/sa1100-flash.c
··· 377 377 static void sa1100_mtd_shutdown(struct platform_device *dev) 378 378 { 379 379 struct sa_info *info = platform_get_drvdata(dev); 380 - if (info && info->mtd->suspend(info->mtd) == 0) 380 + if (info && mtd_suspend(info->mtd) == 0) 381 381 info->mtd->resume(info->mtd); 382 382 } 383 383 #else
+1 -1
drivers/mtd/mtdconcat.c
··· 631 631 632 632 for (i = 0; i < concat->num_subdev; i++) { 633 633 struct mtd_info *subdev = concat->subdev[i]; 634 - if ((rc = subdev->suspend(subdev)) < 0) 634 + if ((rc = mtd_suspend(subdev)) < 0) 635 635 return rc; 636 636 } 637 637 return rc;
+1 -1
drivers/mtd/mtdcore.c
··· 119 119 struct mtd_info *mtd = dev_to_mtd(dev); 120 120 121 121 if (mtd && mtd->suspend) 122 - return mtd->suspend(mtd); 122 + return mtd_suspend(mtd); 123 123 else 124 124 return 0; 125 125 }
+1 -1
drivers/mtd/mtdpart.c
··· 307 307 static int part_suspend(struct mtd_info *mtd) 308 308 { 309 309 struct mtd_part *part = PART(mtd); 310 - return part->master->suspend(part->master); 310 + return mtd_suspend(part->master); 311 311 } 312 312 313 313 static void part_resume(struct mtd_info *mtd)
+1 -1
drivers/mtd/nand/nomadik_nand.c
··· 201 201 struct nomadik_nand_host *host = dev_get_drvdata(dev); 202 202 int ret = 0; 203 203 if (host) 204 - ret = host->mtd.suspend(&host->mtd); 204 + ret = mtd_suspend(&host->mtd); 205 205 return ret; 206 206 } 207 207
+1 -1
drivers/mtd/nand/pxa3xx_nand.c
··· 1258 1258 1259 1259 for (cs = 0; cs < pdata->num_cs; cs++) { 1260 1260 mtd = info->host[cs]->mtd; 1261 - mtd->suspend(mtd); 1261 + mtd_suspend(mtd); 1262 1262 } 1263 1263 1264 1264 return 0;
+6 -1
include/linux/mtd/mtd.h
··· 210 210 int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 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 + int (*suspend) (struct mtd_info *mtd); 213 214 214 215 /* Backing device capabilities for this device 215 216 * - provides mmap capabilities ··· 218 217 struct backing_dev_info *backing_dev_info; 219 218 220 219 /* Power Management functions */ 221 - int (*suspend) (struct mtd_info *mtd); 222 220 void (*resume) (struct mtd_info *mtd); 223 221 224 222 /* Bad block management functions */ ··· 396 396 static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) 397 397 { 398 398 return mtd->is_locked(mtd, ofs, len); 399 + } 400 + 401 + static inline int mtd_suspend(struct mtd_info *mtd) 402 + { 403 + return mtd->suspend(mtd); 399 404 } 400 405 401 406 static inline struct mtd_info *dev_to_mtd(struct device *dev)