Skip to content

Commit

Permalink
[MMC] wbsd: convert to the new platfrom device interface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Russell King committed Jan 3, 2006
1 parent 63648fb commit 21500bb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions drivers/mmc/wbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 21500bb

Please sign in to comment.