• Robert Baldyga's avatar
    usb: gadget: encapsulate endpoint claiming mechanism · cc476b42
    Robert Baldyga authored
    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: default avatarRobert Baldyga <r.baldyga@samsung.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    cc476b42
epautoconf.c 11.8 KB