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/net/tokenring | |
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/net/tokenring')
-rw-r--r-- | drivers/net/tokenring/proteon.c | 17 | ||||
-rw-r--r-- | drivers/net/tokenring/skisa.c | 17 |
2 files changed, 18 insertions, 16 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 | ||
345 | static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; | 345 | static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS]; |
346 | 346 | ||
347 | static struct device_driver proteon_driver = { | 347 | static struct platform_driver proteon_driver = { |
348 | .name = "proteon", | 348 | .driver = { |
349 | .bus = &platform_bus_type, | 349 | .name = "proteon", |
350 | }, | ||
350 | }; | 351 | }; |
351 | 352 | ||
352 | static int __init proteon_init(void) | 353 | static 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 | ||
415 | module_init(proteon_init); | 416 | module_init(proteon_init); |
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 | ||
355 | static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; | 355 | static struct platform_device *sk_isa_dev[ISATR_MAX_ADAPTERS]; |
356 | 356 | ||
357 | static struct device_driver sk_isa_driver = { | 357 | static struct platform_driver sk_isa_driver = { |
358 | .name = "skisa", | 358 | .driver = { |
359 | .bus = &platform_bus_type, | 359 | .name = "skisa", |
360 | }, | ||
360 | }; | 361 | }; |
361 | 362 | ||
362 | static int __init sk_isa_init(void) | 363 | static 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 | ||
425 | module_init(sk_isa_init); | 426 | module_init(sk_isa_init); |