[PATCH next] usb: mtu3: fix build warning/error

Chunfeng Yun chunfeng.yun at mediatek.com
Mon Oct 19 05:46:51 CEST 2020


Fix up the following build warning/error:
1. unused variable 'mtu' in mtu3_gadget_dequeue() and
   mtu3_gadget_ep_set_halt()
2. implicit declaration of function ‘flush_dcache_range’ and
   ‘invalidate_dcache_range’

Signed-off-by: Chunfeng Yun <chunfeng.yun at mediatek.com>
---
 drivers/usb/mtu3/mtu3_gadget.c | 4 ++--
 drivers/usb/mtu3/mtu3_qmu.c    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
index 027b7e6111..c981407b29 100644
--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -306,7 +306,7 @@ static int mtu3_gadget_dequeue(struct usb_ep *ep, struct usb_request *req)
 	struct mtu3_ep *mep = to_mtu3_ep(ep);
 	struct mtu3_request *mreq = to_mtu3_request(req);
 	struct mtu3_request *r;
-	struct mtu3 *mtu = mep->mtu;
+	__maybe_unused struct mtu3 *mtu = mep->mtu;
 	unsigned long flags;
 	int ret = 0;
 
@@ -344,7 +344,7 @@ done:
 static int mtu3_gadget_ep_set_halt(struct usb_ep *ep, int value)
 {
 	struct mtu3_ep *mep = to_mtu3_ep(ep);
-	struct mtu3 *mtu = mep->mtu;
+	__maybe_unused struct mtu3 *mtu = mep->mtu;
 	struct mtu3_request *mreq;
 	unsigned long flags = 0;
 	int ret = 0;
diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
index f602e50c2f..801c2bc416 100644
--- a/drivers/usb/mtu3/mtu3_qmu.c
+++ b/drivers/usb/mtu3/mtu3_qmu.c
@@ -19,6 +19,7 @@
  */
 
 #include <asm/cache.h>
+#include <cpu_func.h>
 #include <linux/iopoll.h>
 #include <linux/types.h>
 
-- 
2.18.0


More information about the U-Boot mailing list