On Wed, Jan 17, 2024, UTTKARSH AGGARWAL wrote:
On 1/17/2024 2:52 PM, UTTKARSH AGGARWAL wrote:Please only make one logical fix per change. If any unrelated refactor
On 1/17/2024 12:47 PM, Kuen-Han Tsai wrote:Sorry for the mistake.
Hi Kuen-Han,ret = dwc3_gadget_soft_disconnect(dwc);For improved readability, we can remove the goto statement and move
if (ret)
goto err;
the error handling logic here.
Thanks for the suggestion.
Does this looks good to you ?
int ret = dwc3_gadget_soft_disconnect(dwc);if (ret) { if
(dwc->softconnect) dwc3_gadget_soft_connect(dwc);
return ret; } spin_lock_irqsave(&dwc->lock, flags); if
(dwc->gadget_driver) dwc3_disconnect_gadget(dwc);
spin_unlock_irqrestore(&dwc->lock, flags);
int ret = dwc3_gadget_soft_disconnect(dwc);
if (ret) {
if (dwc->softconnect)
dwc3_gadget_soft_connect(dwc);
return ret;
}
spin_lock_irqsave(&dwc->lock, flags);
if (dwc->gadget_driver)
dwc3_disconnect_gadget(dwc);
spin_unlock_irqrestore(&dwc->lock, flags);
or style change is needed, keep it to a separate commit.
Thanks,
Thinh