[PATCH 11/20] staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_status

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

 



Replace cvmx_usb_port_status_t with struct cvmx_usb_port_status.

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

diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index f591897..c92b15f 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -196,7 +196,7 @@ typedef struct {
 	cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END];	/**< User global callbacks */
 	void *callback_data[__CVMX_USB_CALLBACK_END];			/**< User data for each callback */
 	int indent;							/**< Used by debug output to indent functions */
-	cvmx_usb_port_status_t port_status;				/**< Last port status used for change notification */
+	struct cvmx_usb_port_status port_status;			/**< Last port status used for change notification */
 	cvmx_usb_pipe_list_t free_pipes;				/**< List of all pipes that are currently closed */
 	cvmx_usb_pipe_list_t idle_pipes;				/**< List of open pipes that have no transactions */
 	cvmx_usb_pipe_list_t active_pipes[4];				/**< Active pipes indexed by transfer type */
@@ -971,10 +971,10 @@ int cvmx_usb_disable(cvmx_usb_state_t *state)
  *
  * Returns: Port status information
  */
-cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state)
+struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state)
 {
 	cvmx_usbcx_hprt_t usbc_hprt;
-	cvmx_usb_port_status_t result;
+	struct cvmx_usb_port_status result;
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
 
 	memset(&result, 0, sizeof(result));
@@ -1003,7 +1003,7 @@ cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state)
  * @port_status:
  *		 Port status to set, most like returned by cvmx_usb_get_status()
  */
-void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status)
+void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status)
 {
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
 	usb->port_status = port_status;
@@ -2964,7 +2964,7 @@ static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel)
 			pipe->next_tx_frame = usb->frame_number + pipe->interval -
 				(usb->frame_number - pipe->next_tx_frame) % pipe->interval;
 	} else {
-		cvmx_usb_port_status_t port;
+		struct cvmx_usb_port_status port;
 		port = cvmx_usb_get_status((cvmx_usb_state_t *)usb);
 		if (port.port_enabled) {
 			/* We'll retry the exact same transaction again */
diff --git a/drivers/staging/octeon-usb/cvmx-usb.h b/drivers/staging/octeon-usb/cvmx-usb.h
index cf49b13..9c7ff4a 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.h
+++ b/drivers/staging/octeon-usb/cvmx-usb.h
@@ -310,18 +310,29 @@ enum cvmx_usb_complete {
 };
 
 /**
- * Structure returned containing the USB port status information.
+ * struct cvmx_usb_port_status - the USB port status information
+ *
+ * @port_enabled:	1 = Usb port is enabled, 0 = disabled
+ * @port_over_current:	1 = Over current detected, 0 = Over current not
+ *			detected. Octeon doesn't support over current detection.
+ * @port_powered:	1 = Port power is being supplied to the device, 0 =
+ *			power is off. Octeon doesn't support turning port power
+ *			off.
+ * @port_speed:		Current port speed.
+ * @connected:		1 = A device is connected to the port, 0 = No device is
+ *			connected.
+ * @connect_change:	1 = Device connected state changed since the last set
+ *			status call.
  */
-typedef struct
-{
-    uint32_t reserved           : 25;
-    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 */
-    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;
+struct cvmx_usb_port_status {
+	uint32_t reserved		: 25;
+	uint32_t port_enabled		: 1;
+	uint32_t port_over_current	: 1;
+	uint32_t port_powered		: 1;
+	enum cvmx_usb_speed port_speed	: 2;
+	uint32_t connected		: 1;
+	uint32_t connect_change		: 1;
+};
 
 /**
  * This is the structure of a Control packet header
@@ -463,8 +474,8 @@ extern int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number,
 extern int cvmx_usb_shutdown(cvmx_usb_state_t *state);
 extern int cvmx_usb_enable(cvmx_usb_state_t *state);
 extern int cvmx_usb_disable(cvmx_usb_state_t *state);
-extern cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state);
-extern void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status);
+extern struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state);
+extern void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status);
 extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state,
                               enum cvmx_usb_pipe_flags flags,
                               int device_addr, int endpoint_num,
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 5137da7..8a41d09 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -440,7 +440,7 @@ static void octeon_usb_endpoint_disable(struct usb_hcd *hcd, struct usb_host_end
 static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf)
 {
 	struct octeon_hcd *priv = hcd_to_octeon(hcd);
-	cvmx_usb_port_status_t port_status;
+	struct cvmx_usb_port_status port_status;
 	unsigned long flags;
 
 	spin_lock_irqsave(&priv->lock, flags);
@@ -456,7 +456,7 @@ static int octeon_usb_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 {
 	struct octeon_hcd *priv = hcd_to_octeon(hcd);
 	struct device *dev = hcd->self.controller;
-	cvmx_usb_port_status_t usb_port_status;
+	struct cvmx_usb_port_status usb_port_status;
 	int port_status;
 	struct usb_hub_descriptor *desc;
 	unsigned long flags;
-- 
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