diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2009-11-03 08:39:56 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-02-27 12:27:15 -0500 |
commit | 2724daf439d9f4e9f25c9fb8de8602ba61758478 (patch) | |
tree | eb15e7240b92813d8e945869424b2616a57b3999 /arch/m68k/mac | |
parent | 53aac0ad7cb32af5c25d432454f936b57bf8c11f (diff) |
mac68k: rework SWIM platform device
Adjust the platform device code to conform with the code style used in the
rest of this patch series. No need to name resources nor to register
devices which are not applicable.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/mac')
-rw-r--r-- | arch/m68k/mac/config.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index cad55bc087df..e6666a30f24b 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -44,10 +44,6 @@ | |||
44 | #include <asm/mac_oss.h> | 44 | #include <asm/mac_oss.h> |
45 | #include <asm/mac_psc.h> | 45 | #include <asm/mac_psc.h> |
46 | 46 | ||
47 | /* platform device info */ | ||
48 | |||
49 | #define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */ | ||
50 | |||
51 | /* Mac bootinfo struct */ | 47 | /* Mac bootinfo struct */ |
52 | struct mac_booter_data mac_bi_data; | 48 | struct mac_booter_data mac_bi_data; |
53 | 49 | ||
@@ -862,23 +858,23 @@ static void mac_get_model(char *str) | |||
862 | strcat(str, macintosh_config->name); | 858 | strcat(str, macintosh_config->name); |
863 | } | 859 | } |
864 | 860 | ||
865 | static struct resource swim_resources[1]; | 861 | static struct resource swim_rsrc = { .flags = IORESOURCE_MEM }; |
866 | 862 | ||
867 | static struct platform_device swim_device = { | 863 | static struct platform_device swim_pdev = { |
868 | .name = "swim", | 864 | .name = "swim", |
869 | .id = -1, | 865 | .id = -1, |
870 | .num_resources = ARRAY_SIZE(swim_resources), | 866 | .num_resources = 1, |
871 | .resource = swim_resources, | 867 | .resource = &swim_rsrc, |
872 | }; | ||
873 | |||
874 | static struct platform_device *mac_platform_devices[] __initdata = { | ||
875 | &swim_device | ||
876 | }; | 868 | }; |
877 | 869 | ||
878 | int __init mac_platform_init(void) | 870 | int __init mac_platform_init(void) |
879 | { | 871 | { |
880 | u8 *swim_base; | 872 | u8 *swim_base; |
881 | 873 | ||
874 | /* | ||
875 | * Floppy device | ||
876 | */ | ||
877 | |||
882 | switch (macintosh_config->floppy_type) { | 878 | switch (macintosh_config->floppy_type) { |
883 | case MAC_FLOPPY_SWIM_ADDR1: | 879 | case MAC_FLOPPY_SWIM_ADDR1: |
884 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); | 880 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); |
@@ -887,16 +883,17 @@ int __init mac_platform_init(void) | |||
887 | swim_base = (u8 *)(VIA1_BASE + 0x16000); | 883 | swim_base = (u8 *)(VIA1_BASE + 0x16000); |
888 | break; | 884 | break; |
889 | default: | 885 | default: |
890 | return 0; | 886 | swim_base = NULL; |
887 | break; | ||
891 | } | 888 | } |
892 | 889 | ||
893 | swim_resources[0].name = "swim-regs"; | 890 | if (swim_base) { |
894 | swim_resources[0].start = (resource_size_t)swim_base; | 891 | swim_rsrc.start = (resource_size_t) swim_base, |
895 | swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE); | 892 | swim_rsrc.end = (resource_size_t) swim_base + 0x2000, |
896 | swim_resources[0].flags = IORESOURCE_MEM; | 893 | platform_device_register(&swim_pdev); |
894 | } | ||
897 | 895 | ||
898 | return platform_add_devices(mac_platform_devices, | 896 | return 0; |
899 | ARRAY_SIZE(mac_platform_devices)); | ||
900 | } | 897 | } |
901 | 898 | ||
902 | arch_initcall(mac_platform_init); | 899 | arch_initcall(mac_platform_init); |