aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/physmap.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-12 20:33:21 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-12 20:33:21 -0400
commit480c93df5b99699390f93a7024c9f60d09da0e96 (patch)
treeb93b6c8c71c5f2e716dd05b126e01ef4e20ff0af /drivers/mtd/maps/physmap.c
parentaecfcde920da8d32949f6cbbc1fc051b4ef9e7be (diff)
parentd820ac4c2fa881079e6b689d2098adce337558ae (diff)
Merge branch 'core/locking' into tracing/ftrace
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r--drivers/mtd/maps/physmap.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 4b122e7ab4b3..229718222db7 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -46,16 +46,19 @@ static int physmap_flash_remove(struct platform_device *dev)
46 46
47 physmap_data = dev->dev.platform_data; 47 physmap_data = dev->dev.platform_data;
48 48
49 if (info->cmtd) {
49#ifdef CONFIG_MTD_PARTITIONS 50#ifdef CONFIG_MTD_PARTITIONS
50 if (info->nr_parts) { 51 if (info->nr_parts || physmap_data->nr_parts)
51 del_mtd_partitions(info->cmtd); 52 del_mtd_partitions(info->cmtd);
52 kfree(info->parts); 53 else
53 } else if (physmap_data->nr_parts) 54 del_mtd_device(info->cmtd);
54 del_mtd_partitions(info->cmtd);
55 else
56 del_mtd_device(info->cmtd);
57#else 55#else
58 del_mtd_device(info->cmtd); 56 del_mtd_device(info->cmtd);
57#endif
58 }
59#ifdef CONFIG_MTD_PARTITIONS
60 if (info->nr_parts)
61 kfree(info->parts);
59#endif 62#endif
60 63
61#ifdef CONFIG_MTD_CONCAT 64#ifdef CONFIG_MTD_CONCAT