diff options
author | Tony Lindgren <tony@atomide.com> | 2011-11-24 02:46:10 +0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-11-24 02:46:10 +0400 |
commit | 52f3a41e0aca5625fbd118ed57a4debb25817e99 (patch) | |
tree | 86730c862fc97eef5f1eb1a81bf74bf2a8a36754 /drivers/mtd/maps/rbtx4939-flash.c | |
parent | e9b7086b80c4d9e354f4edc9e280ae85a60df408 (diff) | |
parent | 8770b07c2dff3cec2c751b289ee690137c88ea54 (diff) | |
download | linux-52f3a41e0aca5625fbd118ed57a4debb25817e99.tar.xz |
Merge branch 'fixes-v3.2-rc2' into fixes
Diffstat (limited to 'drivers/mtd/maps/rbtx4939-flash.c')
-rw-r--r-- | drivers/mtd/maps/rbtx4939-flash.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c index 761fb459d2c7..0237f197fd12 100644 --- a/drivers/mtd/maps/rbtx4939-flash.c +++ b/drivers/mtd/maps/rbtx4939-flash.c @@ -25,8 +25,6 @@ struct rbtx4939_flash_info { struct mtd_info *mtd; struct map_info map; - int nr_parts; - struct mtd_partition *parts; }; static int rbtx4939_flash_remove(struct platform_device *dev) @@ -41,8 +39,6 @@ static int rbtx4939_flash_remove(struct platform_device *dev) if (info->mtd) { struct rbtx4939_flash_data *pdata = dev->dev.platform_data; - if (info->nr_parts) - kfree(info->parts); mtd_device_unregister(info->mtd); map_destroy(info->mtd); } @@ -50,7 +46,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,22 +102,11 @@ static int rbtx4939_flash_probe(struct platform_device *dev) info->mtd->owner = THIS_MODULE; if (err) goto err_out; + err = mtd_device_parse_register(info->mtd, NULL, 0, + pdata->parts, pdata->nr_parts); - err = parse_mtd_partitions(info->mtd, part_probe_types, - &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; - } - - mtd_device_register(info->mtd, NULL, 0); + if (err) + goto err_out; return 0; err_out: |