diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:22:50 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:20:48 -0400 |
commit | 3dfad123e81cdf11642aa63da1149ee71a369d2d (patch) | |
tree | 971642bf84d176dc7b52cfccc95a420158a0e6d7 | |
parent | 6cbbf2ffa170c4cb5f1d1c0dd0f2bd597813a002 (diff) |
mtd: pxa: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.
Cc: Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 18 | ||||
-rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 13 |
4 files changed, 7 insertions, 26 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 2fc9f94cdd2..cd19309fd3b 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -153,7 +153,6 @@ config MACH_XCEP | |||
153 | bool "Iskratel Electronics XCEP" | 153 | bool "Iskratel Electronics XCEP" |
154 | select PXA25x | 154 | select PXA25x |
155 | select MTD | 155 | select MTD |
156 | select MTD_PARTITIONS | ||
157 | select MTD_PHYSMAP | 156 | select MTD_PHYSMAP |
158 | select MTD_CFI_INTELEXT | 157 | select MTD_CFI_INTELEXT |
159 | select MTD_CFI | 158 | select MTD_CFI |
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 44b1f46458c..34e72dfda49 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -161,7 +161,6 @@ config MTD_SBC_GXX | |||
161 | config MTD_PXA2XX | 161 | config MTD_PXA2XX |
162 | tristate "CFI Flash device mapped on Intel XScale PXA2xx based boards" | 162 | tristate "CFI Flash device mapped on Intel XScale PXA2xx based boards" |
163 | depends on (PXA25x || PXA27x) && MTD_CFI_INTELEXT | 163 | depends on (PXA25x || PXA27x) && MTD_CFI_INTELEXT |
164 | select MTD_PARTITIONS | ||
165 | help | 164 | help |
166 | This provides a driver for the NOR flash attached to a PXA2xx chip. | 165 | This provides a driver for the NOR flash attached to a PXA2xx chip. |
167 | 166 | ||
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index d8ae634d347..f59d62f74d4 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -104,23 +104,18 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev) | |||
104 | } | 104 | } |
105 | info->mtd->owner = THIS_MODULE; | 105 | info->mtd->owner = THIS_MODULE; |
106 | 106 | ||
107 | #ifdef CONFIG_MTD_PARTITIONS | ||
108 | ret = parse_mtd_partitions(info->mtd, probes, &parts, 0); | 107 | ret = parse_mtd_partitions(info->mtd, probes, &parts, 0); |
109 | 108 | ||
110 | if (ret > 0) { | 109 | if (ret > 0) { |
111 | info->nr_parts = ret; | 110 | info->nr_parts = ret; |
112 | info->parts = parts; | 111 | info->parts = parts; |
113 | } | 112 | } |
114 | #endif | ||
115 | 113 | ||
116 | if (info->nr_parts) { | 114 | if (!info->nr_parts) |
117 | add_mtd_partitions(info->mtd, info->parts, | ||
118 | info->nr_parts); | ||
119 | } else { | ||
120 | printk("Registering %s as whole device\n", | 115 | printk("Registering %s as whole device\n", |
121 | info->map.name); | 116 | info->map.name); |
122 | add_mtd_device(info->mtd); | 117 | |
123 | } | 118 | mtd_device_register(info->mtd, info->parts, info->nr_parts); |
124 | 119 | ||
125 | platform_set_drvdata(pdev, info); | 120 | platform_set_drvdata(pdev, info); |
126 | return 0; | 121 | return 0; |
@@ -132,12 +127,7 @@ static int __devexit pxa2xx_flash_remove(struct platform_device *dev) | |||
132 | 127 | ||
133 | platform_set_drvdata(dev, NULL); | 128 | platform_set_drvdata(dev, NULL); |
134 | 129 | ||
135 | #ifdef CONFIG_MTD_PARTITIONS | 130 | mtd_device_unregister(info->mtd); |
136 | if (info->nr_parts) | ||
137 | del_mtd_partitions(info->mtd); | ||
138 | else | ||
139 | #endif | ||
140 | del_mtd_device(info->mtd); | ||
141 | 131 | ||
142 | map_destroy(info->mtd); | 132 | map_destroy(info->mtd); |
143 | iounmap(info->map.virt); | 133 | iounmap(info->map.virt); |
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index ff0701276d6..1fb3b3a8058 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -1119,10 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) | |||
1119 | clk_put(info->clk); | 1119 | clk_put(info->clk); |
1120 | 1120 | ||
1121 | if (mtd) { | 1121 | if (mtd) { |
1122 | del_mtd_device(mtd); | 1122 | mtd_device_unregister(mtd); |
1123 | #ifdef CONFIG_MTD_PARTITIONS | ||
1124 | del_mtd_partitions(mtd); | ||
1125 | #endif | ||
1126 | kfree(mtd); | 1123 | kfree(mtd); |
1127 | } | 1124 | } |
1128 | return 0; | 1125 | return 0; |
@@ -1149,7 +1146,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1149 | return -ENODEV; | 1146 | return -ENODEV; |
1150 | } | 1147 | } |
1151 | 1148 | ||
1152 | #ifdef CONFIG_MTD_PARTITIONS | ||
1153 | if (mtd_has_cmdlinepart()) { | 1149 | if (mtd_has_cmdlinepart()) { |
1154 | const char *probes[] = { "cmdlinepart", NULL }; | 1150 | const char *probes[] = { "cmdlinepart", NULL }; |
1155 | struct mtd_partition *parts; | 1151 | struct mtd_partition *parts; |
@@ -1158,13 +1154,10 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1158 | nr_parts = parse_mtd_partitions(info->mtd, probes, &parts, 0); | 1154 | nr_parts = parse_mtd_partitions(info->mtd, probes, &parts, 0); |
1159 | 1155 | ||
1160 | if (nr_parts) | 1156 | if (nr_parts) |
1161 | return add_mtd_partitions(info->mtd, parts, nr_parts); | 1157 | return mtd_device_register(info->mtd, parts, nr_parts); |
1162 | } | 1158 | } |
1163 | 1159 | ||
1164 | return add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts); | 1160 | return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts); |
1165 | #else | ||
1166 | return 0; | ||
1167 | #endif | ||
1168 | } | 1161 | } |
1169 | 1162 | ||
1170 | #ifdef CONFIG_PM | 1163 | #ifdef CONFIG_PM |