From: Shubhrajyoti D Date: Tue, 7 Aug 2012 14:26:30 +0000 (+0530) Subject: usb: otg: Remove the unneeded NULL check X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=df6791d7042d839b68c58cd7dc3699f9ae5a8f22;p=openwrt%2Fstaging%2Fblogic.git usb: otg: Remove the unneeded NULL check 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 1bf60a22595c..a30c04115115 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -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; }