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

[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>

-113
-40
drivers/mtd/maps/physmap.c
··· 195 195 } 196 196 197 197 #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 - 234 198 static void physmap_flash_shutdown(struct platform_device *dev) 235 199 { 236 200 struct physmap_flash_info *info = platform_get_drvdata(dev); ··· 206 242 info->mtd[i]->resume(info->mtd[i]); 207 243 } 208 244 #else 209 - #define physmap_flash_suspend NULL 210 - #define physmap_flash_resume NULL 211 245 #define physmap_flash_shutdown NULL 212 246 #endif 213 247 214 248 static struct platform_driver physmap_flash_driver = { 215 249 .probe = physmap_flash_probe, 216 250 .remove = physmap_flash_remove, 217 - .suspend = physmap_flash_suspend, 218 - .resume = physmap_flash_resume, 219 251 .shutdown = physmap_flash_shutdown, 220 252 .driver = { 221 253 .name = "physmap-flash",
-22
drivers/mtd/maps/pxa2xx-flash.c
··· 140 140 } 141 141 142 142 #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 - } 161 143 static void pxa2xx_flash_shutdown(struct platform_device *dev) 162 144 { 163 145 struct pxa2xx_flash_info *info = platform_get_drvdata(dev); ··· 148 166 info->mtd->resume(info->mtd); 149 167 } 150 168 #else 151 - #define pxa2xx_flash_suspend NULL 152 - #define pxa2xx_flash_resume NULL 153 169 #define pxa2xx_flash_shutdown NULL 154 170 #endif 155 171 ··· 158 178 }, 159 179 .probe = pxa2xx_flash_probe, 160 180 .remove = __devexit_p(pxa2xx_flash_remove), 161 - .suspend = pxa2xx_flash_suspend, 162 - .resume = pxa2xx_flash_resume, 163 181 .shutdown = pxa2xx_flash_shutdown, 164 182 }; 165 183
-23
drivers/mtd/maps/rbtx4939-flash.c
··· 145 145 } 146 146 147 147 #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 - 167 148 static void rbtx4939_flash_shutdown(struct platform_device *dev) 168 149 { 169 150 struct rbtx4939_flash_info *info = platform_get_drvdata(dev); ··· 154 173 info->mtd->resume(info->mtd); 155 174 } 156 175 #else 157 - #define rbtx4939_flash_suspend NULL 158 - #define rbtx4939_flash_resume NULL 159 176 #define rbtx4939_flash_shutdown NULL 160 177 #endif 161 178 162 179 static struct platform_driver rbtx4939_flash_driver = { 163 180 .probe = rbtx4939_flash_probe, 164 181 .remove = rbtx4939_flash_remove, 165 - .suspend = rbtx4939_flash_suspend, 166 - .resume = rbtx4939_flash_resume, 167 182 .shutdown = rbtx4939_flash_shutdown, 168 183 .driver = { 169 184 .name = "rbtx4939-flash",
-23
drivers/mtd/maps/sa1100-flash.c
··· 415 415 } 416 416 417 417 #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 - 437 418 static void sa1100_mtd_shutdown(struct platform_device *dev) 438 419 { 439 420 struct sa_info *info = platform_get_drvdata(dev); ··· 422 441 info->mtd->resume(info->mtd); 423 442 } 424 443 #else 425 - #define sa1100_mtd_suspend NULL 426 - #define sa1100_mtd_resume NULL 427 444 #define sa1100_mtd_shutdown NULL 428 445 #endif 429 446 430 447 static struct platform_driver sa1100_mtd_driver = { 431 448 .probe = sa1100_mtd_probe, 432 449 .remove = __exit_p(sa1100_mtd_remove), 433 - .suspend = sa1100_mtd_suspend, 434 - .resume = sa1100_mtd_resume, 435 450 .shutdown = sa1100_mtd_shutdown, 436 451 .driver = { 437 452 .name = "sa1100-mtd",
-5
drivers/mtd/nand/mxc_nand.c
··· 1015 1015 int ret = 0; 1016 1016 1017 1017 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); 1018 - if (info) 1019 - ret = info->suspend(info); 1020 1018 1021 1019 /* Disable the NFC clock */ 1022 1020 clk_disable(nfc_clk); /* FIXME */ ··· 1030 1032 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); 1031 1033 /* Enable the NFC clock */ 1032 1034 clk_enable(nfc_clk); /* FIXME */ 1033 - 1034 - if (info) 1035 - info->resume(info); 1036 1035 1037 1036 return ret; 1038 1037 }