diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-02-02 23:10:39 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-02-02 23:10:39 +0100 |
commit | e1a0bdd8022317e98650e70850de73eccfcde5ad (patch) | |
tree | 462f63307118b95c8cbacee6954e4d09ee85b8d1 /drivers/mtd/maps/physmap.c | |
parent | 8127f4e883666c9960cfa89cffd36313748f8bab (diff) | |
parent | 1a45dcfe2525e9432cb4aba461d4994fc2befe42 (diff) |
Merge branch 'master' into upstream
Conflicts:
drivers/hid/hid-ids.h
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r-- | drivers/mtd/maps/physmap.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 380648e9051..d9603f7f965 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -48,23 +48,22 @@ static int physmap_flash_remove(struct platform_device *dev) if (info->cmtd) { #ifdef CONFIG_MTD_PARTITIONS - if (info->nr_parts || physmap_data->nr_parts) + if (info->nr_parts || physmap_data->nr_parts) { del_mtd_partitions(info->cmtd); - else + + if (info->nr_parts) + kfree(info->parts); + } else { del_mtd_device(info->cmtd); + } #else del_mtd_device(info->cmtd); #endif - } -#ifdef CONFIG_MTD_PARTITIONS - if (info->nr_parts) - kfree(info->parts); -#endif - #ifdef CONFIG_MTD_CONCAT - if (info->cmtd != info->mtd[0]) - mtd_concat_destroy(info->cmtd); + if (info->cmtd != info->mtd[0]) + mtd_concat_destroy(info->cmtd); #endif + } for (i = 0; i < MAX_RESOURCES; i++) { if (info->mtd[i] != NULL) @@ -130,7 +129,7 @@ static int physmap_flash_probe(struct platform_device *dev) info->map[i].size); if (info->map[i].virt == NULL) { dev_err(&dev->dev, "Failed to ioremap flash region\n"); - err = EIO; + err = -EIO; goto err_out; } |