]> Pileus Git - ~andy/linux/commitdiff
usb: phy: phy-generic: fix return value check in usb_nop_xceiv_register()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 25 Oct 2013 09:31:14 +0000 (17:31 +0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 25 Nov 2013 16:56:48 +0000 (10:56 -0600)
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>
drivers/usb/phy/phy-generic.c

index 2d135b09c05125ce5918521bae245575f0b8afb2..aa6d37b3378ad65ff26e336031173a9ae52d2287 100644 (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;
        }
 }