diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/usb/host/ohci-au1xxx.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/usb/host/ohci-au1xxx.c')
-rw-r--r-- | drivers/usb/host/ohci-au1xxx.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index f0c78cf14b6c..d9cf3b327d96 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -225,9 +225,8 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
225 | 225 | ||
226 | /*-------------------------------------------------------------------------*/ | 226 | /*-------------------------------------------------------------------------*/ |
227 | 227 | ||
228 | static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | 228 | static int ohci_hcd_au1xxx_drv_probe(struct platform_device *pdev) |
229 | { | 229 | { |
230 | struct platform_device *pdev = to_platform_device(dev); | ||
231 | int ret; | 230 | int ret; |
232 | 231 | ||
233 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); | 232 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); |
@@ -239,39 +238,37 @@ static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | |||
239 | return ret; | 238 | return ret; |
240 | } | 239 | } |
241 | 240 | ||
242 | static int ohci_hcd_au1xxx_drv_remove(struct device *dev) | 241 | static int ohci_hcd_au1xxx_drv_remove(struct platform_device *pdev) |
243 | { | 242 | { |
244 | struct platform_device *pdev = to_platform_device(dev); | 243 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
245 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
246 | 244 | ||
247 | usb_hcd_au1xxx_remove(hcd, pdev); | 245 | usb_hcd_au1xxx_remove(hcd, pdev); |
248 | return 0; | 246 | return 0; |
249 | } | 247 | } |
250 | /*TBD*/ | 248 | /*TBD*/ |
251 | /*static int ohci_hcd_au1xxx_drv_suspend(struct device *dev) | 249 | /*static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *dev) |
252 | { | 250 | { |
253 | struct platform_device *pdev = to_platform_device(dev); | 251 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
254 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
255 | 252 | ||
256 | return 0; | 253 | return 0; |
257 | } | 254 | } |
258 | static int ohci_hcd_au1xxx_drv_resume(struct device *dev) | 255 | static int ohci_hcd_au1xxx_drv_resume(struct platform_device *dev) |
259 | { | 256 | { |
260 | struct platform_device *pdev = to_platform_device(dev); | 257 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
261 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
262 | 258 | ||
263 | return 0; | 259 | return 0; |
264 | } | 260 | } |
265 | */ | 261 | */ |
266 | 262 | ||
267 | static struct device_driver ohci_hcd_au1xxx_driver = { | 263 | static struct platform_driver ohci_hcd_au1xxx_driver = { |
268 | .name = "au1xxx-ohci", | ||
269 | .owner = THIS_MODULE, | ||
270 | .bus = &platform_bus_type, | ||
271 | .probe = ohci_hcd_au1xxx_drv_probe, | 264 | .probe = ohci_hcd_au1xxx_drv_probe, |
272 | .remove = ohci_hcd_au1xxx_drv_remove, | 265 | .remove = ohci_hcd_au1xxx_drv_remove, |
273 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ | 266 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ |
274 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ | 267 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ |
268 | .driver = { | ||
269 | .name = "au1xxx-ohci", | ||
270 | .owner = THIS_MODULE, | ||
271 | }, | ||
275 | }; | 272 | }; |
276 | 273 | ||
277 | static int __init ohci_hcd_au1xxx_init (void) | 274 | static int __init ohci_hcd_au1xxx_init (void) |
@@ -280,12 +277,12 @@ static int __init ohci_hcd_au1xxx_init (void) | |||
280 | pr_debug ("block sizes: ed %d td %d\n", | 277 | pr_debug ("block sizes: ed %d td %d\n", |
281 | sizeof (struct ed), sizeof (struct td)); | 278 | sizeof (struct ed), sizeof (struct td)); |
282 | 279 | ||
283 | return driver_register(&ohci_hcd_au1xxx_driver); | 280 | return platform_driver_register(&ohci_hcd_au1xxx_driver); |
284 | } | 281 | } |
285 | 282 | ||
286 | static void __exit ohci_hcd_au1xxx_cleanup (void) | 283 | static void __exit ohci_hcd_au1xxx_cleanup (void) |
287 | { | 284 | { |
288 | driver_unregister(&ohci_hcd_au1xxx_driver); | 285 | platform_driver_unregister(&ohci_hcd_au1xxx_driver); |
289 | } | 286 | } |
290 | 287 | ||
291 | module_init (ohci_hcd_au1xxx_init); | 288 | module_init (ohci_hcd_au1xxx_init); |