diff options
| -rw-r--r-- | arch/sh/boards/mach-rsk/devices-rsk7203.c | 4 | ||||
| -rw-r--r-- | arch/sh/boards/mach-rsk/setup.c | 23 |
2 files changed, 14 insertions, 13 deletions
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c index 4af3a771c058..c37617e63220 100644 --- a/arch/sh/boards/mach-rsk/devices-rsk7203.c +++ b/arch/sh/boards/mach-rsk/devices-rsk7203.c | |||
| @@ -11,10 +11,6 @@ | |||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/mtd/mtd.h> | ||
| 15 | #include <linux/mtd/partitions.h> | ||
| 16 | #include <linux/mtd/physmap.h> | ||
| 17 | #include <linux/mtd/map.h> | ||
| 18 | #include <linux/smsc911x.h> | 14 | #include <linux/smsc911x.h> |
| 19 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
| 20 | #include <linux/leds.h> | 16 | #include <linux/leds.h> |
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c index af64d030a5c7..a5c0df785bfe 100644 --- a/arch/sh/boards/mach-rsk/setup.c +++ b/arch/sh/boards/mach-rsk/setup.c | |||
| @@ -15,14 +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 | ||
| 18 | #include <linux/mtd/map.h> | 19 | #include <linux/mtd/map.h> |
| 20 | #endif | ||
| 19 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
| 20 | #include <asm/io.h> | 22 | #include <asm/io.h> |
| 21 | 23 | ||
| 22 | static const char *probes[] = { "cmdlinepart", NULL }; | ||
| 23 | |||
| 24 | static struct mtd_partition *parsed_partitions; | ||
| 25 | |||
| 26 | static struct mtd_partition rsk_partitions[] = { | 24 | static struct mtd_partition rsk_partitions[] = { |
| 27 | { | 25 | { |
| 28 | .name = "Bootloader", | 26 | .name = "Bootloader", |
| @@ -41,6 +39,8 @@ static struct mtd_partition rsk_partitions[] = { | |||
| 41 | }; | 39 | }; |
| 42 | 40 | ||
| 43 | static struct physmap_flash_data flash_data = { | 41 | static struct physmap_flash_data flash_data = { |
| 42 | .parts = rsk_partitions, | ||
| 43 | .nr_parts = ARRAY_SIZE(rsk_partitions), | ||
| 44 | .width = 2, | 44 | .width = 2, |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| @@ -60,7 +60,8 @@ static struct platform_device flash_device = { | |||
| 60 | }, | 60 | }, |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static struct mtd_info *flash_mtd; | 63 | #ifdef CONFIG_MTD |
| 64 | static const char *probes[] = { "cmdlinepart", NULL }; | ||
| 64 | 65 | ||
| 65 | static struct map_info rsk_flash_map = { | 66 | static struct map_info rsk_flash_map = { |
| 66 | .name = "RSK+ Flash", | 67 | .name = "RSK+ Flash", |
| @@ -68,6 +69,10 @@ static struct map_info rsk_flash_map = { | |||
| 68 | .bankwidth = 2, | 69 | .bankwidth = 2, |
| 69 | }; | 70 | }; |
| 70 | 71 | ||
| 72 | static struct mtd_info *flash_mtd; | ||
| 73 | |||
| 74 | static struct mtd_partition *parsed_partitions; | ||
| 75 | |||
| 71 | static void __init set_mtd_partitions(void) | 76 | static void __init set_mtd_partitions(void) |
| 72 | { | 77 | { |
| 73 | int nr_parts = 0; | 78 | int nr_parts = 0; |
| @@ -77,14 +82,14 @@ static void __init set_mtd_partitions(void) | |||
| 77 | nr_parts = parse_mtd_partitions(flash_mtd, probes, | 82 | nr_parts = parse_mtd_partitions(flash_mtd, probes, |
| 78 | &parsed_partitions, 0); | 83 | &parsed_partitions, 0); |
| 79 | /* If there is no partition table, used the hard coded table */ | 84 | /* If there is no partition table, used the hard coded table */ |
| 80 | if (nr_parts <= 0) { | 85 | if (nr_parts > 0) { |
| 81 | flash_data.parts = rsk_partitions; | ||
| 82 | flash_data.nr_parts = ARRAY_SIZE(rsk_partitions); | ||
| 83 | } else { | ||
| 84 | flash_data.nr_parts = nr_parts; | 86 | flash_data.nr_parts = nr_parts; |
| 85 | flash_data.parts = parsed_partitions; | 87 | flash_data.parts = parsed_partitions; |
| 86 | } | 88 | } |
| 87 | } | 89 | } |
| 90 | #else | ||
| 91 | static inline void set_mtd_partitions(void) {} | ||
| 92 | #endif | ||
| 88 | 93 | ||
| 89 | static struct platform_device *rsk_devices[] __initdata = { | 94 | static struct platform_device *rsk_devices[] __initdata = { |
| 90 | &flash_device, | 95 | &flash_device, |
