summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-01-18 10:09:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-19 16:10:44 +0300
commit816f518df20531a01eb8ddd2e84adc9791e16539 (patch)
treea8dbc2c2ace6d1108351d89257ca0256a2b6b780
parentbb5fe85609c6e21e96fc5669ae200c68a1e05a9b (diff)
downloadlinux-816f518df20531a01eb8ddd2e84adc9791e16539.tar.xz
usb: fotg210-udc: Assign of_node and speed on start
Follow the example set by other drivers to assign of_node and speed to the driver when binding, also print bound info akin to other UDC drivers. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230103-gemini-fotg210-usb-v2-6-100388af9810@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/fotg210/fotg210-udc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c
index 195dc5050046..7740df670b75 100644
--- a/drivers/usb/fotg210/fotg210-udc.c
+++ b/drivers/usb/fotg210/fotg210-udc.c
@@ -1015,6 +1015,10 @@ static int fotg210_udc_start(struct usb_gadget *g,
/* hook up the driver */
driver->driver.bus = NULL;
fotg210->driver = driver;
+ fotg210->gadget.dev.of_node = fotg210->dev->of_node;
+ fotg210->gadget.speed = USB_SPEED_UNKNOWN;
+
+ dev_info(fotg210->dev, "bound driver %s\n", driver->driver.name);
if (!IS_ERR_OR_NULL(fotg210->phy)) {
ret = otg_set_peripheral(fotg210->phy->otg,
@@ -1071,6 +1075,7 @@ static int fotg210_udc_stop(struct usb_gadget *g)
fotg210_init(fotg210);
fotg210->driver = NULL;
+ fotg210->gadget.speed = USB_SPEED_UNKNOWN;
spin_unlock_irqrestore(&fotg210->lock, flags);