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/nand/jz4740_nand.c | |
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/nand/jz4740_nand.c')
-rw-r--r-- | drivers/mtd/nand/jz4740_nand.c | 6 |
1 files changed, 3 insertions, 3 deletions
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"); |