Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182198
b: refs/heads/master
c: 2724daf
h: refs/heads/master
v: v3
  • Loading branch information
Finn Thain authored and Geert Uytterhoeven committed Feb 27, 2010
1 parent 8ed237c commit dbaf3aa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53aac0ad7cb32af5c25d432454f936b57bf8c11f
refs/heads/master: 2724daf439d9f4e9f25c9fb8de8602ba61758478
35 changes: 16 additions & 19 deletions trunk/arch/m68k/mac/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
#include <asm/mac_oss.h>
#include <asm/mac_psc.h>

/* platform device info */

#define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */

/* Mac bootinfo struct */
struct mac_booter_data mac_bi_data;

Expand Down Expand Up @@ -862,23 +858,23 @@ static void mac_get_model(char *str)
strcat(str, macintosh_config->name);
}

static struct resource swim_resources[1];
static struct resource swim_rsrc = { .flags = IORESOURCE_MEM };

static struct platform_device swim_device = {
static struct platform_device swim_pdev = {
.name = "swim",
.id = -1,
.num_resources = ARRAY_SIZE(swim_resources),
.resource = swim_resources,
};

static struct platform_device *mac_platform_devices[] __initdata = {
&swim_device
.num_resources = 1,
.resource = &swim_rsrc,
};

int __init mac_platform_init(void)
{
u8 *swim_base;

/*
* Floppy device
*/

switch (macintosh_config->floppy_type) {
case MAC_FLOPPY_SWIM_ADDR1:
swim_base = (u8 *)(VIA1_BASE + 0x1E000);
Expand All @@ -887,16 +883,17 @@ int __init mac_platform_init(void)
swim_base = (u8 *)(VIA1_BASE + 0x16000);
break;
default:
return 0;
swim_base = NULL;
break;
}

swim_resources[0].name = "swim-regs";
swim_resources[0].start = (resource_size_t)swim_base;
swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE);
swim_resources[0].flags = IORESOURCE_MEM;
if (swim_base) {
swim_rsrc.start = (resource_size_t) swim_base,
swim_rsrc.end = (resource_size_t) swim_base + 0x2000,
platform_device_register(&swim_pdev);
}

return platform_add_devices(mac_platform_devices,
ARRAY_SIZE(mac_platform_devices));
return 0;
}

arch_initcall(mac_platform_init);
4 changes: 2 additions & 2 deletions trunk/drivers/block/swim.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ static int __devinit swim_probe(struct platform_device *dev)
struct swim_priv *swd;
int ret;

res = platform_get_resource_byname(dev, IORESOURCE_MEM, "swim-regs");
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res) {
ret = -ENODEV;
goto out;
Expand Down Expand Up @@ -942,7 +942,7 @@ static int __devexit swim_remove(struct platform_device *dev)

iounmap(swd->base);

res = platform_get_resource_byname(dev, IORESOURCE_MEM, "swim-regs");
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res->start, resource_size(res));

Expand Down

0 comments on commit dbaf3aa

Please sign in to comment.