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/mmc/wbsd.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/mmc/wbsd.c')
-rw-r--r-- | drivers/mmc/wbsd.c | 27 |
1 files changed, 14 insertions, 13 deletions
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) | |||
1932 | * Non-PnP | 1932 | * Non-PnP |
1933 | */ | 1933 | */ |
1934 | 1934 | ||
1935 | static int __devinit wbsd_probe(struct device* dev) | 1935 | static int __devinit wbsd_probe(struct platform_device* dev) |
1936 | { | 1936 | { |
1937 | return wbsd_init(dev, io, irq, dma, 0); | 1937 | return wbsd_init(&dev->dev, io, irq, dma, 0); |
1938 | } | 1938 | } |
1939 | 1939 | ||
1940 | static int __devexit wbsd_remove(struct device* dev) | 1940 | static int __devexit wbsd_remove(struct platform_device* dev) |
1941 | { | 1941 | { |
1942 | wbsd_shutdown(dev, 0); | 1942 | wbsd_shutdown(&dev->dev, 0); |
1943 | 1943 | ||
1944 | return 0; | 1944 | return 0; |
1945 | } | 1945 | } |
@@ -1983,9 +1983,9 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev) | |||
1983 | 1983 | ||
1984 | #ifdef CONFIG_PM | 1984 | #ifdef CONFIG_PM |
1985 | 1985 | ||
1986 | static int wbsd_suspend(struct device *dev, pm_message_t state) | 1986 | static int wbsd_suspend(struct platform_device *dev, pm_message_t state) |
1987 | { | 1987 | { |
1988 | struct mmc_host *mmc = dev_get_drvdata(dev); | 1988 | struct mmc_host *mmc = platform_get_drvdata(dev); |
1989 | struct wbsd_host *host; | 1989 | struct wbsd_host *host; |
1990 | int ret; | 1990 | int ret; |
1991 | 1991 | ||
@@ -2005,9 +2005,9 @@ static int wbsd_suspend(struct device *dev, pm_message_t state) | |||
2005 | return 0; | 2005 | return 0; |
2006 | } | 2006 | } |
2007 | 2007 | ||
2008 | static int wbsd_resume(struct device *dev) | 2008 | static int wbsd_resume(struct platform_device *dev) |
2009 | { | 2009 | { |
2010 | struct mmc_host *mmc = dev_get_drvdata(dev); | 2010 | struct mmc_host *mmc = platform_get_drvdata(dev); |
2011 | struct wbsd_host *host; | 2011 | struct wbsd_host *host; |
2012 | 2012 | ||
2013 | if (!mmc) | 2013 | if (!mmc) |
@@ -2038,14 +2038,15 @@ static int wbsd_resume(struct device *dev) | |||
2038 | 2038 | ||
2039 | static struct platform_device *wbsd_device; | 2039 | static struct platform_device *wbsd_device; |
2040 | 2040 | ||
2041 | static struct device_driver wbsd_driver = { | 2041 | static struct platform_driver wbsd_driver = { |
2042 | .name = DRIVER_NAME, | ||
2043 | .bus = &platform_bus_type, | ||
2044 | .probe = wbsd_probe, | 2042 | .probe = wbsd_probe, |
2045 | .remove = wbsd_remove, | 2043 | .remove = wbsd_remove, |
2046 | 2044 | ||
2047 | .suspend = wbsd_suspend, | 2045 | .suspend = wbsd_suspend, |
2048 | .resume = wbsd_resume, | 2046 | .resume = wbsd_resume, |
2047 | .driver = { | ||
2048 | .name = DRIVER_NAME, | ||
2049 | }, | ||
2049 | }; | 2050 | }; |
2050 | 2051 | ||
2051 | #ifdef CONFIG_PNP | 2052 | #ifdef CONFIG_PNP |
@@ -2085,7 +2086,7 @@ static int __init wbsd_drv_init(void) | |||
2085 | 2086 | ||
2086 | if (nopnp) | 2087 | if (nopnp) |
2087 | { | 2088 | { |
2088 | result = driver_register(&wbsd_driver); | 2089 | result = platform_driver_register(&wbsd_driver); |
2089 | if (result < 0) | 2090 | if (result < 0) |
2090 | return result; | 2091 | return result; |
2091 | 2092 | ||
@@ -2111,7 +2112,7 @@ static void __exit wbsd_drv_exit(void) | |||
2111 | { | 2112 | { |
2112 | platform_device_unregister(wbsd_device); | 2113 | platform_device_unregister(wbsd_device); |
2113 | 2114 | ||
2114 | driver_unregister(&wbsd_driver); | 2115 | platform_driver_unregister(&wbsd_driver); |
2115 | } | 2116 | } |
2116 | 2117 | ||
2117 | DBG("unloaded\n"); | 2118 | DBG("unloaded\n"); |