Staging: emxx_udc: Fix do not add new typedefs
PATCH v2 1/1 Staging: emxx_udc: Fix do not add new typedefs
This patch fixes the following checkpatch.pl warning:"do not add new typedefs". Remove typedefs keyword and rename structs identifiers appropriately. Update related files.
Signed-off-by Haneen Mohammed <[email protected]>
--- drivers/staging/emxx_udc/emxx_udc.c | 36 ++++++++++++++++++------------------ drivers/staging/emxx_udc/emxx_udc.h | 22 +++++++++++----------- 2 files changed, 29 insertions(+), 29 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +18 -18
@@ -201,7 +201,7 @@ static u32 _nbu2ss_get_begin_ram_address(struct nbu2ss_udc *udc)u32 num, buf_type;u32 data, last_ram_adr, use_ram_size; -PT_EP_REGS p_ep_regs; +struct ep_regs *p_ep_regs; last_ram_adr = (D_RAM_SIZE_CTRL /sizeof (u32)) *2 ; use_ram_size =0 ;
@@ -394,7 +394,7 @@ static void _nbu2ss_ep_dma_exit(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep) {u32 num;u32 data; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (udc->vbus_active ==0 )return ;/* VBUS OFF */
@@ -425,7 +425,7 @@ static void _nbu2ss_ep_dma_exit(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)/* Abort DMA */ static void _nbu2ss_ep_dma_abort (struct nbu2ss_udc *udc,struct nbu2ss_ep *ep) { -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;_nbu2ss_bitclr (&preg->EP_DCR[ep->epnum-1 ].EP_DCR1, DCR1_EPn_REQEN);mdelay (DMA_DISABLE_TIME );/* DCR1_EPn_REQEN Clear */
@@ -443,7 +443,7 @@ static void _nbu2ss_ep_in_end( {u32 data;u32 num; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (length >=sizeof (u32))return ;
@@ -840,7 +840,7 @@ static int _nbu2ss_out_dma(u32 burst =1 ;u32 data;int result = -EINVAL ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (req->dma_flag)return 1 ;/* DMA is forwarded */
@@ -903,7 +903,7 @@ static int _nbu2ss_epn_out_pio(USB_REG_ACCESS Temp32;USB_REG_ACCESS *pBuf32;int result =0 ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (req->dma_flag)return 1 ;/* DMA is forwarded */
@@ -988,7 +988,7 @@ static int _nbu2ss_epn_out_transfer(u32 num;u32 iRecvLength;int result =1 ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (ep->epnum ==0 )return -EINVAL ;
@@ -1051,7 +1051,7 @@ static int _nbu2ss_in_dma(u32 iWriteLength;u32 data;int result = -EINVAL ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (req->dma_flag)return 1 ;/* DMA is forwarded */
@@ -1126,7 +1126,7 @@ static int _nbu2ss_epn_in_pio(USB_REG_ACCESS Temp32;USB_REG_ACCESS *pBuf32 =NULL ;int result =0 ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (req->dma_flag)return 1 ;/* DMA is forwarded */
@@ -1347,7 +1347,7 @@ static void _nbu2ss_set_endpoint_stall(u8 num, epnum;u32 data;struct nbu2ss_ep *ep; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if ((ep_adrs ==0 ) || (ep_adrs ==0x80 )) {if (bstall) {
@@ -1471,7 +1471,7 @@ static int _nbu2ss_get_ep_stall(struct nbu2ss_udc *udc, u8 ep_adrs) {u8 epnum;u32 data =0 , bit_data; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs; epnum = ep_adrs & ~USB_ENDPOINT_DIR_MASK ;if (epnum ==0 ) {
@@ -1566,7 +1566,7 @@ static void _nbu2ss_epn_set_stall(u32 regdata;int limit_cnt =0 ; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (ep->direct ==USB_DIR_IN ) { for (limit_cnt = 0
@@ -1994,7 +1994,7 @@ static inline void _nbu2ss_epn_in_int(int result =0 ;u32 status; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (req->dma_flag)return ;/* DMA is forwarded */
@@ -2090,7 +2090,7 @@ static inline void _nbu2ss_epn_out_dma_int(u32 num;u32 dmacnt, ep_dmacnt;u32 mpkt; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs; num = ep->epnum -1 ;
@@ -2293,7 +2293,7 @@ static int _nbu2ss_pullup(struct nbu2ss_udc *udc, int is_on)/*-------------------------------------------------------------------------*/ static void _nbu2ss_fifo_flush (struct nbu2ss_udc *udc,struct nbu2ss_ep *ep) { -PT_FC_REGS p = udc->p_regs; +struct fc_regs *p = udc->p_regs;if (udc->vbus_active ==0 )return ;
@@ -2536,7 +2536,7 @@ static irqreturn_t _nbu2ss_udc_irq(int irq, void *_udc)u32 epnum, int_bit;struct nbu2ss_udc *udc = (struct nbu2ss_udc *)_udc; -PT_FC_REGS preg = udc->p_regs; +struct fc_regs *preg = udc->p_regs;if (gpio_get_value (VBUS_VALUE ) ==0 ) {_nbu2ss_writel (&preg->USB_INT_STA, ~USB_INT_STA_RW );
@@ -2944,7 +2944,7 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep)struct nbu2ss_ep *ep;struct nbu2ss_udc *udc;unsigned long flags; -PT_FC_REGS preg; +struct fc_regs *preg;/* INFO("=== %s()\n", __func__); */
@@ -3341,7 +3341,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev) 0, driver_name, udc);/* IO Memory */ - udc->p_regs = (PT_FC_REGS )mmio_base; + udc->p_regs = (struct fc_regs *)mmio_base;/* USB Function Controller Interrupt */ if (status !=0 ) {
drivers/staging/emxx_udc/emxx_udc.h +11 -11
@@ -474,8 +474,8 @@/*===========================================================================*/ /* Struct */ -/*------- T_EP_REGS */ -typedef struct _T_EP_REGS { +/*------- ep_regs */ +struct ep_regs {u32 EP_CONTROL;/* EP Control */ u32 EP_STATUS;/* EP Status */ u32 EP_INT_ENA;/* EP Interrupt Enable */
@@ -484,18 +484,18 @@ typedef struct _T_EP_REGS {u32 EP_LEN_DCNT ;/* EP Length & DMA count */ u32 EP_READ ;/* EP Read */ u32 EP_WRITE ;/* EP Write */ -}T_EP_REGS , *PT_EP_REGS ; +}; -/*------- T_EP_DCR */ -typedef struct _T_EP_DCR { +/*------- ep_dcr */ +struct ep_dcr {u32 EP_DCR1;/* EP_DCR1 */ u32 EP_DCR2;/* EP_DCR2 */ u32 EP_TADR;/* EP_TADR */ u32 Reserved;/* Reserved */ -}T_EP_DCR , *PT_EP_DCR ; +};/*------- Function Registers */ -typedef struct _T_FC_REGS { +struct fc_regs {u32 USB_CONTROL;/* (0x0000) USB Control */ u32 USB_STATUS;/* (0x0004) USB Status */ u32 USB_ADDRESS;/* (0x0008) USB Address */
@@ -513,7 +513,7 @@ typedef struct _T_FC_REGS {u32 EP0_READ ;/* (0x0038) EP0 Read */ u32 EP0_WRITE ;/* (0x003C) EP0 Write */ -T_EP_REGS EP_REGS [REG_EP_NUM ];/* Endpoint Register */ +struct ep_regs EP_REGS [REG_EP_NUM ];/* Endpoint Register */ u8 Reserved220[0x1000 -0x220 ];/* (0x0220:0x0FFF) Reserved */
@@ -531,11 +531,11 @@ typedef struct _T_FC_REGS {u8 Reserved1028[0x110 -0x28 ];/* (0x1028:0x110F) Reserved */ -T_EP_DCR EP_DCR [REG_EP_NUM ];/* */ +struct ep_dcr EP_DCR [REG_EP_NUM ];/* */ u8 Reserved1200[0x1000 -0x200 ];/* Reserved */ -} __attribute__ ((aligned(32))) T_FC_REGS, *PT_FC_REGS; +} __attribute__ ((aligned(32)));
@@ -632,7 +632,7 @@ struct nbu2ss_udc {u32 curr_config;/* Current Configuration Number */ -PT_FC_REGS p_regs; +struct fc_regs *p_regs; };/* USB register access structure */
Signature · 1 line
1.9.1