Skip to content

Commit

Permalink
usb: dwc3: gadget: set gadgets parent to the right controller
Browse files Browse the repository at this point in the history
In case of dwc3 it is possible that the sysdev is the parent of the
controller. To ensure the right dev is set to the gadget's dev parent we
will hand over sysdev instead of dev, which will always point to the
controller.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20210628155311.16762-2-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michael Grzeschik authored and Greg Kroah-Hartman committed Jul 27, 2021
1 parent 6b58739 commit c6e23b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -4233,7 +4233,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
}


usb_initialize_gadget(dwc->dev, dwc->gadget, dwc_gadget_release);
usb_initialize_gadget(dwc->sysdev, dwc->gadget, dwc_gadget_release);
dev = &dwc->gadget->dev;
dev->platform_data = dwc;
dwc->gadget->ops = &dwc3_gadget_ops;
Expand Down

0 comments on commit c6e23b8

Please sign in to comment.