diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-01-04 01:57:35 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-04 01:57:35 +0300 |
commit | 21500bb32acd4c34b50e5d985712e29792c1b9ad (patch) | |
tree | 5100546631aad4116835634b846979550deaf1a7 /drivers/mmc | |
parent | 63648fb5c0173614064e329503cc75c907dcb1a1 (diff) | |
download | linux-21500bb32acd4c34b50e5d985712e29792c1b9ad.tar.xz |
[MMC] wbsd: convert to the new platfrom device interface
platform_device_register_simple() is going away, switch to
using platfrom_device_alloc() + platform_device_add(). Also
make sure that wbsd_driver gets unregistered when wbsd_init
fails.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/wbsd.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 9df0ddeb3ff9..4f13bd2ccf9a 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c @@ -2087,10 +2087,20 @@ static int __init wbsd_drv_init(void) if (result < 0) return result; - wbsd_device = platform_device_register_simple(DRIVER_NAME, -1, - NULL, 0); - if (IS_ERR(wbsd_device)) - return PTR_ERR(wbsd_device); + wbsd_device = platform_device_alloc(DRIVER_NAME, -1); + if (!wbsd_device) + { + platform_driver_unregister(&wbsd_driver); + return -ENOMEM; + } + + result = platform_device_add(wbsd_device); + if (result) + { + platform_device_put(wbsd_device); + platform_driver_unregister(&wbsd_driver); + return result; + } } return 0; |