diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/serial/sa1100.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/sa1100.c')
-rw-r--r-- | drivers/serial/sa1100.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index ed618cc7ae96..fd9deee20e05 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -834,9 +834,9 @@ static struct uart_driver sa1100_reg = { .cons = SA1100_CONSOLE, }; -static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) +static int sa1100_serial_suspend(struct platform_device *dev, pm_message_t state) { - struct sa1100_port *sport = dev_get_drvdata(_dev); + struct sa1100_port *sport = platform_get_drvdata(dev); if (sport) uart_suspend_port(&sa1100_reg, &sport->port); @@ -844,9 +844,9 @@ static int sa1100_serial_suspend(struct device *_dev, pm_message_t state) return 0; } -static int sa1100_serial_resume(struct device *_dev) +static int sa1100_serial_resume(struct platform_device *dev) { - struct sa1100_port *sport = dev_get_drvdata(_dev); + struct sa1100_port *sport = platform_get_drvdata(dev); if (sport) uart_resume_port(&sa1100_reg, &sport->port); @@ -854,9 +854,8 @@ static int sa1100_serial_resume(struct device *_dev) return 0; } -static int sa1100_serial_probe(struct device *_dev) +static int sa1100_serial_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(_dev); struct resource *res = dev->resource; int i; @@ -869,9 +868,9 @@ static int sa1100_serial_probe(struct device *_dev) if (sa1100_ports[i].port.mapbase != res->start) continue; - sa1100_ports[i].port.dev = _dev; + sa1100_ports[i].port.dev = &dev->dev; uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port); - dev_set_drvdata(_dev, &sa1100_ports[i]); + platform_set_drvdata(dev, &sa1100_ports[i]); break; } } @@ -879,11 +878,11 @@ static int sa1100_serial_probe(struct device *_dev) return 0; } -static int sa1100_serial_remove(struct device *_dev) +static int sa1100_serial_remove(struct platform_device *pdev) { - struct sa1100_port *sport = dev_get_drvdata(_dev); + struct sa1100_port *sport = platform_get_drvdata(pdev); - dev_set_drvdata(_dev, NULL); + platform_set_drvdata(pdev, NULL); if (sport) uart_remove_one_port(&sa1100_reg, &sport->port); @@ -891,13 +890,14 @@ static int sa1100_serial_remove(struct device *_dev) return 0; } -static struct device_driver sa11x0_serial_driver = { - .name = "sa11x0-uart", - .bus = &platform_bus_type, +static struct platform_driver sa11x0_serial_driver = { .probe = sa1100_serial_probe, .remove = sa1100_serial_remove, .suspend = sa1100_serial_suspend, .resume = sa1100_serial_resume, + .driver = { + .name = "sa11x0-uart", + }, }; static int __init sa1100_serial_init(void) @@ -910,7 +910,7 @@ static int __init sa1100_serial_init(void) ret = uart_register_driver(&sa1100_reg); if (ret == 0) { - ret = driver_register(&sa11x0_serial_driver); + ret = platform_driver_register(&sa11x0_serial_driver); if (ret) uart_unregister_driver(&sa1100_reg); } @@ -919,7 +919,7 @@ static int __init sa1100_serial_init(void) static void __exit sa1100_serial_exit(void) { - driver_unregister(&sa11x0_serial_driver); + platform_driver_unregister(&sa11x0_serial_driver); uart_unregister_driver(&sa1100_reg); } |