sh: rsk7203 CONFIG_MTD=n fix
Fix the rsk7203 board code to build with CONFIG_MTD=n. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
60339fad5c
commit
88345411df
2 changed files with 14 additions and 13 deletions
|
@ -11,10 +11,6 @@
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/mtd/mtd.h>
|
|
||||||
#include <linux/mtd/partitions.h>
|
|
||||||
#include <linux/mtd/physmap.h>
|
|
||||||
#include <linux/mtd/map.h>
|
|
||||||
#include <linux/smsc911x.h>
|
#include <linux/smsc911x.h>
|
||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
|
|
|
@ -15,14 +15,12 @@
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
#include <linux/mtd/partitions.h>
|
#include <linux/mtd/partitions.h>
|
||||||
#include <linux/mtd/physmap.h>
|
#include <linux/mtd/physmap.h>
|
||||||
|
#ifdef CONFIG_MTD
|
||||||
#include <linux/mtd/map.h>
|
#include <linux/mtd/map.h>
|
||||||
|
#endif
|
||||||
#include <asm/machvec.h>
|
#include <asm/machvec.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
static const char *probes[] = { "cmdlinepart", NULL };
|
|
||||||
|
|
||||||
static struct mtd_partition *parsed_partitions;
|
|
||||||
|
|
||||||
static struct mtd_partition rsk_partitions[] = {
|
static struct mtd_partition rsk_partitions[] = {
|
||||||
{
|
{
|
||||||
.name = "Bootloader",
|
.name = "Bootloader",
|
||||||
|
@ -41,6 +39,8 @@ static struct mtd_partition rsk_partitions[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct physmap_flash_data flash_data = {
|
static struct physmap_flash_data flash_data = {
|
||||||
|
.parts = rsk_partitions,
|
||||||
|
.nr_parts = ARRAY_SIZE(rsk_partitions),
|
||||||
.width = 2,
|
.width = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ static struct platform_device flash_device = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct mtd_info *flash_mtd;
|
#ifdef CONFIG_MTD
|
||||||
|
static const char *probes[] = { "cmdlinepart", NULL };
|
||||||
|
|
||||||
static struct map_info rsk_flash_map = {
|
static struct map_info rsk_flash_map = {
|
||||||
.name = "RSK+ Flash",
|
.name = "RSK+ Flash",
|
||||||
|
@ -68,6 +69,10 @@ static struct map_info rsk_flash_map = {
|
||||||
.bankwidth = 2,
|
.bankwidth = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct mtd_info *flash_mtd;
|
||||||
|
|
||||||
|
static struct mtd_partition *parsed_partitions;
|
||||||
|
|
||||||
static void __init set_mtd_partitions(void)
|
static void __init set_mtd_partitions(void)
|
||||||
{
|
{
|
||||||
int nr_parts = 0;
|
int nr_parts = 0;
|
||||||
|
@ -77,14 +82,14 @@ static void __init set_mtd_partitions(void)
|
||||||
nr_parts = parse_mtd_partitions(flash_mtd, probes,
|
nr_parts = parse_mtd_partitions(flash_mtd, probes,
|
||||||
&parsed_partitions, 0);
|
&parsed_partitions, 0);
|
||||||
/* If there is no partition table, used the hard coded table */
|
/* If there is no partition table, used the hard coded table */
|
||||||
if (nr_parts <= 0) {
|
if (nr_parts > 0) {
|
||||||
flash_data.parts = rsk_partitions;
|
|
||||||
flash_data.nr_parts = ARRAY_SIZE(rsk_partitions);
|
|
||||||
} else {
|
|
||||||
flash_data.nr_parts = nr_parts;
|
flash_data.nr_parts = nr_parts;
|
||||||
flash_data.parts = parsed_partitions;
|
flash_data.parts = parsed_partitions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static inline void set_mtd_partitions(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct platform_device *rsk_devices[] __initdata = {
|
static struct platform_device *rsk_devices[] __initdata = {
|
||||||
&flash_device,
|
&flash_device,
|
||||||
|
|
Reference in a new issue