[PATCH 13/20] staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_state

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

 



Replace cvmx_usb_state_t with struct cvmx_usb_state.

Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 drivers/staging/octeon-usb/cvmx-usb.c   | 42 +++++++++++++-------------
 drivers/staging/octeon-usb/cvmx-usb.h   | 53 ++++++++++++++++-----------------
 drivers/staging/octeon-usb/octeon-hcd.c |  8 ++---
 3 files changed, 51 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index 6c79cc1..c7f7566 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -358,7 +358,7 @@ static inline int __cvmx_usb_get_data_pid(cvmx_usb_pipe_t *pipe)
  * by this API, a zero will be returned. Most Octeon chips
  * support one usb port, but some support two ports.
  * cvmx_usb_initialize() must be called on independent
- * cvmx_usb_state_t structures.
+ * struct cvmx_usb_state.
  *
  * Returns: Number of port, zero if usb isn't supported
  */
@@ -479,7 +479,7 @@ static inline void __cvmx_usb_remove_pipe(cvmx_usb_pipe_list_t *list, cvmx_usb_p
  * other access to the Octeon USB port is made. The port starts
  * off in the disabled state.
  *
- * @state:	 Pointer to an empty cvmx_usb_state_t structure
+ * @state:	 Pointer to an empty struct cvmx_usb_state
  *		 that will be populated by the initialize call.
  *		 This structure is then passed to all other USB
  *		 functions.
@@ -491,7 +491,7 @@ static inline void __cvmx_usb_remove_pipe(cvmx_usb_pipe_list_t *list, cvmx_usb_p
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number,
+int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number,
 			enum cvmx_usb_initialize_flags flags)
 {
 	cvmx_usbnx_clk_ctl_t usbn_clk_ctl;
@@ -818,7 +818,7 @@ int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number,
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_shutdown(cvmx_usb_state_t *state)
+int cvmx_usb_shutdown(struct cvmx_usb_state *state)
 {
 	cvmx_usbnx_clk_ctl_t usbn_clk_ctl;
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
@@ -853,7 +853,7 @@ int cvmx_usb_shutdown(cvmx_usb_state_t *state)
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_enable(cvmx_usb_state_t *state)
+int cvmx_usb_enable(struct cvmx_usb_state *state)
 {
 	cvmx_usbcx_ghwcfg3_t usbcx_ghwcfg3;
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
@@ -947,7 +947,7 @@ int cvmx_usb_enable(cvmx_usb_state_t *state)
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_disable(cvmx_usb_state_t *state)
+int cvmx_usb_disable(struct cvmx_usb_state *state)
 {
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
 
@@ -971,7 +971,7 @@ int cvmx_usb_disable(cvmx_usb_state_t *state)
  *
  * Returns: Port status information
  */
-struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state)
+struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state)
 {
 	cvmx_usbcx_hprt_t usbc_hprt;
 	struct cvmx_usb_port_status result;
@@ -1003,7 +1003,7 @@ struct cvmx_usb_port_status 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, struct cvmx_usb_port_status port_status)
+void cvmx_usb_set_status(struct cvmx_usb_state *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;
@@ -1101,7 +1101,7 @@ static inline int __cvmx_usb_get_pipe_handle(cvmx_usb_internal_state_t *usb,
  * Returns: A non negative value is a pipe handle. Negative
  *	    values are error codes.
  */
-int cvmx_usb_open_pipe(cvmx_usb_state_t *state, enum cvmx_usb_pipe_flags flags,
+int cvmx_usb_open_pipe(struct cvmx_usb_state *state, enum cvmx_usb_pipe_flags flags,
 		       int device_addr, int endpoint_num,
 		       enum cvmx_usb_speed device_speed, int max_packet,
 		       enum cvmx_usb_transfer transfer_type,
@@ -1926,7 +1926,7 @@ static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
 	if (!callback)
 		return;
 
-	callback((cvmx_usb_state_t *)usb, reason, complete_code, pipe_handle, submit_handle,
+	callback((struct cvmx_usb_state *)usb, reason, complete_code, pipe_handle, submit_handle,
 		 bytes_transferred, user_data);
 }
 
@@ -2122,7 +2122,7 @@ static int __cvmx_usb_submit_transaction(cvmx_usb_internal_state_t *usb,
  * Returns: A submitted transaction handle or negative on
  *	    failure. Negative values are error codes.
  */
-int cvmx_usb_submit_bulk(cvmx_usb_state_t *state, int pipe_handle,
+int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle,
 			 uint64_t buffer, int buffer_length,
 			 cvmx_usb_callback_func_t callback,
 			 void *user_data)
@@ -2181,7 +2181,7 @@ int cvmx_usb_submit_bulk(cvmx_usb_state_t *state, int pipe_handle,
  * Returns: A submitted transaction handle or negative on
  *	    failure. Negative values are error codes.
  */
-int cvmx_usb_submit_interrupt(cvmx_usb_state_t *state, int pipe_handle,
+int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state, int pipe_handle,
 			      uint64_t buffer, int buffer_length,
 			      cvmx_usb_callback_func_t callback,
 			      void *user_data)
@@ -2244,7 +2244,7 @@ int cvmx_usb_submit_interrupt(cvmx_usb_state_t *state, int pipe_handle,
  * Returns: A submitted transaction handle or negative on
  *	    failure. Negative values are error codes.
  */
-int cvmx_usb_submit_control(cvmx_usb_state_t *state, int pipe_handle,
+int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle,
 			    uint64_t control_header,
 			    uint64_t buffer, int buffer_length,
 			    cvmx_usb_callback_func_t callback,
@@ -2324,7 +2324,7 @@ int cvmx_usb_submit_control(cvmx_usb_state_t *state, int pipe_handle,
  * Returns: A submitted transaction handle or negative on
  *	    failure. Negative values are error codes.
  */
-int cvmx_usb_submit_isochronous(cvmx_usb_state_t *state, int pipe_handle,
+int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle,
 				int start_frame, int flags,
 				int number_packets,
 				struct cvmx_usb_iso_packet packets[],
@@ -2380,7 +2380,7 @@ int cvmx_usb_submit_isochronous(cvmx_usb_state_t *state, int pipe_handle,
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_cancel(cvmx_usb_state_t *state, int pipe_handle, int submit_handle)
+int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle, int submit_handle)
 {
 	cvmx_usb_transaction_t *transaction;
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
@@ -2437,7 +2437,7 @@ int cvmx_usb_cancel(cvmx_usb_state_t *state, int pipe_handle, int submit_handle)
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_cancel_all(cvmx_usb_state_t *state, int pipe_handle)
+int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle)
 {
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
 	cvmx_usb_pipe_t *pipe = usb->pipe + pipe_handle;
@@ -2471,7 +2471,7 @@ int cvmx_usb_cancel_all(cvmx_usb_state_t *state, int pipe_handle)
  * Returns: 0 or a negative error code. EBUSY is returned if the pipe has
  *	    outstanding transfers.
  */
-int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle)
+int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle)
 {
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
 	cvmx_usb_pipe_t *pipe = usb->pipe + pipe_handle;
@@ -2506,7 +2506,7 @@ int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle)
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_register_callback(cvmx_usb_state_t *state,
+int cvmx_usb_register_callback(struct cvmx_usb_state *state,
 			       enum cvmx_usb_callback reason,
 			       cvmx_usb_callback_func_t callback,
 			       void *user_data)
@@ -2534,7 +2534,7 @@ int cvmx_usb_register_callback(cvmx_usb_state_t *state,
  *
  * Returns: USB frame number
  */
-int cvmx_usb_get_frame_number(cvmx_usb_state_t *state)
+int cvmx_usb_get_frame_number(struct cvmx_usb_state *state)
 {
 	int frame_number;
 	cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
@@ -2965,7 +2965,7 @@ static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel)
 				(usb->frame_number - pipe->next_tx_frame) % pipe->interval;
 	} else {
 		struct cvmx_usb_port_status port;
-		port = cvmx_usb_get_status((cvmx_usb_state_t *)usb);
+		port = cvmx_usb_get_status((struct cvmx_usb_state *)usb);
 		if (port.port_enabled) {
 			/* We'll retry the exact same transaction again */
 			transaction->retries++;
@@ -2992,7 +2992,7 @@ static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel)
  *
  * Returns: 0 or a negative error code.
  */
-int cvmx_usb_poll(cvmx_usb_state_t *state)
+int cvmx_usb_poll(struct cvmx_usb_state *state)
 {
 	cvmx_usbcx_hfnum_t usbc_hfnum;
 	cvmx_usbcx_gintsts_t usbc_gintsts;
diff --git a/drivers/staging/octeon-usb/cvmx-usb.h b/drivers/staging/octeon-usb/cvmx-usb.h
index b0d0f6a..bd6a2fb 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.h
+++ b/drivers/staging/octeon-usb/cvmx-usb.h
@@ -75,7 +75,7 @@
  * In the probe phase you should:
  * - Use cvmx_usb_get_num_ports() to determine the number of
  *   USB port to be supported.
- * - Allocate space for a cvmx_usb_state_t structure for each
+ * - Allocate space for a struct cvmx_usb_state for each
  *   port.
  * - Tell the operating system about each port
  *
@@ -114,14 +114,14 @@
  *
  * The port callback prototype needs to look as follows:
  *
- * void port_callback(cvmx_usb_state_t *usb,
+ * void port_callback(struct cvmx_usb_state *usb,
  *                    enum cvmx_usb_callback reason,
  *                    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.
+ * - "usb" is the struct cvmx_usb_state for the port.
  * - "reason" will always be CVMX_USB_CALLBACK_PORT_CHANGED.
  * - "status" will always be CVMX_USB_COMPLETE_SUCCESS.
  * - "pipe_handle" will always be -1.
@@ -146,14 +146,14 @@
  *
  * The completion callback prototype needs to look as follows:
  *
- * void complete_callback(cvmx_usb_state_t *usb,
+ * void complete_callback(struct cvmx_usb_state *usb,
  *                        enum cvmx_usb_callback reason,
  *                        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.
+ * - "usb" is the struct cvmx_usb_state for the port.
  * - "reason" will always be CVMX_USB_CALLBACK_TRANSFER_COMPLETE.
  * - "status" will be one of the cvmx_usb_complete enumerations.
  * - "pipe_handle" is the handle to the pipe the transaction
@@ -393,10 +393,9 @@ enum cvmx_usb_callback {
  * may change in future SDKs. No data in it should be referenced
  * by user's of this API.
  */
-typedef struct
-{
-    char data[65536];
-} cvmx_usb_state_t;
+struct cvmx_usb_state {
+	char data[65536];
+};
 
 /**
  * USB callback functions are always of the following type.
@@ -416,7 +415,7 @@ typedef struct
  *      - user_data = The user pointer supplied to the
  *        function cvmx_usb_submit() or
  *        cvmx_usb_register_callback() */
-typedef void (*cvmx_usb_callback_func_t)(cvmx_usb_state_t *state,
+typedef void (*cvmx_usb_callback_func_t)(struct cvmx_usb_state *state,
                                          enum cvmx_usb_callback reason,
                                          enum cvmx_usb_complete status,
                                          int pipe_handle, int submit_handle,
@@ -473,14 +472,14 @@ enum cvmx_usb_pipe_flags {
 };
 
 extern int cvmx_usb_get_num_ports(void);
-extern int cvmx_usb_initialize(cvmx_usb_state_t *state, int usb_port_number,
+extern int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number,
 			       enum cvmx_usb_initialize_flags flags);
-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 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,
+extern int cvmx_usb_shutdown(struct cvmx_usb_state *state);
+extern int cvmx_usb_enable(struct cvmx_usb_state *state);
+extern int cvmx_usb_disable(struct cvmx_usb_state *state);
+extern struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state);
+extern void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_status port_status);
+extern int cvmx_usb_open_pipe(struct cvmx_usb_state *state,
                               enum cvmx_usb_pipe_flags flags,
                               int device_addr, int endpoint_num,
                               enum cvmx_usb_speed device_speed, int max_packet,
@@ -488,15 +487,15 @@ extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state,
                               enum cvmx_usb_direction transfer_dir, int interval,
                               int multi_count, int hub_device_addr,
                               int hub_port);
-extern int cvmx_usb_submit_bulk(cvmx_usb_state_t *state, int pipe_handle,
+extern int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle,
                                 uint64_t buffer, int buffer_length,
                                 cvmx_usb_callback_func_t callback,
                                 void *user_data);
-extern int cvmx_usb_submit_interrupt(cvmx_usb_state_t *state, int pipe_handle,
+extern int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state, int pipe_handle,
                                      uint64_t buffer, int buffer_length,
                                      cvmx_usb_callback_func_t callback,
                                      void *user_data);
-extern int cvmx_usb_submit_control(cvmx_usb_state_t *state, int pipe_handle,
+extern int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle,
                                    uint64_t control_header,
                                    uint64_t buffer, int buffer_length,
                                    cvmx_usb_callback_func_t callback,
@@ -517,22 +516,22 @@ enum cvmx_usb_isochronous_flags {
 	CVMX_USB_ISOCHRONOUS_FLAGS_ASAP		= 1 << 1,
 };
 
-extern int cvmx_usb_submit_isochronous(cvmx_usb_state_t *state, int pipe_handle,
+extern int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle,
                                        int start_frame, int flags,
                                        int number_packets,
                                        struct cvmx_usb_iso_packet packets[],
                                        uint64_t buffer, int buffer_length,
                                        cvmx_usb_callback_func_t callback,
                                        void *user_data);
-extern int cvmx_usb_cancel(cvmx_usb_state_t *state, int pipe_handle,
+extern int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle,
 			   int submit_handle);
-extern int cvmx_usb_cancel_all(cvmx_usb_state_t *state, int pipe_handle);
-extern int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle);
-extern int cvmx_usb_register_callback(cvmx_usb_state_t *state,
+extern int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle);
+extern int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle);
+extern int cvmx_usb_register_callback(struct cvmx_usb_state *state,
 				      enum cvmx_usb_callback reason,
 				      cvmx_usb_callback_func_t callback,
 				      void *user_data);
-extern int cvmx_usb_get_frame_number(cvmx_usb_state_t *state);
-extern int cvmx_usb_poll(cvmx_usb_state_t *state);
+extern int cvmx_usb_get_frame_number(struct cvmx_usb_state *state);
+extern int cvmx_usb_poll(struct cvmx_usb_state *state);
 
 #endif  /* __CVMX_USB_H__ */
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 319f2e1..5dbbd14 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -26,7 +26,7 @@
 
 struct octeon_hcd {
 	spinlock_t lock;
-	cvmx_usb_state_t usb;
+	struct cvmx_usb_state usb;
 	struct tasklet_struct dequeue_tasklet;
 	struct list_head dequeue_list;
 };
@@ -42,7 +42,7 @@ static inline struct usb_hcd *octeon_to_hcd(struct octeon_hcd *p)
 	return container_of((void *)p, struct usb_hcd, hcd_priv);
 }
 
-static inline struct octeon_hcd *cvmx_usb_to_octeon(cvmx_usb_state_t *p)
+static inline struct octeon_hcd *cvmx_usb_to_octeon(struct cvmx_usb_state *p)
 {
 	return container_of(p, struct octeon_hcd, usb);
 }
@@ -58,7 +58,7 @@ static irqreturn_t octeon_usb_irq(struct usb_hcd *hcd)
 	return IRQ_HANDLED;
 }
 
-static void octeon_usb_port_callback(cvmx_usb_state_t *usb,
+static void octeon_usb_port_callback(struct cvmx_usb_state *usb,
 				     enum cvmx_usb_callback reason,
 				     enum cvmx_usb_complete status,
 				     int pipe_handle,
@@ -105,7 +105,7 @@ static int octeon_usb_get_frame_number(struct usb_hcd *hcd)
 	return cvmx_usb_get_frame_number(&priv->usb);
 }
 
-static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb,
+static void octeon_usb_urb_complete_callback(struct cvmx_usb_state *usb,
 					     enum cvmx_usb_callback reason,
 					     enum cvmx_usb_complete status,
 					     int pipe_handle,
-- 
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