From 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 9 Nov 2005 22:32:44 +0000 Subject: [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 Acked-by: Greg Kroah-Hartman --- drivers/mmc/wbsd.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'drivers/mmc/wbsd.c') diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index e954b8354fef..ea23a31fac90 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -1932,14 +1932,14 @@ static void __devexit wbsd_shutdown(struct device* dev, int pnp) * Non-PnP */ -static int __devinit wbsd_probe(struct device* dev) +static int __devinit wbsd_probe(struct platform_device* dev) { - return wbsd_init(dev, io, irq, dma, 0); + return wbsd_init(&dev->dev, io, irq, dma, 0); } -static int __devexit wbsd_remove(struct device* dev) +static int __devexit wbsd_remove(struct platform_device* dev) { - wbsd_shutdown(dev, 0); + wbsd_shutdown(&dev->dev, 0); return 0; } @@ -1983,9 +1983,9 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev) #ifdef CONFIG_PM -static int wbsd_suspend(struct device *dev, pm_message_t state) +static int wbsd_suspend(struct platform_device *dev, pm_message_t state) { - struct mmc_host *mmc = dev_get_drvdata(dev); + struct mmc_host *mmc = platform_get_drvdata(dev); struct wbsd_host *host; int ret; @@ -2005,9 +2005,9 @@ static int wbsd_suspend(struct device *dev, pm_message_t state) return 0; } -static int wbsd_resume(struct device *dev) +static int wbsd_resume(struct platform_device *dev) { - struct mmc_host *mmc = dev_get_drvdata(dev); + struct mmc_host *mmc = platform_get_drvdata(dev); struct wbsd_host *host; if (!mmc) @@ -2038,14 +2038,15 @@ static int wbsd_resume(struct device *dev) static struct platform_device *wbsd_device; -static struct device_driver wbsd_driver = { - .name = DRIVER_NAME, - .bus = &platform_bus_type, +static struct platform_driver wbsd_driver = { .probe = wbsd_probe, .remove = wbsd_remove, .suspend = wbsd_suspend, .resume = wbsd_resume, + .driver = { + .name = DRIVER_NAME, + }, }; #ifdef CONFIG_PNP @@ -2085,7 +2086,7 @@ static int __init wbsd_drv_init(void) if (nopnp) { - result = driver_register(&wbsd_driver); + result = platform_driver_register(&wbsd_driver); if (result < 0) return result; @@ -2111,7 +2112,7 @@ static void __exit wbsd_drv_exit(void) { platform_device_unregister(wbsd_device); - driver_unregister(&wbsd_driver); + platform_driver_unregister(&wbsd_driver); } DBG("unloaded\n"); -- cgit v1.2.2 From 93968d7551f1ff1806f70cdacf1bd997ef30836e Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 9 Nov 2005 23:21:06 +0000 Subject: [MMC] Use __devexit_p in wbsd wbsd_*_remove() is declared as __devexit but __devexit_p isn't used when taking their addresses. Signed-off-by: Pierre Ossman Signed-off-by: Russell King --- drivers/mmc/wbsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mmc/wbsd.c') diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index e954b8354fef..46a084a529ca 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -2042,7 +2042,7 @@ static struct device_driver wbsd_driver = { .name = DRIVER_NAME, .bus = &platform_bus_type, .probe = wbsd_probe, - .remove = wbsd_remove, + .remove = __devexit_p(wbsd_remove), .suspend = wbsd_suspend, .resume = wbsd_resume, @@ -2054,7 +2054,7 @@ static struct pnp_driver wbsd_pnp_driver = { .name = DRIVER_NAME, .id_table = pnp_dev_table, .probe = wbsd_pnp_probe, - .remove = wbsd_pnp_remove, + .remove = __devexit_p(wbsd_pnp_remove), }; #endif /* CONFIG_PNP */ -- cgit v1.2.2 From de1d09e3e2ac576ee1e257b7d141c3cae4ce5fa9 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 9 Nov 2005 23:21:49 +0000 Subject: [MMC] Add MODULE_AUTHOR to wbsd 'cause I'm in it for the chicks. ;) Signed-off-by: Pierre Ossman Signed-off-by: Russell King --- drivers/mmc/wbsd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mmc/wbsd.c') diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 46a084a529ca..9d055812c723 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -2127,6 +2127,7 @@ module_param(irq, uint, 0444); module_param(dma, int, 0444); MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Pierre Ossman "); MODULE_DESCRIPTION("Winbond W83L51xD SD/MMC card interface driver"); MODULE_VERSION(DRIVER_VERSION); -- cgit v1.2.2 From 402771c786b71765c39d9a91f31b8c7b91faaa0a Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 9 Nov 2005 23:22:27 +0000 Subject: [MMC] wbsd version 1.5 New kernel, new patches, new version. Signed-off-by: Pierre Ossman Signed-off-by: Russell King --- drivers/mmc/wbsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mmc/wbsd.c') diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 9d055812c723..6166ceb95717 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -42,7 +42,7 @@ #include "wbsd.h" #define DRIVER_NAME "wbsd" -#define DRIVER_VERSION "1.4" +#define DRIVER_VERSION "1.5" #ifdef CONFIG_MMC_DEBUG #define DBG(x...) \ -- cgit v1.2.2