usb: otg: Remove the unneeded NULL check
authorShubhrajyoti D <shubhrajyoti@ti.com>
Tue, 7 Aug 2012 14:26:30 +0000 (19:56 +0530)
committerFelipe Balbi <balbi@ti.com>
Thu, 9 Aug 2012 11:36:58 +0000 (14:36 +0300)
The function usb_add_phy trusts the sanity of the caller.
Also it accesses x after the NULL check.
Remove the unneeded check.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/otg/otg.c

index 1bf60a22595c706c2213720b1514391002e6284b..a30c04115115046e9c1c43e4e1bbced59b73e441 100644 (file)
@@ -159,7 +159,7 @@ int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
        unsigned long   flags;
        struct usb_phy  *phy;
 
-       if (x && x->type != USB_PHY_TYPE_UNDEFINED) {
+       if (x->type != USB_PHY_TYPE_UNDEFINED) {
                dev_err(x->dev, "not accepting initialized PHY %s\n", x->label);
                return -EINVAL;
        }