aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-09 12:24:26 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:53:20 -0400
commit42d7fbe223ab878b23de9e3b0166f8cd665a2aa5 (patch)
tree844f3b407e7cc7b335899909b81811e1369dcdef /drivers
parentee478af8b675908b217198a75cf759d422a81ccb (diff)
mtd: do not use plain 0 as NULL
The first 3 arguments of 'mtd_device_parse_register()' are pointers, but many callers pass '0' instead of 'NULL'. Fix this globally. Thanks to coccinelle for making it easy to do with the following semantic patch: @@ expression mtd, types, parser_data, parts, nr_parts; @@ ( -mtd_device_parse_register(mtd, 0, parser_data, parts, nr_parts) +mtd_device_parse_register(mtd, NULL, parser_data, parts, nr_parts) | -mtd_device_parse_register(mtd, types, 0, parts, nr_parts) +mtd_device_parse_register(mtd, types, NULL, parts, nr_parts) | -mtd_device_parse_register(mtd, types, parser_data, 0, nr_parts) +mtd_device_parse_register(mtd, types, parser_data, NULL, nr_parts) ) Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/devices/spear_smi.c2
-rw-r--r--drivers/mtd/devices/sst25l.c6
-rw-r--r--drivers/mtd/maps/bfin-async-flash.c4
-rw-r--r--drivers/mtd/maps/dc21285.c2
-rw-r--r--drivers/mtd/maps/gpio-addr-flash.c4
-rw-r--r--drivers/mtd/maps/h720x-flash.c4
-rw-r--r--drivers/mtd/maps/impa7.c2
-rw-r--r--drivers/mtd/maps/intel_vr_nor.c2
-rw-r--r--drivers/mtd/maps/ixp2000.c2
-rw-r--r--drivers/mtd/maps/lantiq-flash.c5
-rw-r--r--drivers/mtd/maps/latch-addr-flash.c5
-rw-r--r--drivers/mtd/maps/physmap.c2
-rw-r--r--drivers/mtd/maps/plat-ram.c5
-rw-r--r--drivers/mtd/maps/pxa2xx-flash.c3
-rw-r--r--drivers/mtd/maps/rbtx4939-flash.c4
-rw-r--r--drivers/mtd/maps/sa1100-flash.c4
-rw-r--r--drivers/mtd/maps/solutionengine.c4
-rw-r--r--drivers/mtd/maps/wr_sbc82xx_flash.c2
-rw-r--r--drivers/mtd/nand/atmel_nand.c4
-rw-r--r--drivers/mtd/nand/bcm_umi_nand.c2
-rw-r--r--drivers/mtd/nand/cafe_nand.c2
-rw-r--r--drivers/mtd/nand/cmx270_nand.c2
-rw-r--r--drivers/mtd/nand/cs553x_nand.c2
-rw-r--r--drivers/mtd/nand/davinci_nand.c4
-rw-r--r--drivers/mtd/nand/fsmc_nand.c14
-rw-r--r--drivers/mtd/nand/h1910.c4
-rw-r--r--drivers/mtd/nand/jz4740_nand.c6
-rw-r--r--drivers/mtd/nand/mxc_nand.c4
-rw-r--r--drivers/mtd/nand/omap2.c4
-rw-r--r--drivers/mtd/nand/orion_nand.c4
-rw-r--r--drivers/mtd/nand/plat_nand.c5
-rw-r--r--drivers/mtd/nand/ppchameleonevb.c18
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c5
-rw-r--r--drivers/mtd/nand/s3c2410.c4
-rw-r--r--drivers/mtd/nand/sharpsl.c4
-rw-r--r--drivers/mtd/nand/tmio_nand.c6
-rw-r--r--drivers/mtd/nand/txx9ndfmc.c2
-rw-r--r--drivers/mtd/onenand/generic.c6
-rw-r--r--drivers/mtd/onenand/omap2.c6
-rw-r--r--drivers/mtd/onenand/samsung.c2
40 files changed, 88 insertions, 84 deletions
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index f45dd37b771e..f2016b5f59b6 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -851,7 +851,7 @@ static int spear_smi_setup_banks(struct platform_device *pdev, u32 bank)
851 goto err_map; 851 goto err_map;
852 } 852 }
853 } 853 }
854 ret = mtd_device_parse_register(&flash->mtd, NULL, 0, parts, count); 854 ret = mtd_device_parse_register(&flash->mtd, NULL, NULL, parts, count);
855 if (ret) 855 if (ret)
856 dev_err(&dev->pdev->dev, "Err MTD partition=%d\n", ret); 856 dev_err(&dev->pdev->dev, "Err MTD partition=%d\n", ret);
857 857
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index 51b2df33b8e9..ab8a2f4c8d60 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -399,9 +399,9 @@ static int __devinit sst25l_probe(struct spi_device *spi)
399 flash->mtd.numeraseregions); 399 flash->mtd.numeraseregions);
400 400
401 401
402 ret = mtd_device_parse_register(&flash->mtd, NULL, 0, 402 ret = mtd_device_parse_register(&flash->mtd, NULL, NULL,
403 data ? data->parts : NULL, 403 data ? data->parts : NULL,
404 data ? data->nr_parts : 0); 404 data ? data->nr_parts : 0);
405 if (ret) { 405 if (ret) {
406 kfree(flash); 406 kfree(flash);
407 dev_set_drvdata(&spi->dev, NULL); 407 dev_set_drvdata(&spi->dev, NULL);
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c
index 650126c361f1..ef5cde84a8b3 100644
--- a/drivers/mtd/maps/bfin-async-flash.c
+++ b/drivers/mtd/maps/bfin-async-flash.c
@@ -164,8 +164,8 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev)
164 return -ENXIO; 164 return -ENXIO;
165 } 165 }
166 166
167 mtd_device_parse_register(state->mtd, part_probe_types, 0, 167 mtd_device_parse_register(state->mtd, part_probe_types, NULL,
168 pdata->parts, pdata->nr_parts); 168 pdata->parts, pdata->nr_parts);
169 169
170 platform_set_drvdata(pdev, state); 170 platform_set_drvdata(pdev, state);
171 171
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index f43b365b848c..080f06053bd4 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -196,7 +196,7 @@ static int __init init_dc21285(void)
196 196
197 dc21285_mtd->owner = THIS_MODULE; 197 dc21285_mtd->owner = THIS_MODULE;
198 198
199 mtd_device_parse_register(dc21285_mtd, probes, 0, NULL, 0); 199 mtd_device_parse_register(dc21285_mtd, probes, NULL, NULL, 0);
200 200
201 if(machine_is_ebsa285()) { 201 if(machine_is_ebsa285()) {
202 /* 202 /*
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 33cce895859f..e4de96ba52b3 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -252,8 +252,8 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev)
252 } 252 }
253 253
254 254
255 mtd_device_parse_register(state->mtd, part_probe_types, 0, 255 mtd_device_parse_register(state->mtd, part_probe_types, NULL,
256 pdata->parts, pdata->nr_parts); 256 pdata->parts, pdata->nr_parts);
257 257
258 return 0; 258 return 0;
259} 259}
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c
index 49c14187fc66..8ed6cb4529d8 100644
--- a/drivers/mtd/maps/h720x-flash.c
+++ b/drivers/mtd/maps/h720x-flash.c
@@ -85,8 +85,8 @@ static int __init h720x_mtd_init(void)
85 if (mymtd) { 85 if (mymtd) {
86 mymtd->owner = THIS_MODULE; 86 mymtd->owner = THIS_MODULE;
87 87
88 mtd_device_parse_register(mymtd, NULL, 0, 88 mtd_device_parse_register(mymtd, NULL, NULL,
89 h720x_partitions, NUM_PARTITIONS); 89 h720x_partitions, NUM_PARTITIONS);
90 return 0; 90 return 0;
91 } 91 }
92 92
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
index f47aedb24366..834a06c56f56 100644
--- a/drivers/mtd/maps/impa7.c
+++ b/drivers/mtd/maps/impa7.c
@@ -91,7 +91,7 @@ static int __init init_impa7(void)
91 if (impa7_mtd[i]) { 91 if (impa7_mtd[i]) {
92 impa7_mtd[i]->owner = THIS_MODULE; 92 impa7_mtd[i]->owner = THIS_MODULE;
93 devicesfound++; 93 devicesfound++;
94 mtd_device_parse_register(impa7_mtd[i], NULL, 0, 94 mtd_device_parse_register(impa7_mtd[i], NULL, NULL,
95 partitions, 95 partitions,
96 ARRAY_SIZE(partitions)); 96 ARRAY_SIZE(partitions));
97 } 97 }
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c
index 08c239604ee4..92e1f41634c7 100644
--- a/drivers/mtd/maps/intel_vr_nor.c
+++ b/drivers/mtd/maps/intel_vr_nor.c
@@ -72,7 +72,7 @@ static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p)
72{ 72{
73 /* register the flash bank */ 73 /* register the flash bank */
74 /* partition the flash bank */ 74 /* partition the flash bank */
75 return mtd_device_parse_register(p->info, NULL, 0, NULL, 0); 75 return mtd_device_parse_register(p->info, NULL, NULL, NULL, 0);
76} 76}
77 77
78static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) 78static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c
index fc7d4d0d9a4e..4a41ced0f710 100644
--- a/drivers/mtd/maps/ixp2000.c
+++ b/drivers/mtd/maps/ixp2000.c
@@ -226,7 +226,7 @@ static int ixp2000_flash_probe(struct platform_device *dev)
226 } 226 }
227 info->mtd->owner = THIS_MODULE; 227 info->mtd->owner = THIS_MODULE;
228 228
229 err = mtd_device_parse_register(info->mtd, probes, 0, NULL, 0); 229 err = mtd_device_parse_register(info->mtd, probes, NULL, NULL, 0);
230 if (err) 230 if (err)
231 goto Error; 231 goto Error;
232 232
diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
index cf7a3cddad35..b5401e355745 100644
--- a/drivers/mtd/maps/lantiq-flash.c
+++ b/drivers/mtd/maps/lantiq-flash.c
@@ -169,8 +169,9 @@ ltq_mtd_probe(struct platform_device *pdev)
169 cfi->addr_unlock1 ^= 1; 169 cfi->addr_unlock1 ^= 1;
170 cfi->addr_unlock2 ^= 1; 170 cfi->addr_unlock2 ^= 1;
171 171
172 err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, 0, 172 err = mtd_device_parse_register(ltq_mtd->mtd, ltq_probe_types, NULL,
173 ltq_mtd_data->parts, ltq_mtd_data->nr_parts); 173 ltq_mtd_data->parts,
174 ltq_mtd_data->nr_parts);
174 if (err) { 175 if (err) {
175 dev_err(&pdev->dev, "failed to add partitions\n"); 176 dev_err(&pdev->dev, "failed to add partitions\n");
176 goto err_destroy; 177 goto err_destroy;
diff --git a/drivers/mtd/maps/latch-addr-flash.c b/drivers/mtd/maps/latch-addr-flash.c
index 8fed58e3a4a8..3c7ad17fca78 100644
--- a/drivers/mtd/maps/latch-addr-flash.c
+++ b/drivers/mtd/maps/latch-addr-flash.c
@@ -199,8 +199,9 @@ static int __devinit latch_addr_flash_probe(struct platform_device *dev)
199 } 199 }
200 info->mtd->owner = THIS_MODULE; 200 info->mtd->owner = THIS_MODULE;
201 201
202 mtd_device_parse_register(info->mtd, NULL, 0, 202 mtd_device_parse_register(info->mtd, NULL, NULL,
203 latch_addr_data->parts, latch_addr_data->nr_parts); 203 latch_addr_data->parts,
204 latch_addr_data->nr_parts);
204 return 0; 205 return 0;
205 206
206iounmap: 207iounmap:
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 7e9233c503ab..21b0b713cacb 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -192,7 +192,7 @@ static int physmap_flash_probe(struct platform_device *dev)
192 192
193 part_types = physmap_data->part_probe_types ? : part_probe_types; 193 part_types = physmap_data->part_probe_types ? : part_probe_types;
194 194
195 mtd_device_parse_register(info->cmtd, part_types, 0, 195 mtd_device_parse_register(info->cmtd, part_types, NULL,
196 physmap_data->parts, physmap_data->nr_parts); 196 physmap_data->parts, physmap_data->nr_parts);
197 return 0; 197 return 0;
198 198
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 45876d0e5b8e..891558de3ec1 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -222,8 +222,9 @@ static int platram_probe(struct platform_device *pdev)
222 /* check to see if there are any available partitions, or wether 222 /* check to see if there are any available partitions, or wether
223 * to add this device whole */ 223 * to add this device whole */
224 224
225 err = mtd_device_parse_register(info->mtd, pdata->probes, 0, 225 err = mtd_device_parse_register(info->mtd, pdata->probes, NULL,
226 pdata->partitions, pdata->nr_partitions); 226 pdata->partitions,
227 pdata->nr_partitions);
227 if (!err) 228 if (!err)
228 dev_info(&pdev->dev, "registered mtd device\n"); 229 dev_info(&pdev->dev, "registered mtd device\n");
229 230
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 436d121185b1..81884c277405 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -98,7 +98,8 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
98 } 98 }
99 info->mtd->owner = THIS_MODULE; 99 info->mtd->owner = THIS_MODULE;
100 100
101 mtd_device_parse_register(info->mtd, probes, 0, flash->parts, flash->nr_parts); 101 mtd_device_parse_register(info->mtd, probes, NULL, flash->parts,
102 flash->nr_parts);
102 103
103 platform_set_drvdata(pdev, info); 104 platform_set_drvdata(pdev, info);
104 return 0; 105 return 0;
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 3da63fc6f16e..6f52e1f288b6 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -102,8 +102,8 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
102 info->mtd->owner = THIS_MODULE; 102 info->mtd->owner = THIS_MODULE;
103 if (err) 103 if (err)
104 goto err_out; 104 goto err_out;
105 err = mtd_device_parse_register(info->mtd, NULL, 0, 105 err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
106 pdata->parts, pdata->nr_parts); 106 pdata->nr_parts);
107 107
108 if (err) 108 if (err)
109 goto err_out; 109 goto err_out;
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index 1eaf7b6c35e5..a675bdbcb0fe 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -264,8 +264,8 @@ static int __devinit sa1100_mtd_probe(struct platform_device *pdev)
264 /* 264 /*
265 * Partition selection stuff. 265 * Partition selection stuff.
266 */ 266 */
267 mtd_device_parse_register(info->mtd, part_probes, 0, 267 mtd_device_parse_register(info->mtd, part_probes, NULL, plat->parts,
268 plat->parts, plat->nr_parts); 268 plat->nr_parts);
269 269
270 platform_set_drvdata(pdev, info); 270 platform_set_drvdata(pdev, info);
271 err = 0; 271 err = 0;
diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c
index 496c40704aff..9d900ada6708 100644
--- a/drivers/mtd/maps/solutionengine.c
+++ b/drivers/mtd/maps/solutionengine.c
@@ -92,8 +92,8 @@ static int __init init_soleng_maps(void)
92 mtd_device_register(eprom_mtd, NULL, 0); 92 mtd_device_register(eprom_mtd, NULL, 0);
93 } 93 }
94 94
95 mtd_device_parse_register(flash_mtd, probes, 0, 95 mtd_device_parse_register(flash_mtd, probes, NULL,
96 superh_se_partitions, NUM_PARTITIONS); 96 superh_se_partitions, NUM_PARTITIONS);
97 97
98 return 0; 98 return 0;
99} 99}
diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c
index aa7e0cb2893c..71b0ba797912 100644
--- a/drivers/mtd/maps/wr_sbc82xx_flash.c
+++ b/drivers/mtd/maps/wr_sbc82xx_flash.c
@@ -142,7 +142,7 @@ static int __init init_sbc82xx_flash(void)
142 nr_parts = ARRAY_SIZE(smallflash_parts); 142 nr_parts = ARRAY_SIZE(smallflash_parts);
143 } 143 }
144 144
145 mtd_device_parse_register(sbcmtd[i], part_probes, 0, 145 mtd_device_parse_register(sbcmtd[i], part_probes, NULL,
146 defparts, nr_parts); 146 defparts, nr_parts);
147 } 147 }
148 return 0; 148 return 0;
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 35b4fb55dbd6..7769519a54a7 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -650,8 +650,8 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
650 } 650 }
651 651
652 mtd->name = "atmel_nand"; 652 mtd->name = "atmel_nand";
653 res = mtd_device_parse_register(mtd, NULL, 0, 653 res = mtd_device_parse_register(mtd, NULL, NULL, host->board->parts,
654 host->board->parts, host->board->num_parts); 654 host->board->num_parts);
655 if (!res) 655 if (!res)
656 return res; 656 return res;
657 657
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index 50387fd4009b..ee81b6333f6a 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -488,7 +488,7 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev)
488 488
489 /* Register the partitions */ 489 /* Register the partitions */
490 board_mtd->name = "bcm_umi-nand"; 490 board_mtd->name = "bcm_umi-nand";
491 mtd_device_parse_register(board_mtd, NULL, 0, NULL, 0); 491 mtd_device_parse_register(board_mtd, NULL, NULL, NULL, 0);
492 492
493 /* Return happy */ 493 /* Return happy */
494 return 0; 494 return 0;
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 72d3f23490c5..c23c07c5b391 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -799,7 +799,7 @@ static int __devinit cafe_nand_probe(struct pci_dev *pdev,
799 pci_set_drvdata(pdev, mtd); 799 pci_set_drvdata(pdev, mtd);
800 800
801 mtd->name = "cafe_nand"; 801 mtd->name = "cafe_nand";
802 mtd_device_parse_register(mtd, part_probes, 0, NULL, 0); 802 mtd_device_parse_register(mtd, part_probes, NULL, NULL, 0);
803 803
804 goto out; 804 goto out;
805 805
diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index 737ef9a04fdb..1024bfc05c86 100644
--- a/drivers/mtd/nand/cmx270_nand.c
+++ b/drivers/mtd/nand/cmx270_nand.c
@@ -219,7 +219,7 @@ static int __init cmx270_init(void)
219 } 219 }
220 220
221 /* Register the partitions */ 221 /* Register the partitions */
222 ret = mtd_device_parse_register(cmx270_nand_mtd, NULL, 0, 222 ret = mtd_device_parse_register(cmx270_nand_mtd, NULL, NULL,
223 partition_info, NUM_PARTITIONS); 223 partition_info, NUM_PARTITIONS);
224 if (ret) 224 if (ret)
225 goto err_scan; 225 goto err_scan;
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index 414afa793563..e2b7c9e4c5c2 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -313,7 +313,7 @@ static int __init cs553x_init(void)
313 for (i = 0; i < NR_CS553X_CONTROLLERS; i++) { 313 for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
314 if (cs553x_mtd[i]) { 314 if (cs553x_mtd[i]) {
315 /* If any devices registered, return success. Else the last error. */ 315 /* If any devices registered, return success. Else the last error. */
316 mtd_device_parse_register(cs553x_mtd[i], NULL, 0, 316 mtd_device_parse_register(cs553x_mtd[i], NULL, NULL,
317 NULL, 0); 317 NULL, 0);
318 err = 0; 318 err = 0;
319 } 319 }
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 6e566156956f..b81afc748fff 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -752,8 +752,8 @@ syndrome_done:
752 if (ret < 0) 752 if (ret < 0)
753 goto err_scan; 753 goto err_scan;
754 754
755 ret = mtd_device_parse_register(&info->mtd, NULL, 0, 755 ret = mtd_device_parse_register(&info->mtd, NULL, NULL, pdata->parts,
756 pdata->parts, pdata->nr_parts); 756 pdata->nr_parts);
757 757
758 if (ret < 0) 758 if (ret < 0)
759 goto err_scan; 759 goto err_scan;
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 4a018d0b7034..341086c22e90 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -940,13 +940,13 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
940 * Check for partition info passed 940 * Check for partition info passed
941 */ 941 */
942 host->mtd.name = "nand"; 942 host->mtd.name = "nand";
943 ret = mtd_device_parse_register(&host->mtd, NULL, 0, 943 ret = mtd_device_parse_register(&host->mtd, NULL, NULL,
944 host->mtd.size <= 0x04000000 ? 944 host->mtd.size <= 0x04000000 ?
945 partition_info_16KB_blk : 945 partition_info_16KB_blk :
946 partition_info_128KB_blk, 946 partition_info_128KB_blk,
947 host->mtd.size <= 0x04000000 ? 947 host->mtd.size <= 0x04000000 ?
948 ARRAY_SIZE(partition_info_16KB_blk) : 948 ARRAY_SIZE(partition_info_16KB_blk) :
949 ARRAY_SIZE(partition_info_128KB_blk)); 949 ARRAY_SIZE(partition_info_128KB_blk));
950 if (ret) 950 if (ret)
951 goto err_probe; 951 goto err_probe;
952 952
diff --git a/drivers/mtd/nand/h1910.c b/drivers/mtd/nand/h1910.c
index 5dc6f0d92f1a..11e487813428 100644
--- a/drivers/mtd/nand/h1910.c
+++ b/drivers/mtd/nand/h1910.c
@@ -135,8 +135,8 @@ static int __init h1910_init(void)
135 } 135 }
136 136
137 /* Register the partitions */ 137 /* Register the partitions */
138 mtd_device_parse_register(h1910_nand_mtd, NULL, 0, 138 mtd_device_parse_register(h1910_nand_mtd, NULL, NULL, partition_info,
139 partition_info, NUM_PARTITIONS); 139 NUM_PARTITIONS);
140 140
141 /* Return happy */ 141 /* Return happy */
142 return 0; 142 return 0;
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index ac3b9f255e00..cc50e35cdc3d 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -367,9 +367,9 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
367 goto err_gpio_free; 367 goto err_gpio_free;
368 } 368 }
369 369
370 ret = mtd_device_parse_register(mtd, NULL, 0, 370 ret = mtd_device_parse_register(mtd, NULL, NULL,
371 pdata ? pdata->partitions : NULL, 371 pdata ? pdata->partitions : NULL,
372 pdata ? pdata->num_partitions : 0); 372 pdata ? pdata->num_partitions : 0);
373 373
374 if (ret) { 374 if (ret) {
375 dev_err(&pdev->dev, "Failed to add mtd device\n"); 375 dev_err(&pdev->dev, "Failed to add mtd device\n");
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 74a43b818d0e..3c4c0533191d 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1226,8 +1226,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
1226 } 1226 }
1227 1227
1228 /* Register the partitions */ 1228 /* Register the partitions */
1229 mtd_device_parse_register(mtd, part_probes, 0, 1229 mtd_device_parse_register(mtd, part_probes, NULL, pdata->parts,
1230 pdata->parts, pdata->nr_parts); 1230 pdata->nr_parts);
1231 1231
1232 platform_set_drvdata(pdev, host); 1232 platform_set_drvdata(pdev, host);
1233 1233
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index b3a883e2a22f..d2e7a7da81f8 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1101,8 +1101,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
1101 goto out_release_mem_region; 1101 goto out_release_mem_region;
1102 } 1102 }
1103 1103
1104 mtd_device_parse_register(&info->mtd, NULL, 0, 1104 mtd_device_parse_register(&info->mtd, NULL, NULL, pdata->parts,
1105 pdata->parts, pdata->nr_parts); 1105 pdata->nr_parts);
1106 1106
1107 platform_set_drvdata(pdev, &info->mtd); 1107 platform_set_drvdata(pdev, &info->mtd);
1108 1108
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 29f505adaf84..1d3bfb26080c 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -129,8 +129,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
129 } 129 }
130 130
131 mtd->name = "orion_nand"; 131 mtd->name = "orion_nand";
132 ret = mtd_device_parse_register(mtd, NULL, 0, 132 ret = mtd_device_parse_register(mtd, NULL, NULL, board->parts,
133 board->parts, board->nr_parts); 133 board->nr_parts);
134 if (ret) { 134 if (ret) {
135 nand_release(mtd); 135 nand_release(mtd);
136 goto no_dev; 136 goto no_dev;
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 7f2da6953357..6404e6e81b10 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -99,8 +99,9 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
99 } 99 }
100 100
101 err = mtd_device_parse_register(&data->mtd, 101 err = mtd_device_parse_register(&data->mtd,
102 pdata->chip.part_probe_types, 0, 102 pdata->chip.part_probe_types, NULL,
103 pdata->chip.partitions, pdata->chip.nr_partitions); 103 pdata->chip.partitions,
104 pdata->chip.nr_partitions);
104 105
105 if (!err) 106 if (!err)
106 return err; 107 return err;
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c
index 7e52af51a198..0ddd90e5788f 100644
--- a/drivers/mtd/nand/ppchameleonevb.c
+++ b/drivers/mtd/nand/ppchameleonevb.c
@@ -275,11 +275,10 @@ static int __init ppchameleonevb_init(void)
275 ppchameleon_mtd->name = "ppchameleon-nand"; 275 ppchameleon_mtd->name = "ppchameleon-nand";
276 276
277 /* Register the partitions */ 277 /* Register the partitions */
278 mtd_device_parse_register(ppchameleon_mtd, NULL, 0, 278 mtd_device_parse_register(ppchameleon_mtd, NULL, NULL,
279 ppchameleon_mtd->size == NAND_SMALL_SIZE ? 279 ppchameleon_mtd->size == NAND_SMALL_SIZE ?
280 partition_info_me : 280 partition_info_me : partition_info_hi,
281 partition_info_hi, 281 NUM_PARTITIONS);
282 NUM_PARTITIONS);
283 282
284 nand_evb_init: 283 nand_evb_init:
285 /**************************** 284 /****************************
@@ -365,11 +364,10 @@ static int __init ppchameleonevb_init(void)
365 ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME; 364 ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME;
366 365
367 /* Register the partitions */ 366 /* Register the partitions */
368 mtd_device_parse_register(ppchameleonevb_mtd, NULL, 0, 367 mtd_device_parse_register(ppchameleonevb_mtd, NULL, NULL,
369 ppchameleon_mtd->size == NAND_SMALL_SIZE ? 368 ppchameleon_mtd->size == NAND_SMALL_SIZE ?
370 partition_info_me : 369 partition_info_me : partition_info_hi,
371 partition_info_hi, 370 NUM_PARTITIONS);
372 NUM_PARTITIONS);
373 371
374 /* Return happy */ 372 /* Return happy */
375 return 0; 373 return 0;
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 5c3d719c37e6..d3bdc909c939 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1228,8 +1228,9 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
1228 continue; 1228 continue;
1229 } 1229 }
1230 1230
1231 ret = mtd_device_parse_register(info->host[cs]->mtd, NULL, 0, 1231 ret = mtd_device_parse_register(info->host[cs]->mtd, NULL,
1232 pdata->parts[cs], pdata->nr_parts[cs]); 1232 NULL, pdata->parts[cs],
1233 pdata->nr_parts[cs]);
1233 if (!ret) 1234 if (!ret)
1234 probe_success = 1; 1235 probe_success = 1;
1235 } 1236 }
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 868685db6712..97623be04e0f 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -751,8 +751,8 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
751 if (set) 751 if (set)
752 mtd->mtd.name = set->name; 752 mtd->mtd.name = set->name;
753 753
754 return mtd_device_parse_register(&mtd->mtd, NULL, 0, 754 return mtd_device_parse_register(&mtd->mtd, NULL, NULL,
755 set->partitions, set->nr_partitions); 755 set->partitions, set->nr_partitions);
756} 756}
757 757
758/** 758/**
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c
index b175c0fd8b93..2d269a53f8bb 100644
--- a/drivers/mtd/nand/sharpsl.c
+++ b/drivers/mtd/nand/sharpsl.c
@@ -181,8 +181,8 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
181 /* Register the partitions */ 181 /* Register the partitions */
182 sharpsl->mtd.name = "sharpsl-nand"; 182 sharpsl->mtd.name = "sharpsl-nand";
183 183
184 err = mtd_device_parse_register(&sharpsl->mtd, NULL, 0, 184 err = mtd_device_parse_register(&sharpsl->mtd, NULL, NULL,
185 data->partitions, data->nr_partitions); 185 data->partitions, data->nr_partitions);
186 if (err) 186 if (err)
187 goto err_add; 187 goto err_add;
188 188
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index 6caa0cd9d6a7..060848a91db7 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -456,9 +456,9 @@ static int tmio_probe(struct platform_device *dev)
456 goto err_scan; 456 goto err_scan;
457 } 457 }
458 /* Register the partitions */ 458 /* Register the partitions */
459 retval = mtd_device_parse_register(mtd, NULL, 0, 459 retval = mtd_device_parse_register(mtd, NULL, NULL,
460 data ? data->partition : NULL, 460 data ? data->partition : NULL,
461 data ? data->num_partitions : 0); 461 data ? data->num_partitions : 0);
462 if (!retval) 462 if (!retval)
463 return retval; 463 return retval;
464 464
diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c
index c7c4f1d11c77..8db0acbae6fa 100644
--- a/drivers/mtd/nand/txx9ndfmc.c
+++ b/drivers/mtd/nand/txx9ndfmc.c
@@ -386,7 +386,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)
386 } 386 }
387 mtd->name = txx9_priv->mtdname; 387 mtd->name = txx9_priv->mtdname;
388 388
389 mtd_device_parse_register(mtd, NULL, 0, NULL, 0); 389 mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
390 drvdata->mtds[i] = mtd; 390 drvdata->mtds[i] = mtd;
391 } 391 }
392 392
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index 0ccd5bff2544..1c4f97c63e62 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -70,9 +70,9 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev)
70 goto out_iounmap; 70 goto out_iounmap;
71 } 71 }
72 72
73 err = mtd_device_parse_register(&info->mtd, NULL, 0, 73 err = mtd_device_parse_register(&info->mtd, NULL, NULL,
74 pdata ? pdata->parts : NULL, 74 pdata ? pdata->parts : NULL,
75 pdata ? pdata->nr_parts : 0); 75 pdata ? pdata->nr_parts : 0);
76 76
77 platform_set_drvdata(pdev, info); 77 platform_set_drvdata(pdev, info);
78 78
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 7e9ea6852b67..398a82783848 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -751,9 +751,9 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
751 if ((r = onenand_scan(&c->mtd, 1)) < 0) 751 if ((r = onenand_scan(&c->mtd, 1)) < 0)
752 goto err_release_regulator; 752 goto err_release_regulator;
753 753
754 r = mtd_device_parse_register(&c->mtd, NULL, 0, 754 r = mtd_device_parse_register(&c->mtd, NULL, NULL,
755 pdata ? pdata->parts : NULL, 755 pdata ? pdata->parts : NULL,
756 pdata ? pdata->nr_parts : 0); 756 pdata ? pdata->nr_parts : 0);
757 if (r) 757 if (r)
758 goto err_release_onenand; 758 goto err_release_onenand;
759 759
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index deaf7628773f..8e4b3f2742ba 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -1014,7 +1014,7 @@ static int s3c_onenand_probe(struct platform_device *pdev)
1014 if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) 1014 if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ)
1015 dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); 1015 dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n");
1016 1016
1017 err = mtd_device_parse_register(mtd, NULL, 0, 1017 err = mtd_device_parse_register(mtd, NULL, NULL,
1018 pdata ? pdata->parts : NULL, 1018 pdata ? pdata->parts : NULL,
1019 pdata ? pdata->nr_parts : 0); 1019 pdata ? pdata->nr_parts : 0);
1020 1020