aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-lh7a404.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /drivers/usb/host/ohci-lh7a404.c
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (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-lh7a404.c')
-rw-r--r--drivers/usb/host/ohci-lh7a404.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c
index 336c766c6e29..081ec3f5cff4 100644
--- a/drivers/usb/host/ohci-lh7a404.c
+++ b/drivers/usb/host/ohci-lh7a404.c
@@ -204,9 +204,8 @@ static const struct hc_driver ohci_lh7a404_hc_driver = {
204 204
205/*-------------------------------------------------------------------------*/ 205/*-------------------------------------------------------------------------*/
206 206
207static int ohci_hcd_lh7a404_drv_probe(struct device *dev) 207static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev)
208{ 208{
209 struct platform_device *pdev = to_platform_device(dev);
210 int ret; 209 int ret;
211 210
212 pr_debug ("In ohci_hcd_lh7a404_drv_probe"); 211 pr_debug ("In ohci_hcd_lh7a404_drv_probe");
@@ -218,40 +217,38 @@ static int ohci_hcd_lh7a404_drv_probe(struct device *dev)
218 return ret; 217 return ret;
219} 218}
220 219
221static int ohci_hcd_lh7a404_drv_remove(struct device *dev) 220static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev)
222{ 221{
223 struct platform_device *pdev = to_platform_device(dev); 222 struct usb_hcd *hcd = platform_get_drvdata(dev);
224 struct usb_hcd *hcd = dev_get_drvdata(dev);
225 223
226 usb_hcd_lh7a404_remove(hcd, pdev); 224 usb_hcd_lh7a404_remove(hcd, pdev);
227 return 0; 225 return 0;
228} 226}
229 /*TBD*/ 227 /*TBD*/
230/*static int ohci_hcd_lh7a404_drv_suspend(struct device *dev) 228/*static int ohci_hcd_lh7a404_drv_suspend(struct platform_device *dev)
231{ 229{
232 struct platform_device *pdev = to_platform_device(dev); 230 struct usb_hcd *hcd = platform_get_drvdata(dev);
233 struct usb_hcd *hcd = dev_get_drvdata(dev);
234 231
235 return 0; 232 return 0;
236} 233}
237static int ohci_hcd_lh7a404_drv_resume(struct device *dev) 234static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev)
238{ 235{
239 struct platform_device *pdev = to_platform_device(dev); 236 struct usb_hcd *hcd = platform_get_drvdata(dev);
240 struct usb_hcd *hcd = dev_get_drvdata(dev);
241 237
242 238
243 return 0; 239 return 0;
244} 240}
245*/ 241*/
246 242
247static struct device_driver ohci_hcd_lh7a404_driver = { 243static struct platform_driver ohci_hcd_lh7a404_driver = {
248 .name = "lh7a404-ohci",
249 .owner = THIS_MODULE,
250 .bus = &platform_bus_type,
251 .probe = ohci_hcd_lh7a404_drv_probe, 244 .probe = ohci_hcd_lh7a404_drv_probe,
252 .remove = ohci_hcd_lh7a404_drv_remove, 245 .remove = ohci_hcd_lh7a404_drv_remove,
253 /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ 246 /*.suspend = ohci_hcd_lh7a404_drv_suspend, */
254 /*.resume = ohci_hcd_lh7a404_drv_resume, */ 247 /*.resume = ohci_hcd_lh7a404_drv_resume, */
248 .driver = {
249 .name = "lh7a404-ohci",
250 .owner = THIS_MODULE,
251 },
255}; 252};
256 253
257static int __init ohci_hcd_lh7a404_init (void) 254static int __init ohci_hcd_lh7a404_init (void)
@@ -260,12 +257,12 @@ static int __init ohci_hcd_lh7a404_init (void)
260 pr_debug ("block sizes: ed %d td %d\n", 257 pr_debug ("block sizes: ed %d td %d\n",
261 sizeof (struct ed), sizeof (struct td)); 258 sizeof (struct ed), sizeof (struct td));
262 259
263 return driver_register(&ohci_hcd_lh7a404_driver); 260 return platform_driver_register(&ohci_hcd_lh7a404_driver);
264} 261}
265 262
266static void __exit ohci_hcd_lh7a404_cleanup (void) 263static void __exit ohci_hcd_lh7a404_cleanup (void)
267{ 264{
268 driver_unregister(&ohci_hcd_lh7a404_driver); 265 platform_driver_unregister(&ohci_hcd_lh7a404_driver);
269} 266}
270 267
271module_init (ohci_hcd_lh7a404_init); 268module_init (ohci_hcd_lh7a404_init);