summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2018-04-24 10:52:47 +0800
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-15 10:14:57 +0300
commit00505adef8a8f8fbacd206fe0a4ef59b074c53e4 (patch)
tree222764217a34483c5a85bb28043855e76d74ccb4 /drivers/usb/mtu3
parent288ee3c36255d0c2d32830313f527e1474a09e9f (diff)
downloadlwn-00505adef8a8f8fbacd206fe0a4ef59b074c53e4.tar.gz
lwn-00505adef8a8f8fbacd206fe0a4ef59b074c53e4.zip
usb: mtu3: remove repeated setting of gadget state
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>
Diffstat (limited to 'drivers/usb/mtu3')
-rw-r--r--drivers/usb/mtu3/mtu3_gadget.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
index f05f10f5c171..de0de015eaf0 100644
--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -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)