Skip to content

Commit

Permalink
usb: otg: Remove the unneeded NULL check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shubhrajyoti D authored and Felipe Balbi committed Aug 9, 2012
1 parent c84d364 commit df6791d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/otg/otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit df6791d

Please sign in to comment.