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-ppc-soc.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-ppc-soc.c')
-rw-r--r-- | drivers/usb/host/ohci-ppc-soc.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index 92cf6f4a1374..18755766e406 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
@@ -172,9 +172,8 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
172 | .start_port_reset = ohci_start_port_reset, | 172 | .start_port_reset = ohci_start_port_reset, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | 175 | static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) |
176 | { | 176 | { |
177 | struct platform_device *pdev = to_platform_device(dev); | ||
178 | int ret; | 177 | int ret; |
179 | 178 | ||
180 | if (usb_disabled()) | 179 | if (usb_disabled()) |
@@ -184,25 +183,25 @@ static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | |||
184 | return ret; | 183 | return ret; |
185 | } | 184 | } |
186 | 185 | ||
187 | static int ohci_hcd_ppc_soc_drv_remove(struct device *dev) | 186 | static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev) |
188 | { | 187 | { |
189 | struct platform_device *pdev = to_platform_device(dev); | 188 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
190 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
191 | 189 | ||
192 | usb_hcd_ppc_soc_remove(hcd, pdev); | 190 | usb_hcd_ppc_soc_remove(hcd, pdev); |
193 | return 0; | 191 | return 0; |
194 | } | 192 | } |
195 | 193 | ||
196 | static struct device_driver ohci_hcd_ppc_soc_driver = { | 194 | static struct platform_driver ohci_hcd_ppc_soc_driver = { |
197 | .name = "ppc-soc-ohci", | ||
198 | .owner = THIS_MODULE, | ||
199 | .bus = &platform_bus_type, | ||
200 | .probe = ohci_hcd_ppc_soc_drv_probe, | 195 | .probe = ohci_hcd_ppc_soc_drv_probe, |
201 | .remove = ohci_hcd_ppc_soc_drv_remove, | 196 | .remove = ohci_hcd_ppc_soc_drv_remove, |
202 | #ifdef CONFIG_PM | 197 | #ifdef CONFIG_PM |
203 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ | 198 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ |
204 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ | 199 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ |
205 | #endif | 200 | #endif |
201 | .driver = { | ||
202 | .name = "ppc-soc-ohci", | ||
203 | .owner = THIS_MODULE, | ||
204 | }, | ||
206 | }; | 205 | }; |
207 | 206 | ||
208 | static int __init ohci_hcd_ppc_soc_init(void) | 207 | static int __init ohci_hcd_ppc_soc_init(void) |
@@ -211,12 +210,12 @@ static int __init ohci_hcd_ppc_soc_init(void) | |||
211 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), | 210 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), |
212 | sizeof(struct td)); | 211 | sizeof(struct td)); |
213 | 212 | ||
214 | return driver_register(&ohci_hcd_ppc_soc_driver); | 213 | return platform_driver_register(&ohci_hcd_ppc_soc_driver); |
215 | } | 214 | } |
216 | 215 | ||
217 | static void __exit ohci_hcd_ppc_soc_cleanup(void) | 216 | static void __exit ohci_hcd_ppc_soc_cleanup(void) |
218 | { | 217 | { |
219 | driver_unregister(&ohci_hcd_ppc_soc_driver); | 218 | platform_driver_unregister(&ohci_hcd_ppc_soc_driver); |
220 | } | 219 | } |
221 | 220 | ||
222 | module_init(ohci_hcd_ppc_soc_init); | 221 | module_init(ohci_hcd_ppc_soc_init); |