Dear Tony, > -----Original Message----- > From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb- > owner@xxxxxxxxxxxxxxx] On Behalf Of Tony Lindgren > Sent: Saturday, September 20, 2014 5:51 PM > To: Matt Porter > Cc: linux-usb@xxxxxxxxxxxxxxx > 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 k.opasiak@xxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html