Dear Tony,
> -----Original Message-----
> From: [email protected] [mailto:linux-usb-
> [email protected]] On Behalf Of Tony Lindgren
> Sent: Saturday, September 20, 2014 5:51 PM
> To: Matt Porter
> Cc: [email protected]
> Subject: [PATCH] libusbg: Fix usbg_disable_gadget to actually clear
> the UDC
>
> Currently usbg_disable_gadget() does not actually write anything
> to UDC to clear it and the configured UDC name stays there.
>
No, udc name doesn't stay there due to O_TRUNC flag which is always used
for writing in usbg_write_string(). With this flag we don't need to
write new line to file because size of file is set to 0 while opening.
Summing up:
open("/sys/kernel/config/usb_gadget/g1/UDC", O_WRONLY|O_CREAT|O_TRUNC,
0666) = 3
close(3) = 0
causes unbind, so everything works fine.
--
Best regards,
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html