From: Wei Yongjun Date: Fri, 25 Oct 2013 09:31:14 +0000 (+0800) Subject: usb: phy: phy-generic: fix return value check in usb_nop_xceiv_register() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e8d68f88bcb4e336b308a05d1389e999f0b0c4b0;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c index 2d135b09c051..aa6d37b3378a 100644 --- a/drivers/usb/phy/phy-generic.c +++ b/drivers/usb/phy/phy-generic.c @@ -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; } }