usb: phy: phy-generic: fix return value check in usb_nop_xceiv_register()

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Wei Yongjun 2013-10-25 17:31:14 +08:00 committed by Felipe Balbi
parent a535d81c92
commit e8d68f88bc
1 changed files with 2 additions and 1 deletions

View File

@ -48,8 +48,9 @@ void usb_nop_xceiv_register(void)
if (pd)
return;
pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0);
if (!pd) {
if (IS_ERR(pd)) {
pr_err("Unable to register generic usb transceiver\n");
pd = NULL;
return;
}
}