[PATCH 01/20] staging: octeon-usb: cvmx_usb_speed_t -> enum cvmx_usb_speed

Aaro Koskinen aaro.koskinen at iki.fi
Tue Jul 30 20:42:53 UTC 2013


Replace cvmx_usb_speed_t with enum cvmx_usb_speed.

Signed-off-by: Aaro Koskinen <aaro.koskinen at iki.fi>
---
 drivers/staging/octeon-usb/cvmx-usb.c   |  4 ++--
 drivers/staging/octeon-usb/cvmx-usb.h   | 21 ++++++++++++---------
 drivers/staging/octeon-usb/octeon-hcd.c |  2 +-
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index fa029e3..44f4db0 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -151,7 +151,7 @@ typedef struct cvmx_usb_pipe {
 	uint64_t interval;			/**< For periodic pipes, the interval between packets in frames */
 	uint64_t next_tx_frame;			/**< The next frame this pipe is allowed to transmit on */
 	cvmx_usb_pipe_flags_t flags;		/**< State flags for this pipe */
-	cvmx_usb_speed_t device_speed;		/**< Speed of device connected to this pipe */
+	enum cvmx_usb_speed device_speed;	/**< Speed of device connected to this pipe */
 	cvmx_usb_transfer_t transfer_type;	/**< Type of transaction supported by this pipe */
 	cvmx_usb_direction_t transfer_dir;	/**< IN or OUT. Ignored for Control */
 	int multi_count;			/**< Max packet in a row for the device */
@@ -1103,7 +1103,7 @@ static inline int __cvmx_usb_get_pipe_handle(cvmx_usb_internal_state_t *usb,
  */
 int cvmx_usb_open_pipe(cvmx_usb_state_t *state, cvmx_usb_pipe_flags_t flags,
 		       int device_addr, int endpoint_num,
-		       cvmx_usb_speed_t device_speed, int max_packet,
+		       enum cvmx_usb_speed device_speed, int max_packet,
 		       cvmx_usb_transfer_t transfer_type,
 		       cvmx_usb_direction_t transfer_dir, int interval,
 		       int multi_count, int hub_device_addr, int hub_port)
diff --git a/drivers/staging/octeon-usb/cvmx-usb.h b/drivers/staging/octeon-usb/cvmx-usb.h
index 4b425e5..c5ccda3 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.h
+++ b/drivers/staging/octeon-usb/cvmx-usb.h
@@ -235,14 +235,17 @@
 #define __CVMX_USB_H__
 
 /**
- * Enumerations representing the possible USB device speeds
+ * enum cvmx_usb_speed - the possible USB device speeds
+ *
+ * @CVMX_USB_SPEED_HIGH: Device is operation at 480Mbps
+ * @CVMX_USB_SPEED_FULL: Device is operation at 12Mbps
+ * @CVMX_USB_SPEED_LOW:  Device is operation at 1.5Mbps
  */
-typedef enum
-{
-    CVMX_USB_SPEED_HIGH = 0,        /**< Device is operation at 480Mbps */
-    CVMX_USB_SPEED_FULL = 1,        /**< Device is operation at 12Mbps */
-    CVMX_USB_SPEED_LOW = 2,         /**< Device is operation at 1.5Mbps */
-} cvmx_usb_speed_t;
+enum cvmx_usb_speed {
+	CVMX_USB_SPEED_HIGH = 0,
+	CVMX_USB_SPEED_FULL = 1,
+	CVMX_USB_SPEED_LOW = 2,
+};
 
 /**
  * Enumeration representing the possible USB transfer types.
@@ -290,7 +293,7 @@ typedef struct
     uint32_t port_enabled       : 1; /**< 1 = Usb port is enabled, 0 = disabled */
     uint32_t port_over_current  : 1; /**< 1 = Over current detected, 0 = Over current not detected. Octeon doesn't support over current detection */
     uint32_t port_powered       : 1; /**< 1 = Port power is being supplied to the device, 0 = power is off. Octeon doesn't support turning port power off */
-    cvmx_usb_speed_t port_speed : 2; /**< Current port speed */
+    enum cvmx_usb_speed port_speed : 2; /**< Current port speed */
     uint32_t connected          : 1; /**< 1 = A device is connected to the port, 0 = No device is connected */
     uint32_t connect_change     : 1; /**< 1 = Device connected state changed since the last set status call */
 } cvmx_usb_port_status_t;
@@ -413,7 +416,7 @@ extern void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t
 extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state,
                               cvmx_usb_pipe_flags_t flags,
                               int device_addr, int endpoint_num,
-                              cvmx_usb_speed_t device_speed, int max_packet,
+                              enum cvmx_usb_speed device_speed, int max_packet,
                               cvmx_usb_transfer_t transfer_type,
                               cvmx_usb_direction_t transfer_dir, int interval,
                               int multi_count, int hub_device_addr,
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index d156b60..f32d8fc 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -217,7 +217,7 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
 
 	if (!ep->hcpriv) {
 		cvmx_usb_transfer_t transfer_type;
-		cvmx_usb_speed_t speed;
+		enum cvmx_usb_speed speed;
 		int split_device = 0;
 		int split_port = 0;
 		switch (usb_pipetype(urb->pipe)) {
-- 
1.8.3.2



More information about the devel mailing list