aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring/proteon.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/tokenring/proteon.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/tokenring/proteon.c')
-rw-r--r--drivers/net/tokenring/proteon.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index d04c918ebef8..4f756960db2a 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -344,9 +344,10 @@ module_param_array(dma, int, NULL, 0);
344 344
345static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; 345static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS];
346 346
347static struct device_driver proteon_driver = { 347static struct platform_driver proteon_driver = {
348 .name = "proteon", 348 .driver = {
349 .bus = &platform_bus_type, 349 .name = "proteon",
350 },
350}; 351};
351 352
352static int __init proteon_init(void) 353static int __init proteon_init(void)
@@ -355,7 +356,7 @@ static int __init proteon_init(void)
355 struct platform_device *pdev; 356 struct platform_device *pdev;
356 int i, num = 0, err = 0; 357 int i, num = 0, err = 0;
357 358
358 err = driver_register(&proteon_driver); 359 err = platform_driver_register(&proteon_driver);
359 if (err) 360 if (err)
360 return err; 361 return err;
361 362
@@ -372,7 +373,7 @@ static int __init proteon_init(void)
372 err = setup_card(dev, &pdev->dev); 373 err = setup_card(dev, &pdev->dev);
373 if (!err) { 374 if (!err) {
374 proteon_dev[i] = pdev; 375 proteon_dev[i] = pdev;
375 dev_set_drvdata(&pdev->dev, dev); 376 platform_set_drvdata(pdev, dev);
376 ++num; 377 ++num;
377 } else { 378 } else {
378 platform_device_unregister(pdev); 379 platform_device_unregister(pdev);
@@ -399,17 +400,17 @@ static void __exit proteon_cleanup(void)
399 400
400 if (!pdev) 401 if (!pdev)
401 continue; 402 continue;
402 dev = dev_get_drvdata(&pdev->dev); 403 dev = platform_get_drvdata(pdev);
403 unregister_netdev(dev); 404 unregister_netdev(dev);
404 release_region(dev->base_addr, PROTEON_IO_EXTENT); 405 release_region(dev->base_addr, PROTEON_IO_EXTENT);
405 free_irq(dev->irq, dev); 406 free_irq(dev->irq, dev);
406 free_dma(dev->dma); 407 free_dma(dev->dma);
407 tmsdev_term(dev); 408 tmsdev_term(dev);
408 free_netdev(dev); 409 free_netdev(dev);
409 dev_set_drvdata(&pdev->dev, NULL); 410 platform_set_drvdata(pdev, NULL);
410 platform_device_unregister(pdev); 411 platform_device_unregister(pdev);
411 } 412 }
412 driver_unregister(&proteon_driver); 413 platform_driver_unregister(&proteon_driver);
413} 414}
414 415
415module_init(proteon_init); 416module_init(proteon_init);