[PATCH v2 38/46] usb: cdns3: Fix not calling dev_xxx with a device

Sean Anderson seanga2 at gmail.com
Tue Sep 15 16:45:14 CEST 2020


ep0.c also need to include dm.h so dev_xxx can access udevice fields.

Signed-off-by: Sean Anderson <seanga2 at gmail.com>
---

Changes in v2:
- New

 drivers/usb/cdns3/ep0.c    | 5 +++--
 drivers/usb/cdns3/gadget.c | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c
index a08c694559..acff79ae1c 100644
--- a/drivers/usb/cdns3/ep0.c
+++ b/drivers/usb/cdns3/ep0.c
@@ -11,8 +11,9 @@
  */
 
 #include <cpu_func.h>
-#include <asm/cache.h>
+#include <dm.h>
 #include <dm/device_compat.h>
+#include <asm/cache.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/usb/composite.h>
@@ -810,7 +811,7 @@ int cdns3_gadget_ep_set_wedge(struct usb_ep *ep)
 {
 	struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
 
-	dev_dbg(priv_dev->dev, "Wedge for %s\n", ep->name);
+	dev_dbg(priv_ep->cdns3_dev->dev, "Wedge for %s\n", ep->name);
 	cdns3_gadget_ep_set_halt(ep, 1);
 	priv_ep->flags |= EP_WEDGE;
 
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 8f81d17ec8..83dbb5a103 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2399,8 +2399,7 @@ static void cdns3_gadget_udc_set_speed(struct usb_gadget *gadget,
 	case USB_SPEED_SUPER:
 		break;
 	default:
-		dev_err(cdns->dev, "invalid speed parameter %d\n",
-			speed);
+		dev_err(priv_dev->dev, "invalid speed parameter %d\n", speed);
 	}
 
 	priv_dev->gadget.speed = speed;
-- 
2.28.0



More information about the U-Boot mailing list