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/depca.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/net/depca.c')
-rw-r--r-- | drivers/net/depca.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 0d33a93df96b..03804cc38be0 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -398,13 +398,19 @@ static struct mca_driver depca_mca_driver = { | |||
398 | }; | 398 | }; |
399 | #endif | 399 | #endif |
400 | 400 | ||
401 | static int depca_isa_probe (struct device *); | 401 | static int depca_isa_probe (struct platform_device *); |
402 | 402 | ||
403 | static struct device_driver depca_isa_driver = { | 403 | static int __devexit depca_isa_remove(struct platform_device *pdev) |
404 | .name = depca_string, | 404 | { |
405 | .bus = &platform_bus_type, | 405 | return depca_device_remove(&pdev->dev); |
406 | } | ||
407 | |||
408 | static struct platform_driver depca_isa_driver = { | ||
406 | .probe = depca_isa_probe, | 409 | .probe = depca_isa_probe, |
407 | .remove = __devexit_p(depca_device_remove), | 410 | .remove = __devexit_p(depca_isa_remove), |
411 | .driver = { | ||
412 | .name = depca_string, | ||
413 | }, | ||
408 | }; | 414 | }; |
409 | 415 | ||
410 | /* | 416 | /* |
@@ -1525,7 +1531,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start) | |||
1525 | return adapter; | 1531 | return adapter; |
1526 | } | 1532 | } |
1527 | 1533 | ||
1528 | static int __init depca_isa_probe (struct device *device) | 1534 | static int __init depca_isa_probe (struct platform_device *device) |
1529 | { | 1535 | { |
1530 | struct net_device *dev; | 1536 | struct net_device *dev; |
1531 | struct depca_private *lp; | 1537 | struct depca_private *lp; |
@@ -1533,7 +1539,7 @@ static int __init depca_isa_probe (struct device *device) | |||
1533 | enum depca_type adapter = unknown; | 1539 | enum depca_type adapter = unknown; |
1534 | int status = 0; | 1540 | int status = 0; |
1535 | 1541 | ||
1536 | ioaddr = (u_long) device->platform_data; | 1542 | ioaddr = (u_long) device->dev.platform_data; |
1537 | 1543 | ||
1538 | if ((status = depca_common_init (ioaddr, &dev))) | 1544 | if ((status = depca_common_init (ioaddr, &dev))) |
1539 | goto out; | 1545 | goto out; |
@@ -1553,7 +1559,7 @@ static int __init depca_isa_probe (struct device *device) | |||
1553 | lp->adapter = adapter; | 1559 | lp->adapter = adapter; |
1554 | lp->mem_start = mem_start; | 1560 | lp->mem_start = mem_start; |
1555 | 1561 | ||
1556 | if ((status = depca_hw_init(dev, device))) | 1562 | if ((status = depca_hw_init(dev, &device->dev))) |
1557 | goto out_free; | 1563 | goto out_free; |
1558 | 1564 | ||
1559 | return 0; | 1565 | return 0; |
@@ -2082,7 +2088,7 @@ static int __init depca_module_init (void) | |||
2082 | #ifdef CONFIG_EISA | 2088 | #ifdef CONFIG_EISA |
2083 | err |= eisa_driver_register (&depca_eisa_driver); | 2089 | err |= eisa_driver_register (&depca_eisa_driver); |
2084 | #endif | 2090 | #endif |
2085 | err |= driver_register (&depca_isa_driver); | 2091 | err |= platform_driver_register (&depca_isa_driver); |
2086 | depca_platform_probe (); | 2092 | depca_platform_probe (); |
2087 | 2093 | ||
2088 | return err; | 2094 | return err; |
@@ -2097,7 +2103,7 @@ static void __exit depca_module_exit (void) | |||
2097 | #ifdef CONFIG_EISA | 2103 | #ifdef CONFIG_EISA |
2098 | eisa_driver_unregister (&depca_eisa_driver); | 2104 | eisa_driver_unregister (&depca_eisa_driver); |
2099 | #endif | 2105 | #endif |
2100 | driver_unregister (&depca_isa_driver); | 2106 | platform_driver_unregister (&depca_isa_driver); |
2101 | 2107 | ||
2102 | for (i = 0; depca_io_ports[i].iobase; i++) { | 2108 | for (i = 0; depca_io_ports[i].iobase; i++) { |
2103 | if (depca_io_ports[i].device) { | 2109 | if (depca_io_ports[i].device) { |