diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/mtd/maps/ixp4xx.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/mtd/maps/ixp4xx.c')
-rw-r--r-- | drivers/mtd/maps/ixp4xx.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c index 56b3a355bf7b..a59f8027903c 100644 --- a/drivers/mtd/maps/ixp4xx.c +++ b/drivers/mtd/maps/ixp4xx.c @@ -99,13 +99,12 @@ struct ixp4xx_flash_info { static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; -static int ixp4xx_flash_remove(struct device *_dev) +static int ixp4xx_flash_remove(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(_dev); struct flash_platform_data *plat = dev->dev.platform_data; - struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev); + struct ixp4xx_flash_info *info = platform_get_drvdata(dev); - dev_set_drvdata(&dev->dev, NULL); + platform_set_drvdata(dev, NULL); if(!info) return 0; @@ -130,9 +129,8 @@ static int ixp4xx_flash_remove(struct device *_dev) return 0; } -static int ixp4xx_flash_probe(struct device *_dev) +static int ixp4xx_flash_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(_dev); struct flash_platform_data *plat = dev->dev.platform_data; struct ixp4xx_flash_info *info; int err = -1; @@ -153,7 +151,7 @@ static int ixp4xx_flash_probe(struct device *_dev) } memzero(info, sizeof(struct ixp4xx_flash_info)); - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); /* * Tell the MTD layer we're not 1:1 mapped so that it does @@ -214,25 +212,26 @@ static int ixp4xx_flash_probe(struct device *_dev) return 0; Error: - ixp4xx_flash_remove(_dev); + ixp4xx_flash_remove(dev); return err; } -static struct device_driver ixp4xx_flash_driver = { - .name = "IXP4XX-Flash", - .bus = &platform_bus_type, +static struct platform_driver ixp4xx_flash_driver = { .probe = ixp4xx_flash_probe, .remove = ixp4xx_flash_remove, + .driver = { + .name = "IXP4XX-Flash", + }, }; static int __init ixp4xx_flash_init(void) { - return driver_register(&ixp4xx_flash_driver); + return platform_driver_register(&ixp4xx_flash_driver); } static void __exit ixp4xx_flash_exit(void) { - driver_unregister(&ixp4xx_flash_driver); + platform_driver_unregister(&ixp4xx_flash_driver); } |