usb: udc: allow adding and removing the same gadget device
authorRoger Quadros <rogerq@ti.com>
Mon, 3 Apr 2017 12:20:29 +0000 (15:20 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:36:47 +0000 (15:36 -0500)
commit6f4790306b4a14f03ab9630cc83d16ae30d3c5bc
tree46e203a268cfbccfb7d7e4e00b9f14354f1c859d
parent5f978b516f07e9753ab333d352f4a8752afba290
usb: udc: allow adding and removing the same gadget device

allow usb_del_gadget_udc() and usb add_gadget_udc() to be called
repeatedly on the same gadget->dev structure.

We need to clear the gadget->dev structure so that kobject_init()
doesn't complain about already initialized object.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/core.c