提交 21500bb3 编写于 作者: D Dmitry Torokhov 提交者: Russell King

[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: NDmitry Torokhov <dtor@mail.ru>
Acked-by: NPierre Ossman <drzeus@drzeus.cx>
上级 63648fb5
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册