diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-03-09 12:24:26 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:53:20 -0400 |
commit | 42d7fbe223ab878b23de9e3b0166f8cd665a2aa5 (patch) | |
tree | 844f3b407e7cc7b335899909b81811e1369dcdef /drivers/mtd/maps | |
parent | ee478af8b675908b217198a75cf759d422a81ccb (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/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/bfin-async-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/dc21285.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/gpio-addr-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/h720x-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/impa7.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/intel_vr_nor.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/lantiq-flash.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/latch-addr-flash.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/physmap.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/plat-ram.c | 5 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 3 | ||||
-rw-r--r-- | drivers/mtd/maps/rbtx4939-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/solutionengine.c | 4 | ||||
-rw-r--r-- | drivers/mtd/maps/wr_sbc82xx_flash.c | 2 |
16 files changed, 29 insertions, 25 deletions
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 | ||
78 | static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) | 78 | static 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 | ||
206 | iounmap: | 207 | iounmap: |
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; |