Skip to content

Commit

Permalink
usb: phy: phy-generic: fix return value check in usb_nop_xceiv_regist…
Browse files Browse the repository at this point in the history
…er()

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>
  • Loading branch information
Wei Yongjun authored and Felipe Balbi committed Nov 25, 2013
1 parent a535d81 commit e8d68f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/phy/phy-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit e8d68f8

Please sign in to comment.