aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-06-02 09:59:35 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:06 -0400
commit3d0e9db409909a0259fa005fee81a7c639bd645a (patch)
treef8404d13e54d1e1a851f589b319cfe97938a4107
parentcd3aafd0bd3ad383fd43196bc8dcac2edfec95c2 (diff)
mtd: dc21285.c: use mtd_device_parse_register
Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--drivers/mtd/maps/dc21285.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index 7a9e1989c977..f43b365b848c 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -145,14 +145,10 @@ static struct map_info dc21285_map = {
145 145
146 146
147/* Partition stuff */ 147/* Partition stuff */
148static struct mtd_partition *dc21285_parts;
149static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; 148static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
150 149
151static int __init init_dc21285(void) 150static int __init init_dc21285(void)
152{ 151{
153
154 int nrparts;
155
156 /* Determine bankwidth */ 152 /* Determine bankwidth */
157 switch (*CSR_SA110_CNTL & (3<<14)) { 153 switch (*CSR_SA110_CNTL & (3<<14)) {
158 case SA110_CNTL_ROMWIDTH_8: 154 case SA110_CNTL_ROMWIDTH_8:
@@ -200,8 +196,7 @@ static int __init init_dc21285(void)
200 196
201 dc21285_mtd->owner = THIS_MODULE; 197 dc21285_mtd->owner = THIS_MODULE;
202 198
203 nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0); 199 mtd_device_parse_register(dc21285_mtd, probes, 0, NULL, 0);
204 mtd_device_register(dc21285_mtd, dc21285_parts, nrparts);
205 200
206 if(machine_is_ebsa285()) { 201 if(machine_is_ebsa285()) {
207 /* 202 /*
@@ -224,8 +219,6 @@ static int __init init_dc21285(void)
224static void __exit cleanup_dc21285(void) 219static void __exit cleanup_dc21285(void)
225{ 220{
226 mtd_device_unregister(dc21285_mtd); 221 mtd_device_unregister(dc21285_mtd);
227 if (dc21285_parts)
228 kfree(dc21285_parts);
229 map_destroy(dc21285_mtd); 222 map_destroy(dc21285_mtd);
230 iounmap(dc21285_map.virt); 223 iounmap(dc21285_map.virt);
231} 224}