aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r--drivers/mtd/maps/physmap.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 380648e9051a..d9603f7f9652 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)
48 48
49 if (info->cmtd) { 49 if (info->cmtd) {
50#ifdef CONFIG_MTD_PARTITIONS 50#ifdef CONFIG_MTD_PARTITIONS
51 if (info->nr_parts || physmap_data->nr_parts) 51 if (info->nr_parts || physmap_data->nr_parts) {
52 del_mtd_partitions(info->cmtd); 52 del_mtd_partitions(info->cmtd);
53 else 53
54 if (info->nr_parts)
55 kfree(info->parts);
56 } else {
54 del_mtd_device(info->cmtd); 57 del_mtd_device(info->cmtd);
58 }
55#else 59#else
56 del_mtd_device(info->cmtd); 60 del_mtd_device(info->cmtd);
57#endif 61#endif
58 }
59#ifdef CONFIG_MTD_PARTITIONS
60 if (info->nr_parts)
61 kfree(info->parts);
62#endif
63
64#ifdef CONFIG_MTD_CONCAT 62#ifdef CONFIG_MTD_CONCAT
65 if (info->cmtd != info->mtd[0]) 63 if (info->cmtd != info->mtd[0])
66 mtd_concat_destroy(info->cmtd); 64 mtd_concat_destroy(info->cmtd);
67#endif 65#endif
66 }
68 67
69 for (i = 0; i < MAX_RESOURCES; i++) { 68 for (i = 0; i < MAX_RESOURCES; i++) {
70 if (info->mtd[i] != NULL) 69 if (info->mtd[i] != NULL)
@@ -130,7 +129,7 @@ static int physmap_flash_probe(struct platform_device *dev)
130 info->map[i].size); 129 info->map[i].size);
131 if (info->map[i].virt == NULL) { 130 if (info->map[i].virt == NULL) {
132 dev_err(&dev->dev, "Failed to ioremap flash region\n"); 131 dev_err(&dev->dev, "Failed to ioremap flash region\n");
133 err = EIO; 132 err = -EIO;
134 goto err_out; 133 goto err_out;
135 } 134 }
136 135