On 1/10/23 17:29, Mattijs Korpershoek wrote:
[...]
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c
b/drivers/usb/gadget/dwc2_udc_otg.c
index 77988f78ab30..d0a9be49ad9c 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -236,6 +236,14 @@ static int udc_enable(struct dwc2_udc *dev)
return 0;
}
+static int dwc2_gadget_pullup(struct usb_gadget *g, int is_on)
+{
+ clrsetbits_le32(®->dctl, SOFT_DISCONNECT,
+ (!is_on) << SOFT_DISCONNECT_BIT);
Use
is_on ? 0 : SOFT_DISCONNECT
and you get rid of SOFT_DISCONNECT_BIT macro and the extra parenthesis
around (!is_on) which are not needed.