[PATCH 04/20] staging: octeon-usb: cvmx_usb_complete_t -> enum cvmx_usb_complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace cvmx_usb_complete_t with enum cvmx_usb_complete.

Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 drivers/staging/octeon-usb/cvmx-usb.c   |  4 +--
 drivers/staging/octeon-usb/cvmx-usb.h   | 55 +++++++++++++++++++++------------
 drivers/staging/octeon-usb/octeon-hcd.c |  4 +--
 3 files changed, 39 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index 533ad5f..d8035bb 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -1902,7 +1902,7 @@ static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
 					cvmx_usb_pipe_t *pipe,
 					cvmx_usb_transaction_t *transaction,
 					cvmx_usb_callback_t reason,
-					cvmx_usb_complete_t complete_code)
+					enum cvmx_usb_complete complete_code)
 {
 	cvmx_usb_callback_func_t callback = usb->callback[reason];
 	void *user_data = usb->callback_data[reason];
@@ -1946,7 +1946,7 @@ static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
 static void __cvmx_usb_perform_complete(cvmx_usb_internal_state_t *usb,
 					cvmx_usb_pipe_t *pipe,
 					cvmx_usb_transaction_t *transaction,
-					cvmx_usb_complete_t complete_code)
+					enum cvmx_usb_complete complete_code)
 {
 	/* If this was a split then clear our split in progress marker */
 	if (usb->active_split == transaction)
diff --git a/drivers/staging/octeon-usb/cvmx-usb.h b/drivers/staging/octeon-usb/cvmx-usb.h
index 7c313ff..ea1f2ee 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.h
+++ b/drivers/staging/octeon-usb/cvmx-usb.h
@@ -116,7 +116,7 @@
  *
  * void port_callback(cvmx_usb_state_t *usb,
  *                    cvmx_usb_callback_t reason,
- *                    cvmx_usb_complete_t status,
+ *                    enum cvmx_usb_complete status,
  *                    int pipe_handle,
  *                    int submit_handle,
  *                    int bytes_transferred,
@@ -148,14 +148,14 @@
  *
  * void complete_callback(cvmx_usb_state_t *usb,
  *                        cvmx_usb_callback_t reason,
- *                        cvmx_usb_complete_t status,
+ *                        enum cvmx_usb_complete status,
  *                        int pipe_handle,
  *                        int submit_handle,
  *                        int bytes_transferred,
  *                        void *user_data);
  * - "usb" is the cvmx_usb_state_t for the port.
  * - "reason" will always be CVMX_USB_CALLBACK_TRANSFER_COMPLETE.
- * - "status" will be one of the cvmx_usb_complete_t enumerations.
+ * - "status" will be one of the cvmx_usb_complete enumerations.
  * - "pipe_handle" is the handle to the pipe the transaction
  *   was originally submitted on.
  * - "submit_handle" is the handle returned by the original
@@ -278,21 +278,36 @@ enum cvmx_usb_direction {
 };
 
 /**
- * Enumeration of all possible status codes passed to callback
- * functions.
+ * enum cvmx_usb_complete - possible callback function status codes
+ *
+ * @CVMX_USB_COMPLETE_SUCCESS:	  The transaction / operation finished without
+ *				  any errors
+ * @CVMX_USB_COMPLETE_SHORT:	  FIXME: This is currently not implemented
+ * @CVMX_USB_COMPLETE_CANCEL:	  The transaction was canceled while in flight by
+ *				  a user call to cvmx_usb_cancel
+ * @CVMX_USB_COMPLETE_ERROR:	  The transaction aborted with an unexpected
+ *				  error status
+ * @CVMX_USB_COMPLETE_STALL:	  The transaction received a USB STALL response
+ *				  from the device
+ * @CVMX_USB_COMPLETE_XACTERR:	  The transaction failed with an error from the
+ *				  device even after a number of retries
+ * @CVMX_USB_COMPLETE_DATATGLERR: The transaction failed with a data toggle
+ *				  error even after a number of retries
+ * @CVMX_USB_COMPLETE_BABBLEERR:  The transaction failed with a babble error
+ * @CVMX_USB_COMPLETE_FRAMEERR:	  The transaction failed with a frame error
+ *				  even after a number of retries
  */
-typedef enum
-{
-    CVMX_USB_COMPLETE_SUCCESS,      /**< The transaction / operation finished without any errors */
-    CVMX_USB_COMPLETE_SHORT,        /**< FIXME: This is currently not implemented */
-    CVMX_USB_COMPLETE_CANCEL,       /**< The transaction was canceled while in flight by a user call to cvmx_usb_cancel* */
-    CVMX_USB_COMPLETE_ERROR,        /**< The transaction aborted with an unexpected error status */
-    CVMX_USB_COMPLETE_STALL,        /**< The transaction received a USB STALL response from the device */
-    CVMX_USB_COMPLETE_XACTERR,      /**< The transaction failed with an error from the device even after a number of retries */
-    CVMX_USB_COMPLETE_DATATGLERR,   /**< The transaction failed with a data toggle error even after a number of retries */
-    CVMX_USB_COMPLETE_BABBLEERR,    /**< The transaction failed with a babble error */
-    CVMX_USB_COMPLETE_FRAMEERR,     /**< The transaction failed with a frame error even after a number of retries */
-} cvmx_usb_complete_t;
+enum cvmx_usb_complete {
+	CVMX_USB_COMPLETE_SUCCESS,
+	CVMX_USB_COMPLETE_SHORT,
+	CVMX_USB_COMPLETE_CANCEL,
+	CVMX_USB_COMPLETE_ERROR,
+	CVMX_USB_COMPLETE_STALL,
+	CVMX_USB_COMPLETE_XACTERR,
+	CVMX_USB_COMPLETE_DATATGLERR,
+	CVMX_USB_COMPLETE_BABBLEERR,
+	CVMX_USB_COMPLETE_FRAMEERR,
+};
 
 /**
  * Structure returned containing the USB port status information.
@@ -331,7 +346,7 @@ typedef struct
 {
     int offset;                     /**< This is the offset in bytes into the main buffer where this data is stored */
     int length;                     /**< This is the length in bytes of the data */
-    cvmx_usb_complete_t status;     /**< This is the status of this individual packet transfer */
+    enum cvmx_usb_complete status;  /**< This is the status of this individual packet transfer */
 } cvmx_usb_iso_packet_t;
 
 /**
@@ -368,7 +383,7 @@ typedef struct
  *        cvmx_usb_initialize().
  *      - reason = The cvmx_usb_callback_t used to register
  *        the callback.
- *      - status = The cvmx_usb_complete_t representing the
+ *      - status = The enum cvmx_usb_complete representing the
  *        status code of a transaction.
  *      - pipe_handle = The Pipe that caused this callback, or
  *        -1 if this callback wasn't associated with a pipe.
@@ -381,7 +396,7 @@ typedef struct
  *        cvmx_usb_register_callback() */
 typedef void (*cvmx_usb_callback_func_t)(cvmx_usb_state_t *state,
                                          cvmx_usb_callback_t reason,
-                                         cvmx_usb_complete_t status,
+                                         enum cvmx_usb_complete status,
                                          int pipe_handle, int submit_handle,
                                          int bytes_transferred, void *user_data);
 
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 6ab78ed..b3c2873 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -60,7 +60,7 @@ static irqreturn_t octeon_usb_irq(struct usb_hcd *hcd)
 
 static void octeon_usb_port_callback(cvmx_usb_state_t *usb,
 				     cvmx_usb_callback_t reason,
-				     cvmx_usb_complete_t status,
+				     enum cvmx_usb_complete status,
 				     int pipe_handle,
 				     int submit_handle,
 				     int bytes_transferred,
@@ -107,7 +107,7 @@ static int octeon_usb_get_frame_number(struct usb_hcd *hcd)
 
 static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb,
 					     cvmx_usb_callback_t reason,
-					     cvmx_usb_complete_t status,
+					     enum cvmx_usb_complete status,
 					     int pipe_handle,
 					     int submit_handle,
 					     int bytes_transferred,
-- 
1.8.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux