Patchwork [06/32] mtd: rbtx4939-flash don't specify default parsing options

login
register
mail settings
Submitter Dmitry Eremin-Solenikov
Date June 6, 2011, 9:15 a.m.
Message ID <1307351782-7456-6-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/98829/
State New
Headers show

Comments

Dmitry Eremin-Solenikov - June 6, 2011, 9:15 a.m.
Since 'cmdline, NULL' is now a default for parse_mtd_partitions, don't specify
this in every driver, instead pass NULL to force parse_mtd_partitions
to use default.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/maps/rbtx4939-flash.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Artem Bityutskiy - June 6, 2011, 11:42 a.m.
On Mon, 2011-06-06 at 13:15 +0400, Dmitry Eremin-Solenikov wrote:
>  static int rbtx4939_flash_probe(struct platform_device *dev)
>  {
> @@ -107,8 +106,7 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
>  	info->mtd->owner = THIS_MODULE;
>  	if (err)
>  		goto err_out;
> -
> -	err = parse_mtd_partitions(info->mtd, part_probe_types,
> +	err = parse_mtd_partitions(info->mtd, NULL,
>  				&info->parts, 0);

This can become one-line. I can do this.

>  	if (err > 0) {
>  		mtd_device_register(info->mtd, info->parts, err);

Patch

diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 761fb45..a272678 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -50,7 +50,6 @@  static int rbtx4939_flash_remove(struct platform_device *dev)
 }
 
 static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
-static const char *part_probe_types[] = { "cmdlinepart", NULL };
 
 static int rbtx4939_flash_probe(struct platform_device *dev)
 {
@@ -107,8 +106,7 @@  static int rbtx4939_flash_probe(struct platform_device *dev)
 	info->mtd->owner = THIS_MODULE;
 	if (err)
 		goto err_out;
-
-	err = parse_mtd_partitions(info->mtd, part_probe_types,
+	err = parse_mtd_partitions(info->mtd, NULL,
 				&info->parts, 0);
 	if (err > 0) {
 		mtd_device_register(info->mtd, info->parts, err);