Skip to content

Commit

Permalink
mtd: ixp2000.c: use mtd_device_parse_register
Browse files Browse the repository at this point in the history
Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent ba6bead commit 200b877
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/mtd/maps/ixp2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
struct ixp2000_flash_info {
struct mtd_info *mtd;
struct map_info map;
struct mtd_partition *partitions;
struct resource *res;
};

Expand Down Expand Up @@ -125,8 +124,6 @@ static int ixp2000_flash_remove(struct platform_device *dev)
if (info->map.map_priv_1)
iounmap((void *) info->map.map_priv_1);

kfree(info->partitions);

if (info->res) {
release_resource(info->res);
kfree(info->res);
Expand Down Expand Up @@ -229,13 +226,7 @@ static int ixp2000_flash_probe(struct platform_device *dev)
}
info->mtd->owner = THIS_MODULE;

err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0);
if (err > 0) {
err = mtd_device_register(info->mtd, info->partitions, err);
if(err)
dev_err(&dev->dev, "Could not parse partitions\n");
}

err = mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
if (err)
goto Error;

Expand Down

0 comments on commit 200b877

Please sign in to comment.