]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'usb-chipidea-next/ci-for-usb-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:51:27 +0000 (14:51 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:51:27 +0000 (14:51 +1100)
drivers/usb/chipidea/Kconfig
drivers/usb/chipidea/Makefile
drivers/usb/chipidea/ci.h
drivers/usb/chipidea/core.c
drivers/usb/chipidea/debug.c
drivers/usb/chipidea/debug.h [deleted file]
drivers/usb/chipidea/udc.c

index 5619b8ca3bf3f4d4e0b0651385a88c286a012967..3644a3500b700013250f1f841bfe49117f70f563 100644 (file)
@@ -37,9 +37,4 @@ config USB_CHIPIDEA_HOST
          Say Y here to enable host controller functionality of the
          ChipIdea driver.
 
-config USB_CHIPIDEA_DEBUG
-       bool "ChipIdea driver debug"
-       help
-         Say Y here to enable debugging output of the ChipIdea driver.
-
 endif
index 4decb12f25786221690c5adca6bb4448512039b1..518e445476c3f5c7fed0cb9930700310f04688b6 100644 (file)
@@ -1,11 +1,8 @@
-ccflags-$(CONFIG_USB_CHIPIDEA_DEBUG) := -DDEBUG
-
 obj-$(CONFIG_USB_CHIPIDEA)             += ci_hdrc.o
 
-ci_hdrc-y                              := core.o otg.o
+ci_hdrc-y                              := core.o otg.o debug.o
 ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC)     += udc.o
 ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST)    += host.o
-ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG)   += debug.o
 ci_hdrc-$(CONFIG_USB_OTG_FSM)          += otg_fsm.o
 
 # Glue/Bridge layers go here
index 41d7cf6d63ba32a240add0eaa7c01f63fa8b1f28..cd414559040f12224bda60a0dd0a9e12b597241c 100644 (file)
@@ -433,4 +433,7 @@ int hw_wait_reg(struct ci_hdrc *ci, enum ci_hw_regs reg, u32 mask,
 
 void ci_platform_configure(struct ci_hdrc *ci);
 
+int dbg_create_files(struct ci_hdrc *ci);
+
+void dbg_remove_files(struct ci_hdrc *ci);
 #endif /* __DRIVERS_USB_CHIPIDEA_CI_H */
index 965d0e240dcb27674151e2073b984c89c90eb7ed..18e77e02842b951efada16492a909e17c7c8bfcf 100644 (file)
@@ -71,7 +71,6 @@
 #include "udc.h"
 #include "bits.h"
 #include "host.h"
-#include "debug.h"
 #include "otg.h"
 #include "otg_fsm.h"
 
index 58c8485a0715ada6c585a29e23883f25091fa127..a4f7db2e18ddc295fc4ff1a0cad99bc1ff8b04bd 100644 (file)
@@ -15,7 +15,6 @@
 #include "ci.h"
 #include "udc.h"
 #include "bits.h"
-#include "debug.h"
 #include "otg.h"
 
 /**
diff --git a/drivers/usb/chipidea/debug.h b/drivers/usb/chipidea/debug.h
deleted file mode 100644 (file)
index e16478c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * debug.h - ChipIdea USB driver debug interfaces
- *
- * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
- *
- * Author: David Lopo
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef __DRIVERS_USB_CHIPIDEA_DEBUG_H
-#define __DRIVERS_USB_CHIPIDEA_DEBUG_H
-
-#ifdef CONFIG_USB_CHIPIDEA_DEBUG
-int dbg_create_files(struct ci_hdrc *ci);
-void dbg_remove_files(struct ci_hdrc *ci);
-#else
-static inline int dbg_create_files(struct ci_hdrc *ci)
-{
-       return 0;
-}
-
-static inline void dbg_remove_files(struct ci_hdrc *ci)
-{
-}
-#endif
-
-#endif /* __DRIVERS_USB_CHIPIDEA_DEBUG_H */
index 391a1225b0ba330cd818028f240cb151e8ade65c..2987a742ca3bef8251de32e8009e5727fd12312e 100644 (file)
@@ -26,7 +26,6 @@
 #include "ci.h"
 #include "udc.h"
 #include "bits.h"
-#include "debug.h"
 #include "otg.h"
 #include "otg_fsm.h"
 
@@ -404,9 +403,9 @@ static inline u8 _usb_addr(struct ci_hw_ep *ep)
 }
 
 /**
- * _hardware_queue: configures a request at hardware level
- * @gadget: gadget
+ * _hardware_enqueue: configures a request at hardware level
  * @hwep:   endpoint
+ * @hwreq:  request
  *
  * This function returns an error code
  */
@@ -435,19 +434,28 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
        if (hwreq->req.dma % PAGE_SIZE)
                pages--;
 
-       if (rest == 0)
-               add_td_to_list(hwep, hwreq, 0);
+       if (rest == 0) {
+               ret = add_td_to_list(hwep, hwreq, 0);
+               if (ret < 0)
+                       goto done;
+       }
 
        while (rest > 0) {
                unsigned count = min(hwreq->req.length - hwreq->req.actual,
                                        (unsigned)(pages * CI_HDRC_PAGE_SIZE));
-               add_td_to_list(hwep, hwreq, count);
+               ret = add_td_to_list(hwep, hwreq, count);
+               if (ret < 0)
+                       goto done;
+
                rest -= count;
        }
 
        if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX
-           && (hwreq->req.length % hwep->ep.maxpacket == 0))
-               add_td_to_list(hwep, hwreq, 0);
+           && (hwreq->req.length % hwep->ep.maxpacket == 0)) {
+               ret = add_td_to_list(hwep, hwreq, 0);
+               if (ret < 0)
+                       goto done;
+       }
 
        firstnode = list_first_entry(&hwreq->tds, struct td_node, td);
 
@@ -788,8 +796,12 @@ static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req)
 
 /**
  * _ep_queue: queues (submits) an I/O request to an endpoint
+ * @ep:        endpoint
+ * @req:       request
+ * @gfp_flags: GFP flags (not used)
  *
  * Caller must hold lock
+ * This function returns an error code
  */
 static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
                    gfp_t __maybe_unused gfp_flags)