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/i2c/chips | |
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/i2c/chips')
-rw-r--r-- | drivers/i2c/chips/isp1301_omap.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index 9dbb72fffbe2..d2a100d77839 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c @@ -873,26 +873,27 @@ static int otg_init(struct isp1301 *isp) return 0; } -static int otg_probe(struct device *dev) +static int otg_probe(struct platform_device *dev) { // struct omap_usb_config *config = dev->platform_data; - otg_dev = to_platform_device(dev); + otg_dev = dev; return 0; } -static int otg_remove(struct device *dev) +static int otg_remove(struct platform_device *dev) { otg_dev = 0; return 0; } -struct device_driver omap_otg_driver = { - .owner = THIS_MODULE, - .name = "omap_otg", - .bus = &platform_bus_type, +struct platform_driver omap_otg_driver = { .probe = otg_probe, - .remove = otg_remove, + .remove = otg_remove, + .driver = { + .owner = THIS_MODULE, + .name = "omap_otg", + }, }; static int otg_bind(struct isp1301 *isp) @@ -902,7 +903,7 @@ static int otg_bind(struct isp1301 *isp) if (otg_dev) return -EBUSY; - status = driver_register(&omap_otg_driver); + status = platform_driver_register(&omap_otg_driver); if (status < 0) return status; @@ -913,7 +914,7 @@ static int otg_bind(struct isp1301 *isp) status = -ENODEV; if (status < 0) - driver_unregister(&omap_otg_driver); + platform_driver_unregister(&omap_otg_driver); return status; } |