[PATCH 18/44] mtd: rbtx4939-flash.c: use mtd_device_parse_register

Atsushi Nemoto anemo at mba.ocn.ne.jp
Wed Jun 8 09:50:21 EDT 2011


On Tue,  7 Jun 2011 17:36:17 +0400, Dmitry Eremin-Solenikov <dbaryshkov at gmail.com> wrote:
> @@ -106,18 +102,8 @@ 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, NULL, &info->parts, 0);
> -	if (err > 0) {
> -		mtd_device_register(info->mtd, info->parts, err);
> -		info->nr_parts = err;
> -		return 0;
> -	}
> -
> -	if (pdata->nr_parts) {
> -		pr_notice("Using rbtx4939 partition information\n");
> -		mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
> -		return 0;
> -	}
> +	err = mtd_device_parse_register(info->mtd, NULL, 0,
> +			pdata->parts, pdata->nr_parts);
>  
>  	mtd_device_register(info->mtd, NULL, 0);
>  	return 0;

The last mtd_device_register() call should be removed too?

---
Atsushi Nemoto



More information about the linux-mtd mailing list