diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2012-01-11 23:47:42 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2012-01-11 23:47:42 -0500 |
| commit | 603129afe6f8174c6305498dd5903304c41cd00d (patch) | |
| tree | afc47c1ce1096ba002cc8f06ae41cce88e8cea11 | |
| parent | b1bdd255661369cb6eb90b6e181169b5e6d0f9b6 (diff) | |
sh: mach-rsk: Update for parse_mtd_partitions() fallout.
The RSK+ setup code was doing some pretty dubious things with
parse_mtd_partitions() in order to populate the physmap-flash map
platform data. The physmap-flash driver contains all of the functionality
that we require already, so simply drop the special casing and pad out
the platform data accordingly.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| -rw-r--r-- | arch/sh/boards/mach-rsk/setup.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c index a5c0df785bfe..895f030070d3 100644 --- a/arch/sh/boards/mach-rsk/setup.c +++ b/arch/sh/boards/mach-rsk/setup.c | |||
| @@ -15,12 +15,12 @@ | |||
| 15 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
| 16 | #include <linux/mtd/partitions.h> | 16 | #include <linux/mtd/partitions.h> |
| 17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
| 18 | #ifdef CONFIG_MTD | ||
| 19 | #include <linux/mtd/map.h> | 18 | #include <linux/mtd/map.h> |
| 20 | #endif | ||
| 21 | #include <asm/machvec.h> | 19 | #include <asm/machvec.h> |
| 22 | #include <asm/io.h> | 20 | #include <asm/io.h> |
| 23 | 21 | ||
| 22 | static const char *part_probes[] = { "cmdlinepart", NULL }; | ||
| 23 | |||
| 24 | static struct mtd_partition rsk_partitions[] = { | 24 | static struct mtd_partition rsk_partitions[] = { |
| 25 | { | 25 | { |
| 26 | .name = "Bootloader", | 26 | .name = "Bootloader", |
| @@ -39,9 +39,10 @@ static struct mtd_partition rsk_partitions[] = { | |||
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | static struct physmap_flash_data flash_data = { | 41 | static struct physmap_flash_data flash_data = { |
| 42 | .parts = rsk_partitions, | 42 | .parts = rsk_partitions, |
| 43 | .nr_parts = ARRAY_SIZE(rsk_partitions), | 43 | .nr_parts = ARRAY_SIZE(rsk_partitions), |
| 44 | .width = 2, | 44 | .width = 2, |
| 45 | .part_probe_types = part_probes, | ||
| 45 | }; | 46 | }; |
| 46 | 47 | ||
| 47 | static struct resource flash_resource = { | 48 | static struct resource flash_resource = { |
| @@ -60,44 +61,12 @@ static struct platform_device flash_device = { | |||
| 60 | }, | 61 | }, |
| 61 | }; | 62 | }; |
| 62 | 63 | ||
| 63 | #ifdef CONFIG_MTD | ||
| 64 | static const char *probes[] = { "cmdlinepart", NULL }; | ||
| 65 | |||
| 66 | static struct map_info rsk_flash_map = { | ||
| 67 | .name = "RSK+ Flash", | ||
| 68 | .size = 0x400000, | ||
| 69 | .bankwidth = 2, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct mtd_info *flash_mtd; | ||
| 73 | |||
| 74 | static struct mtd_partition *parsed_partitions; | ||
| 75 | |||
| 76 | static void __init set_mtd_partitions(void) | ||
| 77 | { | ||
| 78 | int nr_parts = 0; | ||
| 79 | |||
| 80 | simple_map_init(&rsk_flash_map); | ||
| 81 | flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map); | ||
| 82 | nr_parts = parse_mtd_partitions(flash_mtd, probes, | ||
| 83 | &parsed_partitions, 0); | ||
| 84 | /* If there is no partition table, used the hard coded table */ | ||
| 85 | if (nr_parts > 0) { | ||
| 86 | flash_data.nr_parts = nr_parts; | ||
| 87 | flash_data.parts = parsed_partitions; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | #else | ||
| 91 | static inline void set_mtd_partitions(void) {} | ||
| 92 | #endif | ||
| 93 | |||
| 94 | static struct platform_device *rsk_devices[] __initdata = { | 64 | static struct platform_device *rsk_devices[] __initdata = { |
| 95 | &flash_device, | 65 | &flash_device, |
| 96 | }; | 66 | }; |
| 97 | 67 | ||
| 98 | static int __init rsk_devices_setup(void) | 68 | static int __init rsk_devices_setup(void) |
| 99 | { | 69 | { |
| 100 | set_mtd_partitions(); | ||
| 101 | return platform_add_devices(rsk_devices, | 70 | return platform_add_devices(rsk_devices, |
| 102 | ARRAY_SIZE(rsk_devices)); | 71 | ARRAY_SIZE(rsk_devices)); |
| 103 | } | 72 | } |
