mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mtd: maps: use mtd_device_register() where applicable
If driver doesn't specify parsers it can use that little helper. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
9ea97a7d68
commit
4897015d2f
4 changed files with 6 additions and 9 deletions
|
@ -88,9 +88,8 @@ static int __init init_impa7(void)
|
||||||
if (impa7_mtd[i]) {
|
if (impa7_mtd[i]) {
|
||||||
impa7_mtd[i]->owner = THIS_MODULE;
|
impa7_mtd[i]->owner = THIS_MODULE;
|
||||||
devicesfound++;
|
devicesfound++;
|
||||||
mtd_device_parse_register(impa7_mtd[i], NULL, NULL,
|
mtd_device_register(impa7_mtd[i], partitions,
|
||||||
partitions,
|
ARRAY_SIZE(partitions));
|
||||||
ARRAY_SIZE(partitions));
|
|
||||||
} else {
|
} else {
|
||||||
iounmap((void __iomem *)impa7_map[i].virt);
|
iounmap((void __iomem *)impa7_map[i].virt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ static int vr_nor_init_partitions(struct vr_nor_mtd *p)
|
||||||
{
|
{
|
||||||
/* register the flash bank */
|
/* register the flash bank */
|
||||||
/* partition the flash bank */
|
/* partition the flash bank */
|
||||||
return mtd_device_parse_register(p->info, NULL, NULL, NULL, 0);
|
return mtd_device_register(p->info, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
|
static void vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
|
||||||
|
|
|
@ -197,9 +197,8 @@ static int latch_addr_flash_probe(struct platform_device *dev)
|
||||||
}
|
}
|
||||||
info->mtd->dev.parent = &dev->dev;
|
info->mtd->dev.parent = &dev->dev;
|
||||||
|
|
||||||
mtd_device_parse_register(info->mtd, NULL, NULL,
|
mtd_device_register(info->mtd, latch_addr_data->parts,
|
||||||
latch_addr_data->parts,
|
latch_addr_data->nr_parts);
|
||||||
latch_addr_data->nr_parts);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
iounmap:
|
iounmap:
|
||||||
|
|
|
@ -97,8 +97,7 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
info->mtd->dev.parent = &dev->dev;
|
info->mtd->dev.parent = &dev->dev;
|
||||||
err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
|
err = mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
|
||||||
pdata->nr_parts);
|
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
|
Loading…
Add table
Reference in a new issue