aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/jazzsonic.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/net/jazzsonic.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/net/jazzsonic.c')
-rw-r--r--drivers/net/jazzsonic.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index 2fb3101cb33e..b039bd89ceb9 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -194,7 +194,7 @@ out:
194 * Probe for a SONIC ethernet controller on a Mips Jazz board. 194 * Probe for a SONIC ethernet controller on a Mips Jazz board.
195 * Actually probing is superfluous but we're paranoid. 195 * Actually probing is superfluous but we're paranoid.
196 */ 196 */
197static int __init jazz_sonic_probe(struct device *device) 197static int __init jazz_sonic_probe(struct platform_device *pdev)
198{ 198{
199 struct net_device *dev; 199 struct net_device *dev;
200 struct sonic_local *lp; 200 struct sonic_local *lp;
@@ -212,8 +212,8 @@ static int __init jazz_sonic_probe(struct device *device)
212 return -ENOMEM; 212 return -ENOMEM;
213 213
214 lp = netdev_priv(dev); 214 lp = netdev_priv(dev);
215 lp->device = device; 215 lp->device = &pdev->dev;
216 SET_NETDEV_DEV(dev, device); 216 SET_NETDEV_DEV(dev, &pdev->dev);
217 SET_MODULE_OWNER(dev); 217 SET_MODULE_OWNER(dev);
218 218
219 netdev_boot_setup_check(dev); 219 netdev_boot_setup_check(dev);
@@ -264,9 +264,9 @@ MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
264 264
265#include "sonic.c" 265#include "sonic.c"
266 266
267static int __devexit jazz_sonic_device_remove (struct device *device) 267static int __devexit jazz_sonic_device_remove (struct platform_device *pdev)
268{ 268{
269 struct net_device *dev = device->driver_data; 269 struct net_device *dev = platform_get_drvdata(pdev);
270 struct sonic_local* lp = netdev_priv(dev); 270 struct sonic_local* lp = netdev_priv(dev);
271 271
272 unregister_netdev (dev); 272 unregister_netdev (dev);
@@ -278,18 +278,19 @@ static int __devexit jazz_sonic_device_remove (struct device *device)
278 return 0; 278 return 0;
279} 279}
280 280
281static struct device_driver jazz_sonic_driver = { 281static struct platform_driver jazz_sonic_driver = {
282 .name = jazz_sonic_string,
283 .bus = &platform_bus_type,
284 .probe = jazz_sonic_probe, 282 .probe = jazz_sonic_probe,
285 .remove = __devexit_p(jazz_sonic_device_remove), 283 .remove = __devexit_p(jazz_sonic_device_remove),
284 .driver = {
285 .name = jazz_sonic_string,
286 },
286}; 287};
287 288
288static int __init jazz_sonic_init_module(void) 289static int __init jazz_sonic_init_module(void)
289{ 290{
290 int err; 291 int err;
291 292
292 if ((err = driver_register(&jazz_sonic_driver))) { 293 if ((err = platform_driver_register(&jazz_sonic_driver))) {
293 printk(KERN_ERR "Driver registration failed\n"); 294 printk(KERN_ERR "Driver registration failed\n");
294 return err; 295 return err;
295 } 296 }
@@ -313,7 +314,7 @@ out_unregister:
313 314
314static void __exit jazz_sonic_cleanup_module(void) 315static void __exit jazz_sonic_cleanup_module(void)
315{ 316{
316 driver_unregister(&jazz_sonic_driver); 317 platform_driver_unregister(&jazz_sonic_driver);
317 318
318 if (jazz_sonic_device) { 319 if (jazz_sonic_device) {
319 platform_device_unregister(jazz_sonic_device); 320 platform_device_unregister(jazz_sonic_device);