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/net/irda/sa1100_ir.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) | |
download | kernel_samsung_espresso10-3ae5eaec1d2d9c0cf53745352e7d4b152810ba24.zip kernel_samsung_espresso10-3ae5eaec1d2d9c0cf53745352e7d4b152810ba24.tar.gz kernel_samsung_espresso10-3ae5eaec1d2d9c0cf53745352e7d4b152810ba24.tar.bz2 |
[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/net/irda/sa1100_ir.c')
-rw-r--r-- | drivers/net/irda/sa1100_ir.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c index 76e0b9f..63d38fb 100644 --- a/drivers/net/irda/sa1100_ir.c +++ b/drivers/net/irda/sa1100_ir.c @@ -291,9 +291,9 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si) /* * Suspend the IrDA interface. */ -static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) +static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state) { - struct net_device *dev = dev_get_drvdata(_dev); + struct net_device *dev = platform_get_drvdata(pdev); struct sa1100_irda *si; if (!dev) @@ -316,9 +316,9 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state) /* * Resume the IrDA interface. */ -static int sa1100_irda_resume(struct device *_dev) +static int sa1100_irda_resume(struct platform_device *pdev) { - struct net_device *dev = dev_get_drvdata(_dev); + struct net_device *dev = platform_get_drvdata(pdev); struct sa1100_irda *si; if (!dev) @@ -886,9 +886,8 @@ static int sa1100_irda_init_iobuf(iobuff_t *io, int size) return io->head ? 0 : -ENOMEM; } -static int sa1100_irda_probe(struct device *_dev) +static int sa1100_irda_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(_dev); struct net_device *dev; struct sa1100_irda *si; unsigned int baudrate_mask; @@ -967,7 +966,7 @@ static int sa1100_irda_probe(struct device *_dev) err = register_netdev(dev); if (err == 0) - dev_set_drvdata(&pdev->dev, dev); + platform_set_drvdata(pdev, dev); if (err) { err_mem_5: @@ -985,9 +984,9 @@ static int sa1100_irda_probe(struct device *_dev) return err; } -static int sa1100_irda_remove(struct device *_dev) +static int sa1100_irda_remove(struct platform_device *pdev) { - struct net_device *dev = dev_get_drvdata(_dev); + struct net_device *dev = platform_get_drvdata(pdev); if (dev) { struct sa1100_irda *si = dev->priv; @@ -1004,13 +1003,14 @@ static int sa1100_irda_remove(struct device *_dev) return 0; } -static struct device_driver sa1100ir_driver = { - .name = "sa11x0-ir", - .bus = &platform_bus_type, +static struct platform_driver sa1100ir_driver = { .probe = sa1100_irda_probe, .remove = sa1100_irda_remove, .suspend = sa1100_irda_suspend, .resume = sa1100_irda_resume, + .driver = { + .name = "sa11x0-ir", + }, }; static int __init sa1100_irda_init(void) @@ -1023,12 +1023,12 @@ static int __init sa1100_irda_init(void) if (power_level > 3) power_level = 3; - return driver_register(&sa1100ir_driver); + return platform_driver_register(&sa1100ir_driver); } static void __exit sa1100_irda_exit(void) { - driver_unregister(&sa1100ir_driver); + platform_driver_unregister(&sa1100ir_driver); } module_init(sa1100_irda_init); |