• Alan Stern's avatar
    USB: UDC: Expand device model API interface · 3301c215
    Alan Stern authored
    The routines used by the UDC core to interface with the kernel's
    device model, namely usb_add_gadget_udc(),
    usb_add_gadget_udc_release(), and usb_del_gadget_udc(), provide access
    to only a subset of the device model's full API.  They include
    functionality equivalent to device_register() and device_unregister()
    for gadgets, but they omit device_initialize(), device_add(),
    device_del(), get_device(), and put_device().
    
    This patch expands the UDC API by adding usb_initialize_gadget(),
    usb_add_gadget(), usb_del_gadget(), usb_get_gadget(), and
    usb_put_gadget() to fill in the gap.  It rewrites the existing
    routines to call the new ones.
    
    CC: Anton Vasilyev <vasilyev@ispras.ru>
    CC: Evgeny Novikov <novikov@ispras.ru>
    CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
    3301c215
core.c 45.4 KB