Skip to content

Commit

Permalink
usb: mtu3: remove repeated setting of gadget state
Browse files Browse the repository at this point in the history
The usb_add_gadget_udc() will set the gadget state as
USB_STATE_NOTATTACHED, so we needn't set it again.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Chunfeng Yun authored and Felipe Balbi committed May 15, 2018
1 parent 288ee3c commit 00505ad
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/mtu3/mtu3_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,14 +660,10 @@ int mtu3_gadget_setup(struct mtu3 *mtu)
mtu3_gadget_init_eps(mtu);

ret = usb_add_gadget_udc(mtu->dev, &mtu->g);
if (ret) {
if (ret)
dev_err(mtu->dev, "failed to register udc\n");
return ret;
}

usb_gadget_set_state(&mtu->g, USB_STATE_NOTATTACHED);

return 0;
return ret;
}

void mtu3_gadget_cleanup(struct mtu3 *mtu)
Expand Down

0 comments on commit 00505ad

Please sign in to comment.