diff options
Diffstat (limited to 'arch/arm/mach-sa1100/neponset.c')
-rw-r--r-- | arch/arm/mach-sa1100/neponset.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index fc061641b7b..9e02bc3712a 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c @@ -8,7 +8,7 @@ #include <linux/tty.h> #include <linux/ioport.h> #include <linux/serial_core.h> -#include <linux/device.h> +#include <linux/platform_device.h> #include <linux/slab.h> #include <asm/hardware.h> @@ -137,7 +137,7 @@ static struct sa1100_port_fns neponset_port_fns __initdata = { .get_mctrl = neponset_get_mctrl, }; -static int neponset_probe(struct device *dev) +static int neponset_probe(struct platform_device *dev) { sa1100_register_uart_fns(&neponset_port_fns); @@ -178,33 +178,27 @@ static int neponset_probe(struct device *dev) /* * LDM power management. */ -static int neponset_suspend(struct device *dev, pm_message_t state, u32 level) +static int neponset_suspend(struct platform_device *dev, pm_message_t state) { /* * Save state. */ - if (level == SUSPEND_SAVE_STATE || - level == SUSPEND_DISABLE || - level == SUSPEND_POWER_DOWN) { - if (!dev->power.saved_state) - dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); - if (!dev->power.saved_state) - return -ENOMEM; - - *(unsigned int *)dev->power.saved_state = NCR_0; - } + if (!dev->dev.power.saved_state) + dev->dev.power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); + if (!dev->dev.power.saved_state) + return -ENOMEM; + + *(unsigned int *)dev->dev.power.saved_state = NCR_0; return 0; } -static int neponset_resume(struct device *dev, u32 level) +static int neponset_resume(struct platform_device *dev) { - if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) { - if (dev->power.saved_state) { - NCR_0 = *(unsigned int *)dev->power.saved_state; - kfree(dev->power.saved_state); - dev->power.saved_state = NULL; - } + if (dev->dev.power.saved_state) { + NCR_0 = *(unsigned int *)dev->dev.power.saved_state; + kfree(dev->dev.power.saved_state); + dev->dev.power.saved_state = NULL; } return 0; @@ -215,12 +209,13 @@ static int neponset_resume(struct device *dev, u32 level) #define neponset_resume NULL #endif -static struct device_driver neponset_device_driver = { - .name = "neponset", - .bus = &platform_bus_type, +static struct platform_driver neponset_device_driver = { .probe = neponset_probe, .suspend = neponset_suspend, .resume = neponset_resume, + .driver = { + .name = "neponset", + }, }; static struct resource neponset_resources[] = { @@ -299,7 +294,7 @@ static struct platform_device *devices[] __initdata = { static int __init neponset_init(void) { - driver_register(&neponset_device_driver); + platform_driver_register(&neponset_device_driver); /* * The Neponset is only present on the Assabet machine type. @@ -331,9 +326,17 @@ static int __init neponset_init(void) subsys_initcall(neponset_init); static struct map_desc neponset_io_desc[] __initdata = { - /* virtual physical length type */ - { 0xf3000000, 0x10000000, SZ_1M, MT_DEVICE }, /* System Registers */ - { 0xf4000000, 0x40000000, SZ_1M, MT_DEVICE } /* SA-1111 */ + { /* System Registers */ + .virtual = 0xf3000000, + .pfn = __phys_to_pfn(0x10000000), + .length = SZ_1M, + .type = MT_DEVICE + }, { /* SA-1111 */ + .virtual = 0xf4000000, + .pfn = __phys_to_pfn(0x40000000), + .length = SZ_1M, + .type = MT_DEVICE + } }; void __init neponset_map_io(void) |