]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: encapsulate endpoint claiming mechanism
authorRobert Baldyga <r.baldyga@samsung.com>
Fri, 31 Jul 2015 14:00:13 +0000 (16:00 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 4 Aug 2015 17:24:05 +0000 (12:24 -0500)
commit1286694cab52fc87167b53b5a7750bb8a49ed7ee
tree6c374e93e6f2a4e6aa16f561a52e20bc31570cc5
parent2fddc86208f727c3380b13f032a7a45f1603318b
usb: gadget: encapsulate endpoint claiming mechanism

So far it was necessary for usb functions to set ep->driver_data in
endpoint obtained from autoconfig to non-null value, to indicate that
endpoint is claimed by function (in autoconfig it was checked if endpoint
has set this field to non-null value, and if it has, it was assumed that
it is claimed). It could cause bugs because if some function doesn't
set this field autoconfig could return the same endpoint more than one
time.

To help to avoid such bugs this patch adds claimed flag to struct usb_ep,
and  encapsulates endpoint claiming mechanism inside usb_ep_autoconfig_ss()
and usb_ep_autoconfig_reset(), so now usb functions don't need to perform
any additional actions to mark endpoint obtained from autoconfig as claimed.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/epautoconf.c
include/linux/usb/gadget.h