if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
return -EFAULT;
- if (!strncmp(buf, "host", 4))
+ if (!strncmp(buf, "host", 4)) {
mode |= DWC3_GCTL_PRTCAP_HOST;
+ dwc3_force_mode(dwc, mode);
+ return count;
+ }
- if (!strncmp(buf, "device", 6))
+ if (!strncmp(buf, "device", 6)) {
mode |= DWC3_GCTL_PRTCAP_DEVICE;
+ dwc3_force_mode(dwc, mode);
+ return count;
+ }
if (!strncmp(buf, "otg", 3))
mode |= DWC3_GCTL_PRTCAP_OTG;