aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/maps/physmap.c2
-rw-r--r--drivers/mtd/maps/pxa2xx-flash.c2
-rw-r--r--drivers/mtd/maps/rbtx4939-flash.c2
-rw-r--r--drivers/mtd/maps/sa1100-flash.c2
-rw-r--r--drivers/mtd/mtdconcat.c2
-rw-r--r--drivers/mtd/mtdcore.c2
-rw-r--r--drivers/mtd/mtdpart.c2
-rw-r--r--drivers/mtd/nand/nomadik_nand.c2
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c2
-rw-r--r--include/linux/mtd/mtd.h7
10 files changed, 15 insertions, 10 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 1f749d58ae6..b7f0cd14ae2 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -191,7 +191,7 @@ static void physmap_flash_shutdown(struct platform_device *dev)
191 191
192 for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) 192 for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
193 if (info->mtd[i]->suspend && info->mtd[i]->resume) 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 info->mtd[i]->resume(info->mtd[i]); 195 info->mtd[i]->resume(info->mtd[i]);
196} 196}
197#else 197#else
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 274e3991433..9cb427320c0 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -125,7 +125,7 @@ static void pxa2xx_flash_shutdown(struct platform_device *dev)
125{ 125{
126 struct pxa2xx_flash_info *info = platform_get_drvdata(dev); 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 info->mtd->resume(info->mtd); 129 info->mtd->resume(info->mtd);
130} 130}
131#else 131#else
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index bb7d2042aff..5856aa2d99f 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -120,7 +120,7 @@ static void rbtx4939_flash_shutdown(struct platform_device *dev)
120 struct rbtx4939_flash_info *info = platform_get_drvdata(dev); 120 struct rbtx4939_flash_info *info = platform_get_drvdata(dev);
121 121
122 if (info->mtd->suspend && info->mtd->resume) 122 if (info->mtd->suspend && info->mtd->resume)
123 if (info->mtd->suspend(info->mtd) == 0) 123 if (mtd_suspend(info->mtd) == 0)
124 info->mtd->resume(info->mtd); 124 info->mtd->resume(info->mtd);
125} 125}
126#else 126#else
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index ac3a290748c..20944f05486 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -377,7 +377,7 @@ static int __exit sa1100_mtd_remove(struct platform_device *pdev)
377static void sa1100_mtd_shutdown(struct platform_device *dev) 377static void sa1100_mtd_shutdown(struct platform_device *dev)
378{ 378{
379 struct sa_info *info = platform_get_drvdata(dev); 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 info->mtd->resume(info->mtd); 381 info->mtd->resume(info->mtd);
382} 382}
383#else 383#else
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 272ebc01f95..36bb1c99925 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -631,7 +631,7 @@ static int concat_suspend(struct mtd_info *mtd)
631 631
632 for (i = 0; i < concat->num_subdev; i++) { 632 for (i = 0; i < concat->num_subdev; i++) {
633 struct mtd_info *subdev = concat->subdev[i]; 633 struct mtd_info *subdev = concat->subdev[i];
634 if ((rc = subdev->suspend(subdev)) < 0) 634 if ((rc = mtd_suspend(subdev)) < 0)
635 return rc; 635 return rc;
636 } 636 }
637 return rc; 637 return rc;
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 4a2155748fa..0db455d3114 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -119,7 +119,7 @@ static int mtd_cls_suspend(struct device *dev, pm_message_t state)
119 struct mtd_info *mtd = dev_to_mtd(dev); 119 struct mtd_info *mtd = dev_to_mtd(dev);
120 120
121 if (mtd && mtd->suspend) 121 if (mtd && mtd->suspend)
122 return mtd->suspend(mtd); 122 return mtd_suspend(mtd);
123 else 123 else
124 return 0; 124 return 0;
125} 125}
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index ad487fcd423..c5e556a9264 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -307,7 +307,7 @@ static void part_sync(struct mtd_info *mtd)
307static int part_suspend(struct mtd_info *mtd) 307static int part_suspend(struct mtd_info *mtd)
308{ 308{
309 struct mtd_part *part = PART(mtd); 309 struct mtd_part *part = PART(mtd);
310 return part->master->suspend(part->master); 310 return mtd_suspend(part->master);
311} 311}
312 312
313static void part_resume(struct mtd_info *mtd) 313static void part_resume(struct mtd_info *mtd)
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 673dc6c68f9..9461babdb30 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -201,7 +201,7 @@ static int nomadik_nand_suspend(struct device *dev)
201 struct nomadik_nand_host *host = dev_get_drvdata(dev); 201 struct nomadik_nand_host *host = dev_get_drvdata(dev);
202 int ret = 0; 202 int ret = 0;
203 if (host) 203 if (host)
204 ret = host->mtd.suspend(&host->mtd); 204 ret = mtd_suspend(&host->mtd);
205 return ret; 205 return ret;
206} 206}
207 207
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 90d60169ae4..7a028cf1206 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1258,7 +1258,7 @@ static int pxa3xx_nand_suspend(struct platform_device *pdev, pm_message_t state)
1258 1258
1259 for (cs = 0; cs < pdata->num_cs; cs++) { 1259 for (cs = 0; cs < pdata->num_cs; cs++) {
1260 mtd = info->host[cs]->mtd; 1260 mtd = info->host[cs]->mtd;
1261 mtd->suspend(mtd); 1261 mtd_suspend(mtd);
1262 } 1262 }
1263 1263
1264 return 0; 1264 return 0;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8b9901986c8..8e01bad44e2 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -210,6 +210,7 @@ struct mtd_info {
210 int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 210 int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
211 int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 211 int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
212 int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 212 int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
213 int (*suspend) (struct mtd_info *mtd);
213 214
214 /* Backing device capabilities for this device 215 /* Backing device capabilities for this device
215 * - provides mmap capabilities 216 * - provides mmap capabilities
@@ -217,7 +218,6 @@ struct mtd_info {
217 struct backing_dev_info *backing_dev_info; 218 struct backing_dev_info *backing_dev_info;
218 219
219 /* Power Management functions */ 220 /* Power Management functions */
220 int (*suspend) (struct mtd_info *mtd);
221 void (*resume) (struct mtd_info *mtd); 221 void (*resume) (struct mtd_info *mtd);
222 222
223 /* Bad block management functions */ 223 /* Bad block management functions */
@@ -398,6 +398,11 @@ static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
398 return mtd->is_locked(mtd, ofs, len); 398 return mtd->is_locked(mtd, ofs, len);
399} 399}
400 400
401static inline int mtd_suspend(struct mtd_info *mtd)
402{
403 return mtd->suspend(mtd);
404}
405
401static inline struct mtd_info *dev_to_mtd(struct device *dev) 406static inline struct mtd_info *dev_to_mtd(struct device *dev)
402{ 407{
403 return dev ? dev_get_drvdata(dev) : NULL; 408 return dev ? dev_get_drvdata(dev) : NULL;