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

Dmitry Eremin-Solenikov
2011-06-08T14:07:49Z

On 6/8/11, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> On Tue, 7 Jun 2011 17:36:17 +0400, Dmitry Eremin-Solenikov
> <dbaryshkov@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?

Good catch, thanks!

--
With best wishes
Dmitry