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-lh7a404.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-lh7a404.c')
-rw-r--r-- | drivers/usb/host/ohci-lh7a404.c | 31 |
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 | ||
207 | static int ohci_hcd_lh7a404_drv_probe(struct device *dev) | 207 | static 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 | ||
221 | static int ohci_hcd_lh7a404_drv_remove(struct device *dev) | 220 | static 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 | } |
237 | static int ohci_hcd_lh7a404_drv_resume(struct device *dev) | 234 | static 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 | ||
247 | static struct device_driver ohci_hcd_lh7a404_driver = { | 243 | static 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 | ||
257 | static int __init ohci_hcd_lh7a404_init (void) | 254 | static 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 | ||
266 | static void __exit ohci_hcd_lh7a404_cleanup (void) | 263 | static 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 | ||
271 | module_init (ohci_hcd_lh7a404_init); | 268 | module_init (ohci_hcd_lh7a404_init); |