diff options
-rw-r--r-- | arch/m68k/mac/config.c | 35 | ||||
-rw-r--r-- | drivers/block/swim.c | 4 |
2 files changed, 18 insertions, 21 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); |
diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 8f569e3df890..821c2833f9cf 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c | |||
@@ -864,7 +864,7 @@ static int __devinit swim_probe(struct platform_device *dev) | |||
864 | struct swim_priv *swd; | 864 | struct swim_priv *swd; |
865 | int ret; | 865 | int ret; |
866 | 866 | ||
867 | res = platform_get_resource_byname(dev, IORESOURCE_MEM, "swim-regs"); | 867 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
868 | if (!res) { | 868 | if (!res) { |
869 | ret = -ENODEV; | 869 | ret = -ENODEV; |
870 | goto out; | 870 | goto out; |
@@ -942,7 +942,7 @@ static int __devexit swim_remove(struct platform_device *dev) | |||
942 | 942 | ||
943 | iounmap(swd->base); | 943 | iounmap(swd->base); |
944 | 944 | ||
945 | res = platform_get_resource_byname(dev, IORESOURCE_MEM, "swim-regs"); | 945 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
946 | if (res) | 946 | if (res) |
947 | release_mem_region(res->start, resource_size(res)); | 947 | release_mem_region(res->start, resource_size(res)); |
948 | 948 | ||