diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:22:52 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:20:59 -0400 |
commit | fee88c58c7ddf6f0f41b76a59253d55d321da41a (patch) | |
tree | 0b03e8e5bcb18bf767f8ed47cfcfa9a1b67e8fbc /drivers/mtd | |
parent | 78352282f3960fa2a60af363749c14b4c138bc63 (diff) |
mtd: bfin: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.
Cc: Mike Frysinger <vapier@gentoo.org>
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mtd/maps/bfin-async-flash.c | 21 |
2 files changed, 5 insertions, 17 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 34e72dfda49a..93d47414c06d 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -453,7 +453,6 @@ config MTD_PCMCIA_ANONYMOUS | |||
453 | config MTD_BFIN_ASYNC | 453 | config MTD_BFIN_ASYNC |
454 | tristate "Blackfin BF533-STAMP Flash Chip Support" | 454 | tristate "Blackfin BF533-STAMP Flash Chip Support" |
455 | depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS | 455 | depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS |
456 | select MTD_PARTITIONS | ||
457 | default y | 456 | default y |
458 | help | 457 | help |
459 | Map driver which allows for simultaneous utilization of | 458 | Map driver which allows for simultaneous utilization of |
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c index 85dd18193cf2..d4297a97e100 100644 --- a/drivers/mtd/maps/bfin-async-flash.c +++ b/drivers/mtd/maps/bfin-async-flash.c | |||
@@ -41,9 +41,7 @@ struct async_state { | |||
41 | uint32_t flash_ambctl0, flash_ambctl1; | 41 | uint32_t flash_ambctl0, flash_ambctl1; |
42 | uint32_t save_ambctl0, save_ambctl1; | 42 | uint32_t save_ambctl0, save_ambctl1; |
43 | unsigned long irq_flags; | 43 | unsigned long irq_flags; |
44 | #ifdef CONFIG_MTD_PARTITIONS | ||
45 | struct mtd_partition *parts; | 44 | struct mtd_partition *parts; |
46 | #endif | ||
47 | }; | 45 | }; |
48 | 46 | ||
49 | static void switch_to_flash(struct async_state *state) | 47 | static void switch_to_flash(struct async_state *state) |
@@ -124,9 +122,7 @@ static void bfin_flash_copy_to(struct map_info *map, unsigned long to, const voi | |||
124 | switch_back(state); | 122 | switch_back(state); |
125 | } | 123 | } |
126 | 124 | ||
127 | #ifdef CONFIG_MTD_PARTITIONS | ||
128 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; | 125 | static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; |
129 | #endif | ||
130 | 126 | ||
131 | static int __devinit bfin_flash_probe(struct platform_device *pdev) | 127 | static int __devinit bfin_flash_probe(struct platform_device *pdev) |
132 | { | 128 | { |
@@ -169,22 +165,17 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev) | |||
169 | return -ENXIO; | 165 | return -ENXIO; |
170 | } | 166 | } |
171 | 167 | ||
172 | #ifdef CONFIG_MTD_PARTITIONS | ||
173 | ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0); | 168 | ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0); |
174 | if (ret > 0) { | 169 | if (ret > 0) { |
175 | pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n"); | 170 | pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n"); |
176 | add_mtd_partitions(state->mtd, pdata->parts, ret); | 171 | mtd_device_register(state->mtd, pdata->parts, ret); |
177 | state->parts = pdata->parts; | 172 | state->parts = pdata->parts; |
178 | |||
179 | } else if (pdata->nr_parts) { | 173 | } else if (pdata->nr_parts) { |
180 | pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n"); | 174 | pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n"); |
181 | add_mtd_partitions(state->mtd, pdata->parts, pdata->nr_parts); | 175 | mtd_device_register(state->mtd, pdata->parts, pdata->nr_parts); |
182 | 176 | } else { | |
183 | } else | ||
184 | #endif | ||
185 | { | ||
186 | pr_devinit(KERN_NOTICE DRIVER_NAME ": no partition info available, registering whole flash at once\n"); | 177 | pr_devinit(KERN_NOTICE DRIVER_NAME ": no partition info available, registering whole flash at once\n"); |
187 | add_mtd_device(state->mtd); | 178 | mtd_device_register(state->mtd, NULL, 0); |
188 | } | 179 | } |
189 | 180 | ||
190 | platform_set_drvdata(pdev, state); | 181 | platform_set_drvdata(pdev, state); |
@@ -196,10 +187,8 @@ static int __devexit bfin_flash_remove(struct platform_device *pdev) | |||
196 | { | 187 | { |
197 | struct async_state *state = platform_get_drvdata(pdev); | 188 | struct async_state *state = platform_get_drvdata(pdev); |
198 | gpio_free(state->enet_flash_pin); | 189 | gpio_free(state->enet_flash_pin); |
199 | #ifdef CONFIG_MTD_PARTITIONS | 190 | mtd_device_unregister(state->mtd); |
200 | del_mtd_partitions(state->mtd); | ||
201 | kfree(state->parts); | 191 | kfree(state->parts); |
202 | #endif | ||
203 | map_destroy(state->mtd); | 192 | map_destroy(state->mtd); |
204 | kfree(state); | 193 | kfree(state); |
205 | return 0; | 194 | return 0; |