]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: Fix binding to UDC via configfs interface
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Thu, 5 May 2016 08:46:05 +0000 (10:46 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 31 May 2016 07:02:53 +0000 (10:02 +0300)
commit6c8d4ae6e1a2129f41bbfa4a457713e4e4ad1a36
treefb0786404eafa9f6e3dd7d8c840ea1e17700dd40
parent50071cc55229e13f7b459c28388ff0f4e1bac824
usb: gadget: Fix binding to UDC via configfs interface

By default user could store only valid UDC name in configfs UDC
attr by doing:

echo $UDC_NAME > UDC

Commit (2a0f753 "usb: gadget: udc-core: independent registration of
gadgets and gadget drivers") broke this behavior and allowed to store
any arbitrary string in UDC file and udc core was waiting for such
controller to appear.

echo "any arbitrary string here" > UDC

This commit fix this by adding a flag which prevents configfs
gadget from being added to list of pending drivers if UDC with
given name has not been found.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/configfs.c
drivers/usb/gadget/udc/udc-core.c
include/linux/usb/gadget.h