From: Paul Mundt Date: Thu, 12 Jan 2012 04:47:42 +0000 (+0900) Subject: sh: mach-rsk: Update for parse_mtd_partitions() fallout. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=603129afe6f8174c6305498dd5903304c41cd00d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 --- diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c index a5c0df785bf..895f030070d 100644 --- a/arch/sh/boards/mach-rsk/setup.c +++ b/arch/sh/boards/mach-rsk/setup.c @@ -15,12 +15,12 @@ #include #include #include -#ifdef CONFIG_MTD #include -#endif #include #include +static const char *part_probes[] = { "cmdlinepart", NULL }; + static struct mtd_partition rsk_partitions[] = { { .name = "Bootloader", @@ -39,9 +39,10 @@ static struct mtd_partition rsk_partitions[] = { }; static struct physmap_flash_data flash_data = { - .parts = rsk_partitions, - .nr_parts = ARRAY_SIZE(rsk_partitions), - .width = 2, + .parts = rsk_partitions, + .nr_parts = ARRAY_SIZE(rsk_partitions), + .width = 2, + .part_probe_types = part_probes, }; static struct resource flash_resource = { @@ -60,44 +61,12 @@ static struct platform_device flash_device = { }, }; -#ifdef CONFIG_MTD -static const char *probes[] = { "cmdlinepart", NULL }; - -static struct map_info rsk_flash_map = { - .name = "RSK+ Flash", - .size = 0x400000, - .bankwidth = 2, -}; - -static struct mtd_info *flash_mtd; - -static struct mtd_partition *parsed_partitions; - -static void __init set_mtd_partitions(void) -{ - int nr_parts = 0; - - simple_map_init(&rsk_flash_map); - flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map); - nr_parts = parse_mtd_partitions(flash_mtd, probes, - &parsed_partitions, 0); - /* If there is no partition table, used the hard coded table */ - if (nr_parts > 0) { - flash_data.nr_parts = nr_parts; - flash_data.parts = parsed_partitions; - } -} -#else -static inline void set_mtd_partitions(void) {} -#endif - static struct platform_device *rsk_devices[] __initdata = { &flash_device, }; static int __init rsk_devices_setup(void) { - set_mtd_partitions(); return platform_add_devices(rsk_devices, ARRAY_SIZE(rsk_devices)); }