aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring/skisa.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/skisa.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/skisa.c')
-rw-r--r--drivers/net/tokenring/skisa.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index 72cf708396be..d6ba41cf3110 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -354,9 +354,10 @@ module_param_array(dma, int, NULL, 0);
354 354
355static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; 355static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS];
356 356
357static struct device_driver sk_isa_driver = { 357static struct platform_driver sk_isa_driver = {
358 .name = "skisa", 358 .driver = {
359 .bus = &platform_bus_type, 359 .name = "skisa",
360 },
360}; 361};
361 362
362static int __init sk_isa_init(void) 363static int __init sk_isa_init(void)
@@ -365,7 +366,7 @@ static int __init sk_isa_init(void)
365 struct platform_device *pdev; 366 struct platform_device *pdev;
366 int i, num = 0, err = 0; 367 int i, num = 0, err = 0;
367 368
368 err = driver_register(&sk_isa_driver); 369 err = platform_driver_register(&sk_isa_driver);
369 if (err) 370 if (err)
370 return err; 371 return err;
371 372
@@ -382,7 +383,7 @@ static int __init sk_isa_init(void)
382 err = setup_card(dev, &pdev->dev); 383 err = setup_card(dev, &pdev->dev);
383 if (!err) { 384 if (!err) {
384 sk_isa_dev[i] = pdev; 385 sk_isa_dev[i] = pdev;
385 dev_set_drvdata(&sk_isa_dev[i]->dev, dev); 386 platform_set_drvdata(sk_isa_dev[i], dev);
386 ++num; 387 ++num;
387 } else { 388 } else {
388 platform_device_unregister(pdev); 389 platform_device_unregister(pdev);
@@ -409,17 +410,17 @@ static void __exit sk_isa_cleanup(void)
409 410
410 if (!pdev) 411 if (!pdev)
411 continue; 412 continue;
412 dev = dev_get_drvdata(&pdev->dev); 413 dev = platform_get_drvdata(pdev);
413 unregister_netdev(dev); 414 unregister_netdev(dev);
414 release_region(dev->base_addr, SK_ISA_IO_EXTENT); 415 release_region(dev->base_addr, SK_ISA_IO_EXTENT);
415 free_irq(dev->irq, dev); 416 free_irq(dev->irq, dev);
416 free_dma(dev->dma); 417 free_dma(dev->dma);
417 tmsdev_term(dev); 418 tmsdev_term(dev);
418 free_netdev(dev); 419 free_netdev(dev);
419 dev_set_drvdata(&pdev->dev, NULL); 420 platform_set_drvdata(pdev, NULL);
420 platform_device_unregister(pdev); 421 platform_device_unregister(pdev);
421 } 422 }
422 driver_unregister(&sk_isa_driver); 423 platform_driver_unregister(&sk_isa_driver);
423} 424}
424 425
425module_init(sk_isa_init); 426module_init(sk_isa_init);