[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>
This commit is contained in:

committed by
Russell King

parent
00d3dcdd96
commit
3ae5eaec1d
@@ -398,13 +398,19 @@ static struct mca_driver depca_mca_driver = {
|
||||
};
|
||||
#endif
|
||||
|
||||
static int depca_isa_probe (struct device *);
|
||||
static int depca_isa_probe (struct platform_device *);
|
||||
|
||||
static struct device_driver depca_isa_driver = {
|
||||
.name = depca_string,
|
||||
.bus = &platform_bus_type,
|
||||
static int __devexit depca_isa_remove(struct platform_device *pdev)
|
||||
{
|
||||
return depca_device_remove(&pdev->dev);
|
||||
}
|
||||
|
||||
static struct platform_driver depca_isa_driver = {
|
||||
.probe = depca_isa_probe,
|
||||
.remove = __devexit_p(depca_device_remove),
|
||||
.remove = __devexit_p(depca_isa_remove),
|
||||
.driver = {
|
||||
.name = depca_string,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1525,7 +1531,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start)
|
||||
return adapter;
|
||||
}
|
||||
|
||||
static int __init depca_isa_probe (struct device *device)
|
||||
static int __init depca_isa_probe (struct platform_device *device)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct depca_private *lp;
|
||||
@@ -1533,7 +1539,7 @@ static int __init depca_isa_probe (struct device *device)
|
||||
enum depca_type adapter = unknown;
|
||||
int status = 0;
|
||||
|
||||
ioaddr = (u_long) device->platform_data;
|
||||
ioaddr = (u_long) device->dev.platform_data;
|
||||
|
||||
if ((status = depca_common_init (ioaddr, &dev)))
|
||||
goto out;
|
||||
@@ -1553,7 +1559,7 @@ static int __init depca_isa_probe (struct device *device)
|
||||
lp->adapter = adapter;
|
||||
lp->mem_start = mem_start;
|
||||
|
||||
if ((status = depca_hw_init(dev, device)))
|
||||
if ((status = depca_hw_init(dev, &device->dev)))
|
||||
goto out_free;
|
||||
|
||||
return 0;
|
||||
@@ -2082,7 +2088,7 @@ static int __init depca_module_init (void)
|
||||
#ifdef CONFIG_EISA
|
||||
err |= eisa_driver_register (&depca_eisa_driver);
|
||||
#endif
|
||||
err |= driver_register (&depca_isa_driver);
|
||||
err |= platform_driver_register (&depca_isa_driver);
|
||||
depca_platform_probe ();
|
||||
|
||||
return err;
|
||||
@@ -2097,7 +2103,7 @@ static void __exit depca_module_exit (void)
|
||||
#ifdef CONFIG_EISA
|
||||
eisa_driver_unregister (&depca_eisa_driver);
|
||||
#endif
|
||||
driver_unregister (&depca_isa_driver);
|
||||
platform_driver_unregister (&depca_isa_driver);
|
||||
|
||||
for (i = 0; depca_io_ports[i].iobase; i++) {
|
||||
if (depca_io_ports[i].device) {
|
||||
|
Reference in New Issue
Block a user