[TEST PATCH] staging: emxx_udc: emxx_udc.c Avoid CamelCase

Walt Feasel waltfeasel at gmail.com
Tue Nov 22 00:27:48 EST 2016


Make suggested checkpatch modification for
CHECK: Avoid CamelCase

Signed-off-by: Walt Feasel <waltfeasel at gmail.com>
---
So here is another example of warnings I have been avoiding.
I have taken every string I found not in quotations or all capitals
and made them all lowercase.
There were far more instances then checkpatch warned of.
Are there instances when this mixed case use is acceptable?
I have tried to search for reference to this and could not find
anything other than fix it. The conversations in mailing list
saying to look in the CodingStyle file under Documents did not
help. I even did a search for 'camel', 'Camel','CamelCase',
'Camel_Case', etc...
Will other files be trying use the instances of CamelCase
I have just changed?

 drivers/staging/emxx_udc/emxx_udc.c | 524 ++++++++++++++++++------------------
 1 file changed, 262 insertions(+), 262 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 3f42fa8..7624c2d 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -152,15 +152,15 @@ static void _nbu2ss_ep0_complete(struct usb_ep *_ep, struct usb_request *_req)
 
 	udc = (struct nbu2ss_udc *)_req->context;
 	p_ctrl = &udc->ctrl;
-	if ((p_ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
-		if (p_ctrl->bRequest == USB_REQ_SET_FEATURE) {
+	if ((p_ctrl->brequesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
+		if (p_ctrl->brequest == USB_REQ_SET_FEATURE) {
 			/*-------------------------------------------------*/
 			/* SET_FEATURE */
-			recipient = (u8)(p_ctrl->bRequestType & USB_RECIP_MASK);
-			selector  = p_ctrl->wValue;
+			recipient = (u8)(p_ctrl->brequesttype & USB_RECIP_MASK);
+			selector  = p_ctrl->wvalue;
 			if ((recipient == USB_RECIP_DEVICE) &&
 			    (selector == USB_DEVICE_TEST_MODE)) {
-				test_mode = (u32)(p_ctrl->wIndex >> 8);
+				test_mode = (u32)(p_ctrl->windex >> 8);
 				_nbu2ss_set_test_mode(udc, test_mode);
 			}
 		}
@@ -200,13 +200,13 @@ static u32 _nbu2ss_get_begin_ram_address(struct nbu2ss_udc *udc)
 	for (num = 0; num < NUM_ENDPOINTS - 1; num++) {
 		p_ep_regs = &udc->p_regs->EP_REGS[num];
 		data = _nbu2ss_readl(&p_ep_regs->EP_PCKT_ADRS);
-		buf_type = _nbu2ss_readl(&p_ep_regs->EP_CONTROL) & EPn_BUF_TYPE;
+		buf_type = _nbu2ss_readl(&p_ep_regs->EP_CONTROL) & epn_buf_type;
 		if (buf_type == 0) {
 			/* Single Buffer */
-			use_ram_size += (data & EPn_MPKT) / sizeof(u32);
+			use_ram_size += (data & epn_mpkt) / sizeof(u32);
 		} else {
 			/* Double Buffer */
-			use_ram_size += ((data & EPn_MPKT) / sizeof(u32)) * 2;
+			use_ram_size += ((data & epn_mpkt) / sizeof(u32)) * 2;
 		}
 
 		if ((data >> 16) > last_ram_adr)
@@ -245,15 +245,15 @@ static int _nbu2ss_ep_init(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 	/*   Bulk, Interrupt, ISO */
 	switch (ep->ep_type) {
 	case USB_ENDPOINT_XFER_BULK:
-		data = EPn_BULK;
+		data = epn_bulk;
 		break;
 
 	case USB_ENDPOINT_XFER_INT:
-		data = EPn_BUF_SINGLE | EPn_INTERRUPT;
+		data = epn_buf_single | epn_interrupt;
 		break;
 
 	case USB_ENDPOINT_XFER_ISOC:
-		data = EPn_ISO;
+		data = epn_iso;
 		break;
 
 	default:
@@ -267,24 +267,24 @@ static int _nbu2ss_ep_init(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 	if (ep->direct == USB_DIR_OUT) {
 		/*---------------------------------------------------------*/
 		/* OUT */
-		data = EPn_EN | EPn_BCLR | EPn_DIR0;
+		data = epn_en | epn_bclr | epn_dir0;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_ONAK | EPn_OSTL_EN | EPn_OSTL;
+		data = epn_onak | epn_ostl_en | epn_ostl;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_OUT_EN | EPn_OUT_END_EN;
+		data = epn_out_en | epn_out_end_en;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_INT_ENA, data);
 	} else {
 		/*---------------------------------------------------------*/
 		/* IN */
-		data = EPn_EN | EPn_BCLR | EPn_AUTO;
+		data = epn_en | epn_bclr | epn_auto;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_ISTL;
+		data = epn_istl;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_IN_EN | EPn_IN_END_EN;
+		data = epn_in_en | epn_in_end_en;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_INT_ENA, data);
 	}
 
@@ -315,24 +315,24 @@ static int _nbu2ss_epn_exit(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 	if (ep->direct == USB_DIR_OUT) {
 		/*---------------------------------------------------------*/
 		/* OUT */
-		data = EPn_ONAK | EPn_BCLR;
+		data = epn_onak | epn_bclr;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_EN | EPn_DIR0;
+		data = epn_en | epn_dir0;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_OUT_EN | EPn_OUT_END_EN;
+		data = epn_out_en | epn_out_end_en;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_INT_ENA, data);
 	} else {
 		/*---------------------------------------------------------*/
 		/* IN */
-		data = EPn_BCLR;
+		data = epn_bclr;
 		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_EN | EPn_AUTO;
+		data = epn_en | epn_auto;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 
-		data = EPn_IN_EN | EPn_IN_END_EN;
+		data = epn_in_en | epn_in_end_en;
 		_nbu2ss_bitclr(&udc->p_regs->EP_REGS[num].EP_INT_ENA, data);
 	}
 
@@ -360,21 +360,21 @@ static void _nbu2ss_ep_dma_init(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 
 		/*---------------------------------------------------------*/
 		/* Transfer Direct */
-		data = DCR1_EPn_DIR0;
+		data = dcr1_epn_dir0;
 		_nbu2ss_bitset(&udc->p_regs->EP_DCR[num].EP_DCR1, data);
 
 		/*---------------------------------------------------------*/
 		/* DMA Mode etc. */
-		data = EPn_STOP_MODE | EPn_STOP_SET  | EPn_DMAMODE0;
+		data = epn_stop_mode | epn_stop_set  | epn_dmamode0;
 		_nbu2ss_writel(&udc->p_regs->EP_REGS[num].EP_DMA_CTRL, data);
 	} else {
 		/*---------------------------------------------------------*/
 		/* IN */
-		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, EPn_AUTO);
+		_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, epn_auto);
 
 		/*---------------------------------------------------------*/
 		/* DMA Mode etc. */
-		data = EPn_BURST_SET | EPn_DMAMODE0;
+		data = epn_burst_set | epn_dmamode0;
 		_nbu2ss_writel(&udc->p_regs->EP_REGS[num].EP_DMA_CTRL, data);
 	}
 }
@@ -402,12 +402,12 @@ static void _nbu2ss_ep_dma_exit(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 		/*---------------------------------------------------------*/
 		/* OUT */
 		_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR2, 0);
-		_nbu2ss_bitclr(&preg->EP_DCR[num].EP_DCR1, DCR1_EPn_DIR0);
+		_nbu2ss_bitclr(&preg->EP_DCR[num].EP_DCR1, dcr1_epn_dir0);
 		_nbu2ss_writel(&preg->EP_REGS[num].EP_DMA_CTRL, 0);
 	} else {
 		/*---------------------------------------------------------*/
 		/* IN */
-		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL, EPn_AUTO);
+		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL, epn_auto);
 		_nbu2ss_writel(&preg->EP_REGS[num].EP_DMA_CTRL, 0);
 	}
 }
@@ -418,9 +418,9 @@ static void _nbu2ss_ep_dma_abort(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 {
 	struct fc_regs	*preg = udc->p_regs;
 
-	_nbu2ss_bitclr(&preg->EP_DCR[ep->epnum - 1].EP_DCR1, DCR1_EPn_REQEN);
+	_nbu2ss_bitclr(&preg->EP_DCR[ep->epnum - 1].EP_DCR1, dcr1_epn_reqen);
 	mdelay(DMA_DISABLE_TIME);	/* DCR1_EPn_REQEN Clear */
-	_nbu2ss_bitclr(&preg->EP_REGS[ep->epnum - 1].EP_DMA_CTRL, EPn_DMA_EN);
+	_nbu2ss_bitclr(&preg->EP_REGS[ep->epnum - 1].EP_DMA_CTRL, epn_dma_en);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -453,16 +453,16 @@ static void _nbu2ss_ep_in_end(
 	} else {
 		num = epnum - 1;
 
-		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL, EPn_AUTO);
+		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL, epn_auto);
 
 		/* Writing of 1-4 bytes */
 		if (length)
 			_nbu2ss_writel(&preg->EP_REGS[num].EP_WRITE, data32);
 
-		data = (((length) << 5) & EPn_DW) | EPn_DEND;
+		data = (((length) << 5) & epn_dw) | epn_dend;
 		_nbu2ss_bitset(&preg->EP_REGS[num].EP_CONTROL, data);
 
-		_nbu2ss_bitset(&preg->EP_REGS[num].EP_CONTROL, EPn_AUTO);
+		_nbu2ss_bitset(&preg->EP_REGS[num].EP_CONTROL, epn_auto);
 	}
 }
 
@@ -553,25 +553,25 @@ static void _nbu2ss_dma_unmap_single(
 
 /*-------------------------------------------------------------------------*/
 /* Endpoint 0 OUT Transfer (PIO) */
-static int EP0_out_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int ep0_out_pio(struct nbu2ss_udc *udc, u8 *pbuf, u32 length)
 {
 	u32		i;
 	int		nret   = 0;
-	u32		iWordLength = 0;
-	union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf;
+	u32		iwordlength = 0;
+	union usb_reg_access *pbuf32 = (union usb_reg_access *)pbuf;
 
 	/*------------------------------------------------------------*/
 	/* Read Length */
-	iWordLength = length / sizeof(u32);
+	iwordlength = length / sizeof(u32);
 
 	/*------------------------------------------------------------*/
 	/* PIO Read */
-	if (iWordLength) {
-		for (i = 0; i < iWordLength; i++) {
-			pBuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ);
-			pBuf32++;
+	if (iwordlength) {
+		for (i = 0; i < iwordlength; i++) {
+			pbuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ);
+			pbuf32++;
 		}
-		nret = iWordLength * sizeof(u32);
+		nret = iwordlength * sizeof(u32);
 	}
 
 	return nret;
@@ -579,65 +579,65 @@ static int EP0_out_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
 
 /*-------------------------------------------------------------------------*/
 /* Endpoint 0 OUT Transfer (PIO, OverBytes) */
-static int EP0_out_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int ep0_out_overbytes(struct nbu2ss_udc *udc, u8 *pbuf, u32 length)
 {
 	u32		i;
-	u32		iReadSize = 0;
-	union usb_reg_access  Temp32;
-	union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+	u32		ireadsize = 0;
+	union usb_reg_access  temp32;
+	union usb_reg_access  *pbuf32 = (union usb_reg_access *)pbuf;
 
 	if ((length > 0) && (length < sizeof(u32))) {
-		Temp32.dw = _nbu2ss_readl(&udc->p_regs->EP0_READ);
+		temp32.dw = _nbu2ss_readl(&udc->p_regs->EP0_READ);
 		for (i = 0 ; i < length ; i++)
-			pBuf32->byte.DATA[i] = Temp32.byte.DATA[i];
-		iReadSize += length;
+			pbuf32->byte.DATA[i] = temp32.byte.DATA[i];
+		ireadsize += length;
 	}
 
-	return iReadSize;
+	return ireadsize;
 }
 
 /*-------------------------------------------------------------------------*/
 /* Endpoint 0 IN Transfer (PIO) */
-static int EP0_in_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
+static int ep0_in_pio(struct nbu2ss_udc *udc, u8 *pbuf, u32 length)
 {
 	u32		i;
-	u32		iMaxLength   = EP0_PACKETSIZE;
-	u32		iWordLength  = 0;
-	u32		iWriteLength = 0;
-	union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+	u32		imaxlength   = EP0_PACKETSIZE;
+	u32		iwordlength  = 0;
+	u32		iwritelength = 0;
+	union usb_reg_access  *pbuf32 = (union usb_reg_access *)pbuf;
 
 	/*------------------------------------------------------------*/
 	/* Transfer Length */
-	if (iMaxLength < length)
-		iWordLength = iMaxLength / sizeof(u32);
+	if (imaxlength < length)
+		iwordlength = imaxlength / sizeof(u32);
 	else
-		iWordLength = length / sizeof(u32);
+		iwordlength = length / sizeof(u32);
 
 	/*------------------------------------------------------------*/
 	/* PIO */
-	for (i = 0; i < iWordLength; i++) {
-		_nbu2ss_writel(&udc->p_regs->EP0_WRITE, pBuf32->dw);
-		pBuf32++;
-		iWriteLength += sizeof(u32);
+	for (i = 0; i < iwordlength; i++) {
+		_nbu2ss_writel(&udc->p_regs->EP0_WRITE, pbuf32->dw);
+		pbuf32++;
+		iwritelength += sizeof(u32);
 	}
 
-	return iWriteLength;
+	return iwritelength;
 }
 
 /*-------------------------------------------------------------------------*/
 /* Endpoint 0 IN Transfer (PIO, OverBytes) */
-static int EP0_in_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
+static int ep0_in_overbytes(struct nbu2ss_udc *udc, u8 *pbuf, u32 iremainsize)
 {
 	u32		i;
-	union usb_reg_access  Temp32;
-	union usb_reg_access  *pBuf32 = (union usb_reg_access *)pBuf;
+	union usb_reg_access  temp32;
+	union usb_reg_access  *pbuf32 = (union usb_reg_access *)pbuf;
 
-	if ((iRemainSize > 0) && (iRemainSize < sizeof(u32))) {
-		for (i = 0 ; i < iRemainSize ; i++)
-			Temp32.byte.DATA[i] = pBuf32->byte.DATA[i];
-		_nbu2ss_ep_in_end(udc, 0, Temp32.dw, iRemainSize);
+	if ((iremainsize > 0) && (iremainsize < sizeof(u32))) {
+		for (i = 0 ; i < iremainsize ; i++)
+			temp32.byte.DATA[i] = pbuf32->byte.DATA[i];
+		_nbu2ss_ep_in_end(udc, 0, temp32.dw, iremainsize);
 
-		return iRemainSize;
+		return iremainsize;
 	}
 
 	return 0;
@@ -645,7 +645,7 @@ static int EP0_in_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
 
 /*-------------------------------------------------------------------------*/
 /* Transfer NULL Packet (Epndoint 0) */
-static int EP0_send_NULL(struct nbu2ss_udc *udc, bool pid_flag)
+static int ep0_send_null(struct nbu2ss_udc *udc, bool pid_flag)
 {
 	u32		data;
 
@@ -664,7 +664,7 @@ static int EP0_send_NULL(struct nbu2ss_udc *udc, bool pid_flag)
 
 /*-------------------------------------------------------------------------*/
 /* Receive NULL Packet (Endpoint 0) */
-static int EP0_receive_NULL(struct nbu2ss_udc *udc, bool pid_flag)
+static int ep0_receive_null(struct nbu2ss_udc *udc, bool pid_flag)
 {
 	u32		data;
 
@@ -685,9 +685,9 @@ static int _nbu2ss_ep0_in_transfer(
 	struct nbu2ss_req *req
 )
 {
-	u8		*pBuffer;			/* IN Data Buffer */
+	u8		*pbuffer;			/* IN Data Buffer */
 	u32		data;
-	u32		iRemainSize = 0;
+	u32		iremainsize = 0;
 	int		result = 0;
 
 	/*-------------------------------------------------------------*/
@@ -696,7 +696,7 @@ static int _nbu2ss_ep0_in_transfer(
 		if ((req->req.actual % EP0_PACKETSIZE) == 0) {
 			if (req->zero) {
 				req->zero = false;
-				EP0_send_NULL(udc, FALSE);
+				ep0_send_null(udc, FALSE);
 				return 1;
 			}
 		}
@@ -711,25 +711,25 @@ static int _nbu2ss_ep0_in_transfer(
 	data &= ~(u32)EP0_INAK;
 	_nbu2ss_writel(&udc->p_regs->EP0_CONTROL, data);
 
-	iRemainSize = req->req.length - req->req.actual;
-	pBuffer = (u8 *)req->req.buf;
-	pBuffer += req->req.actual;
+	iremainsize = req->req.length - req->req.actual;
+	pbuffer = (u8 *)req->req.buf;
+	pbuffer += req->req.actual;
 
 	/*-------------------------------------------------------------*/
 	/* Data transfer */
-	result = EP0_in_PIO(udc, pBuffer, iRemainSize);
+	result = ep0_in_pio(udc, pbuffer, iremainsize);
 
 	req->div_len = result;
-	iRemainSize -= result;
+	iremainsize -= result;
 
-	if (iRemainSize == 0) {
-		EP0_send_NULL(udc, FALSE);
+	if (iremainsize == 0) {
+		ep0_send_null(udc, FALSE);
 		return result;
 	}
 
-	if ((iRemainSize < sizeof(u32)) && (result != EP0_PACKETSIZE)) {
-		pBuffer += result;
-		result += EP0_in_OverBytes(udc, pBuffer, iRemainSize);
+	if ((iremainsize < sizeof(u32)) && (result != EP0_PACKETSIZE)) {
+		pbuffer += result;
+		result += ep0_in_overbytes(udc, pbuffer, iremainsize);
 		req->div_len = result;
 	}
 
@@ -742,40 +742,40 @@ static int _nbu2ss_ep0_out_transfer(
 	struct nbu2ss_req *req
 )
 {
-	u8		*pBuffer;
-	u32		iRemainSize;
-	u32		iRecvLength;
+	u8		*pbuffer;
+	u32		iremainsize;
+	u32		irecvlength;
 	int		result = 0;
-	int		fRcvZero;
+	int		frcvzero;
 
 	/*-------------------------------------------------------------*/
 	/* Receive data confirmation */
-	iRecvLength = _nbu2ss_readl(&udc->p_regs->EP0_LENGTH) & EP0_LDATA;
-	if (iRecvLength != 0) {
-		fRcvZero = 0;
+	irecvlength = _nbu2ss_readl(&udc->p_regs->EP0_LENGTH) & EP0_LDATA;
+	if (irecvlength != 0) {
+		frcvzero = 0;
 
-		iRemainSize = req->req.length - req->req.actual;
-		pBuffer = (u8 *)req->req.buf;
-		pBuffer += req->req.actual;
+		iremainsize = req->req.length - req->req.actual;
+		pbuffer = (u8 *)req->req.buf;
+		pbuffer += req->req.actual;
 
-		result = EP0_out_PIO(udc, pBuffer
-					, min(iRemainSize, iRecvLength));
+		result = ep0_out_pio(udc, pbuffer
+					, min(iremainsize, irecvlength));
 		if (result < 0)
 			return result;
 
 		req->req.actual += result;
-		iRecvLength -= result;
+		irecvlength -= result;
 
-		if ((iRecvLength > 0) && (iRecvLength < sizeof(u32))) {
-			pBuffer += result;
-			iRemainSize -= result;
+		if ((irecvlength > 0) && (irecvlength < sizeof(u32))) {
+			pbuffer += result;
+			iremainsize -= result;
 
-			result = EP0_out_OverBytes(udc, pBuffer
-					, min(iRemainSize, iRecvLength));
+			result = ep0_out_overbytes(udc, pbuffer
+					, min(iremainsize, irecvlength));
 			req->req.actual += result;
 		}
 	} else {
-		fRcvZero = 1;
+		frcvzero = 1;
 	}
 
 	/*-------------------------------------------------------------*/
@@ -784,7 +784,7 @@ static int _nbu2ss_ep0_out_transfer(
 		if ((req->req.actual % EP0_PACKETSIZE) == 0) {
 			if (req->zero) {
 				req->zero = false;
-				EP0_receive_NULL(udc, FALSE);
+				ep0_receive_null(udc, FALSE);
 				return 1;
 			}
 		}
@@ -800,9 +800,9 @@ static int _nbu2ss_ep0_out_transfer(
 		return -EOVERFLOW;
 	}
 
-	if (fRcvZero != 0) {
-		iRemainSize = _nbu2ss_readl(&udc->p_regs->EP0_CONTROL);
-		if (iRemainSize & EP0_ONAK) {
+	if (frcvzero != 0) {
+		iremainsize = _nbu2ss_readl(&udc->p_regs->EP0_CONTROL);
+		if (iremainsize & EP0_ONAK) {
 			/*---------------------------------------------------*/
 			/* NACK release */
 			_nbu2ss_bitclr(&udc->p_regs->EP0_CONTROL, EP0_ONAK);
@@ -821,7 +821,7 @@ static int _nbu2ss_out_dma(
 	u32		length
 )
 {
-	dma_addr_t	pBuffer;
+	dma_addr_t	pbuffer;
 	u32		mpkt;
 	u32		lmpkt;
 	u32		dmacnt;
@@ -834,14 +834,14 @@ static int _nbu2ss_out_dma(
 		return 1;		/* DMA is forwarded */
 
 	req->dma_flag = TRUE;
-	pBuffer = req->req.dma;
-	pBuffer += req->req.actual;
+	pbuffer = req->req.dma;
+	pbuffer += req->req.actual;
 
 	/* DMA Address */
-	_nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pBuffer);
+	_nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pbuffer);
 
 	/* Number of transfer packets */
-	mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPn_MPKT;
+	mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & epn_mpkt;
 	dmacnt = length / mpkt;
 	lmpkt = (length % mpkt) & ~(u32)0x03;
 
@@ -857,18 +857,18 @@ static int _nbu2ss_out_dma(
 	data = mpkt | (lmpkt << 16);
 	_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR2, data);
 
-	data = ((dmacnt & 0xff) << 16) | DCR1_EPn_DIR0 | DCR1_EPn_REQEN;
+	data = ((dmacnt & 0xff) << 16) | dcr1_epn_dir0 | dcr1_epn_reqen;
 	_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR1, data);
 
 	if (burst == 0) {
 		_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, 0);
-		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_BURST_SET);
+		_nbu2ss_bitclr(&preg->EP_REGS[num].EP_DMA_CTRL, epn_burst_set);
 	} else {
 		_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT
 				, (dmacnt << 16));
-		_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_BURST_SET);
+		_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, epn_burst_set);
 	}
-	_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_DMA_EN);
+	_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, epn_dma_en);
 
 	result = length & ~(u32)0x03;
 	req->div_len = result;
@@ -884,12 +884,12 @@ static int _nbu2ss_epn_out_pio(
 	u32		length
 )
 {
-	u8		*pBuffer;
+	u8		*pbuffer;
 	u32		i;
 	u32		data;
-	u32		iWordLength;
-	union usb_reg_access	Temp32;
-	union usb_reg_access	*pBuf32;
+	u32		iwordlength;
+	union usb_reg_access	temp32;
+	union usb_reg_access	*pbuf32;
 	int		result = 0;
 	struct fc_regs	*preg = udc->p_regs;
 
@@ -899,28 +899,28 @@ static int _nbu2ss_epn_out_pio(
 	if (length == 0)
 		return 0;
 
-	pBuffer = (u8 *)req->req.buf;
-	pBuf32 = (union usb_reg_access *)(pBuffer + req->req.actual);
+	pbuffer = (u8 *)req->req.buf;
+	pbuf32 = (union usb_reg_access *)(pbuffer + req->req.actual);
 
-	iWordLength = length / sizeof(u32);
-	if (iWordLength > 0) {
+	iwordlength = length / sizeof(u32);
+	if (iwordlength > 0) {
 		/*---------------------------------------------------------*/
 		/* Copy of every four bytes */
-		for (i = 0; i < iWordLength; i++) {
-			pBuf32->dw =
+		for (i = 0; i < iwordlength; i++) {
+			pbuf32->dw =
 			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
-			pBuf32++;
+			pbuf32++;
 		}
-		result = iWordLength * sizeof(u32);
+		result = iwordlength * sizeof(u32);
 	}
 
 	data = length - result;
 	if (data > 0) {
 		/*---------------------------------------------------------*/
 		/* Copy of fraction byte */
-		Temp32.dw = _nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
+		temp32.dw = _nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_READ);
 		for (i = 0 ; i < data ; i++)
-			pBuf32->byte.DATA[i] = Temp32.byte.DATA[i];
+			pbuf32->byte.DATA[i] = temp32.byte.DATA[i];
 		result += data;
 	}
 
@@ -943,7 +943,7 @@ static int _nbu2ss_epn_out_data(
 )
 {
 	u32		num;
-	u32		iBufSize;
+	u32		ibufsize;
 	int		nret = 1;
 
 	if (ep->epnum == 0)
@@ -951,14 +951,14 @@ static int _nbu2ss_epn_out_data(
 
 	num = ep->epnum - 1;
 
-	iBufSize = min((req->req.length - req->req.actual), data_size);
+	ibufsize = min((req->req.length - req->req.actual), data_size);
 
 	if ((ep->ep_type != USB_ENDPOINT_XFER_INT) && (req->req.dma != 0) &&
-	    (iBufSize  >= sizeof(u32))) {
-		nret = _nbu2ss_out_dma(udc, req, num, iBufSize);
+	    (ibufsize  >= sizeof(u32))) {
+		nret = _nbu2ss_out_dma(udc, req, num, ibufsize);
 	} else {
-		iBufSize = min_t(u32, iBufSize, ep->ep.maxpacket);
-		nret = _nbu2ss_epn_out_pio(udc, ep, req, iBufSize);
+		ibufsize = min_t(u32, ibufsize, ep->ep.maxpacket);
+		nret = _nbu2ss_epn_out_pio(udc, ep, req, ibufsize);
 	}
 
 	return nret;
@@ -972,7 +972,7 @@ static int _nbu2ss_epn_out_transfer(
 )
 {
 	u32		num;
-	u32		iRecvLength;
+	u32		irecvlength;
 	int		result = 1;
 	struct fc_regs	*preg = udc->p_regs;
 
@@ -983,13 +983,13 @@ static int _nbu2ss_epn_out_transfer(
 
 	/*-------------------------------------------------------------*/
 	/* Receive Length */
-	iRecvLength
-		= _nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT) & EPn_LDATA;
+	irecvlength
+		= _nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT) & epn_ldata;
 
-	if (iRecvLength != 0) {
-		result = _nbu2ss_epn_out_data(udc, ep, req, iRecvLength);
-		if (iRecvLength < ep->ep.maxpacket) {
-			if (iRecvLength == result) {
+	if (irecvlength != 0) {
+		result = _nbu2ss_epn_out_data(udc, ep, req, irecvlength);
+		if (irecvlength < ep->ep.maxpacket) {
+			if (irecvlength == result) {
 				req->req.actual += result;
 				result = 0;
 			}
@@ -1029,11 +1029,11 @@ static int _nbu2ss_in_dma(
 	u32		length
 )
 {
-	dma_addr_t	pBuffer;
+	dma_addr_t	pbuffer;
 	u32		mpkt;		/* MaxPacketSize */
 	u32		lmpkt;		/* Last Packet Data Size */
 	u32		dmacnt;		/* IN Data Size */
-	u32		iWriteLength;
+	u32		iwritelength;
 	u32		data;
 	int		result = -EINVAL;
 	struct fc_regs	*preg = udc->p_regs;
@@ -1048,18 +1048,18 @@ static int _nbu2ss_in_dma(
 	req->dma_flag = TRUE;
 
 	/* MAX Packet Size */
-	mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPn_MPKT;
+	mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & epn_mpkt;
 
 	if ((DMA_MAX_COUNT * mpkt) < length)
-		iWriteLength = DMA_MAX_COUNT * mpkt;
+		iwritelength = DMA_MAX_COUNT * mpkt;
 	else
-		iWriteLength = length;
+		iwritelength = length;
 
 	/*------------------------------------------------------------*/
 	/* Number of transmission packets */
-	if (mpkt < iWriteLength) {
-		dmacnt = iWriteLength / mpkt;
-		lmpkt  = (iWriteLength % mpkt) & ~(u32)0x3;
+	if (mpkt < iwritelength) {
+		dmacnt = iwritelength / mpkt;
+		lmpkt  = (iwritelength % mpkt) & ~(u32)0x3;
 		if (lmpkt != 0)
 			dmacnt++;
 		else
@@ -1067,7 +1067,7 @@ static int _nbu2ss_in_dma(
 
 	} else {
 		dmacnt = 1;
-		lmpkt  = iWriteLength & ~(u32)0x3;
+		lmpkt  = iwritelength & ~(u32)0x3;
 	}
 
 	/* Packet setting */
@@ -1075,12 +1075,12 @@ static int _nbu2ss_in_dma(
 	_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR2, data);
 
 	/* Address setting */
-	pBuffer = req->req.dma;
-	pBuffer += req->req.actual;
-	_nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pBuffer);
+	pbuffer = req->req.dma;
+	pbuffer += req->req.actual;
+	_nbu2ss_writel(&preg->EP_DCR[num].EP_TADR, (u32)pbuffer);
 
 	/* Packet and DMA setting */
-	data = ((dmacnt & 0xff) << 16) | DCR1_EPn_REQEN;
+	data = ((dmacnt & 0xff) << 16) | dcr1_epn_reqen;
 	_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR1, data);
 
 	/* Packet setting of EPC */
@@ -1088,9 +1088,9 @@ static int _nbu2ss_in_dma(
 	_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, data);
 
 	/*DMA setting of EPC */
-	_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_DMA_EN);
+	_nbu2ss_bitset(&preg->EP_REGS[num].EP_DMA_CTRL, epn_dma_en);
 
-	result = iWriteLength & ~(u32)0x3;
+	result = iwritelength & ~(u32)0x3;
 	req->div_len = result;
 
 	return result;
@@ -1104,12 +1104,12 @@ static int _nbu2ss_epn_in_pio(
 	u32		length
 )
 {
-	u8		*pBuffer;
+	u8		*pbuffer;
 	u32		i;
 	u32		data;
-	u32		iWordLength;
-	union usb_reg_access	Temp32;
-	union usb_reg_access	*pBuf32 = NULL;
+	u32		iwordlength;
+	union usb_reg_access	temp32;
+	union usb_reg_access	*pbuf32 = NULL;
 	int		result = 0;
 	struct fc_regs	*preg = udc->p_regs;
 
@@ -1117,30 +1117,30 @@ static int _nbu2ss_epn_in_pio(
 		return 1;		/* DMA is forwarded */
 
 	if (length > 0) {
-		pBuffer = (u8 *)req->req.buf;
-		pBuf32 = (union usb_reg_access *)(pBuffer + req->req.actual);
+		pbuffer = (u8 *)req->req.buf;
+		pbuf32 = (union usb_reg_access *)(pbuffer + req->req.actual);
 
-		iWordLength = length / sizeof(u32);
-		if (iWordLength > 0) {
-			for (i = 0; i < iWordLength; i++) {
+		iwordlength = length / sizeof(u32);
+		if (iwordlength > 0) {
+			for (i = 0; i < iwordlength; i++) {
 				_nbu2ss_writel(
 					&preg->EP_REGS[ep->epnum - 1].EP_WRITE
-					, pBuf32->dw
+					, pbuf32->dw
 				);
 
-				pBuf32++;
+				pbuf32++;
 			}
-			result = iWordLength * sizeof(u32);
+			result = iwordlength * sizeof(u32);
 		}
 	}
 
 	if (result != ep->ep.maxpacket) {
 		data = length - result;
-		Temp32.dw = 0;
+		temp32.dw = 0;
 		for (i = 0 ; i < data ; i++)
-			Temp32.byte.DATA[i] = pBuf32->byte.DATA[i];
+			temp32.byte.DATA[i] = pbuf32->byte.DATA[i];
 
-		_nbu2ss_ep_in_end(udc, ep->epnum, Temp32.dw, data);
+		_nbu2ss_ep_in_end(udc, ep->epnum, temp32.dw, data);
 		result += data;
 	}
 
@@ -1184,7 +1184,7 @@ static int _nbu2ss_epn_in_transfer(
 )
 {
 	u32		num;
-	u32		iBufSize;
+	u32		ibufsize;
 	int		result = 0;
 	u32		status;
 
@@ -1198,19 +1198,19 @@ static int _nbu2ss_epn_in_transfer(
 	/*-------------------------------------------------------------*/
 	/* State confirmation of FIFO */
 	if (req->req.actual == 0) {
-		if ((status & EPn_IN_EMPTY) == 0)
+		if ((status & epn_in_empty) == 0)
 			return 1;	/* Not Empty */
 
 	} else {
-		if ((status & EPn_IN_FULL) != 0)
+		if ((status & epn_in_full) != 0)
 			return 1;	/* Not Empty */
 	}
 
 	/*-------------------------------------------------------------*/
 	/* Start transfer */
-	iBufSize = req->req.length - req->req.actual;
-	if (iBufSize > 0)
-		result = _nbu2ss_epn_in_data(udc, ep, req, iBufSize);
+	ibufsize = req->req.length - req->req.actual;
+	if (ibufsize > 0)
+		result = _nbu2ss_epn_in_data(udc, ep, req, ibufsize);
 	else if (req->req.length == 0)
 		_nbu2ss_zero_len_pkt(udc, ep->epnum);
 
@@ -1250,7 +1250,7 @@ static int _nbu2ss_start_transfer(
 			break;
 
 		case EP0_IN_STATUS_PHASE:
-			nret = EP0_send_NULL(udc, TRUE);
+			nret = ep0_send_null(udc, TRUE);
 			break;
 
 		default:
@@ -1287,7 +1287,7 @@ static void _nbu2ss_restert_transfer(struct nbu2ss_ep *ep)
 		length = _nbu2ss_readl(
 			&ep->udc->p_regs->EP_REGS[ep->epnum - 1].EP_LEN_DCNT);
 
-		length &= EPn_LDATA;
+		length &= epn_ldata;
 		if (length < ep->ep.maxpacket)
 			bflag = TRUE;
 	}
@@ -1310,9 +1310,9 @@ static void _nbu2ss_endpoint_toggle_reset(
 	num = (ep_adrs & 0x7F) - 1;
 
 	if (ep_adrs & USB_DIR_IN)
-		data = EPn_IPIDCLR;
+		data = epn_ipidclr;
 	else
-		data = EPn_BCLR | EPn_OPIDCLR;
+		data = epn_bclr | epn_opidclr;
 
 	_nbu2ss_bitset(&udc->p_regs->EP_REGS[num].EP_CONTROL, data);
 }
@@ -1347,9 +1347,9 @@ static void _nbu2ss_set_endpoint_stall(
 			ep->halted = TRUE;
 
 			if (ep_adrs & USB_DIR_IN)
-				data = EPn_BCLR | EPn_ISTL;
+				data = epn_bclr | epn_istl;
 			else
-				data = EPn_OSTL_EN | EPn_OSTL;
+				data = epn_ostl_en | epn_ostl;
 
 			_nbu2ss_bitset(&preg->EP_REGS[num].EP_CONTROL, data);
 		} else {
@@ -1357,13 +1357,13 @@ static void _nbu2ss_set_endpoint_stall(
 			ep->stalled = FALSE;
 			if (ep_adrs & USB_DIR_IN) {
 				_nbu2ss_bitclr(&preg->EP_REGS[num].EP_CONTROL
-						, EPn_ISTL);
+						, epn_istl);
 			} else {
 				data =
 				_nbu2ss_readl(&preg->EP_REGS[num].EP_CONTROL);
 
-				data &= ~EPn_OSTL;
-				data |= EPn_OSTL_EN;
+				data &= ~epn_ostl;
+				data |= epn_ostl_en;
 
 				_nbu2ss_writel(&preg->EP_REGS[num].EP_CONTROL
 						, data);
@@ -1381,20 +1381,20 @@ static void _nbu2ss_set_endpoint_stall(
 /*-------------------------------------------------------------------------*/
 /* Device Descriptor */
 static struct usb_device_descriptor device_desc = {
-	.bLength              = sizeof(device_desc),
-	.bDescriptorType      = USB_DT_DEVICE,
-	.bcdUSB               = cpu_to_le16(0x0200),
-	.bDeviceClass         = USB_CLASS_VENDOR_SPEC,
-	.bDeviceSubClass      = 0x00,
-	.bDeviceProtocol      = 0x00,
-	.bMaxPacketSize0      = 64,
-	.idVendor             = cpu_to_le16(0x0409),
-	.idProduct            = cpu_to_le16(0xfff0),
-	.bcdDevice            = 0xffff,
-	.iManufacturer        = 0x00,
-	.iProduct             = 0x00,
-	.iSerialNumber        = 0x00,
-	.bNumConfigurations   = 0x01,
+	.blength              = sizeof(device_desc),
+	.bdescriptortype      = USB_DT_DEVICE,
+	.bcdusb               = cpu_to_le16(0x0200),
+	.bdeviceclass         = USB_CLASS_VENDOR_SPEC,
+	.bdevicesubclass      = 0x00,
+	.bdeviceprotocol      = 0x00,
+	.bmaxpacketsize0      = 64,
+	.idvendor             = cpu_to_le16(0x0409),
+	.idproduct            = cpu_to_le16(0xfff0),
+	.bcddevice            = 0xffff,
+	.imanufacturer        = 0x00,
+	.iproduct             = 0x00,
+	.iserialnumber        = 0x00,
+	.bnumconfigurations   = 0x01,
 };
 
 /*-------------------------------------------------------------------------*/
@@ -1426,15 +1426,15 @@ static int _nbu2ss_set_feature_device(
 
 	switch (selector) {
 	case USB_DEVICE_REMOTE_WAKEUP:
-		if (wIndex == 0x0000) {
+		if (windex == 0x0000) {
 			udc->remote_wakeup = U2F_ENABLE;
 			result = 0;
 		}
 		break;
 
 	case USB_DEVICE_TEST_MODE:
-		wIndex >>= 8;
-		if (wIndex <= MAX_TEST_MODE_NUM)
+		windex >>= 8;
+		if (windex <= MAX_TEST_MODE_NUM)
 			result = 0;
 		break;
 
@@ -1459,13 +1459,13 @@ static int _nbu2ss_get_ep_stall(struct nbu2ss_udc *udc, u8 ep_adrs)
 
 	} else {
 		data = _nbu2ss_readl(&preg->EP_REGS[epnum - 1].EP_CONTROL);
-		if ((data & EPn_EN) == 0)
+		if ((data & epn_en) == 0)
 			return -1;
 
 		if (ep_adrs & USB_ENDPOINT_DIR_MASK)
-			bit_data = EPn_ISTL;
+			bit_data = epn_istl;
 		else
-			bit_data = EPn_OSTL;
+			bit_data = epn_ostl;
 	}
 
 	if ((data & bit_data) == 0)
@@ -1476,14 +1476,14 @@ static int _nbu2ss_get_ep_stall(struct nbu2ss_udc *udc, u8 ep_adrs)
 /*-------------------------------------------------------------------------*/
 static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
 {
-	u8	recipient = (u8)(udc->ctrl.bRequestType & USB_RECIP_MASK);
-	u8	direction = (u8)(udc->ctrl.bRequestType & USB_DIR_IN);
-	u16	selector  = udc->ctrl.wValue;
-	u16	wIndex    = udc->ctrl.wIndex;
+	u8	recipient = (u8)(udc->ctrl.brequesttype & USB_RECIP_MASK);
+	u8	direction = (u8)(udc->ctrl.brequesttype & USB_DIR_IN);
+	u16	selector  = udc->ctrl.wvalue;
+	u16	windex    = udc->ctrl.windex;
 	u8	ep_adrs;
 	int	result = -EOPNOTSUPP;
 
-	if ((udc->ctrl.wLength != 0x0000) ||
+	if ((udc->ctrl.wlength != 0x0000) ||
 	    (direction != USB_DIR_OUT)) {
 		return -EINVAL;
 	}
@@ -1492,13 +1492,13 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
 	case USB_RECIP_DEVICE:
 		if (bset)
 			result =
-			_nbu2ss_set_feature_device(udc, selector, wIndex);
+			_nbu2ss_set_feature_device(udc, selector, windex);
 		break;
 
 	case USB_RECIP_ENDPOINT:
-		if (0x0000 == (wIndex & 0xFF70)) {
+		if (0x0000 == (windex & 0xFF70)) {
 			if (selector == USB_ENDPOINT_HALT) {
-				ep_adrs = wIndex & 0xFF;
+				ep_adrs = windex & 0xFF;
 				if (!bset) {
 					_nbu2ss_endpoint_toggle_reset(
 						udc, ep_adrs);
@@ -1554,7 +1554,7 @@ static void _nbu2ss_epn_set_stall(
 			regdata = _nbu2ss_readl(
 				&preg->EP_REGS[ep->epnum - 1].EP_STATUS);
 
-			if ((regdata & EPn_IN_DATA) == 0)
+			if ((regdata & epn_in_data) == 0)
 				break;
 
 			mdelay(1);
@@ -1570,19 +1570,19 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 {
 	u32	length;
 	u16	status_data = 0;
-	u8	recipient = (u8)(udc->ctrl.bRequestType & USB_RECIP_MASK);
-	u8	direction = (u8)(udc->ctrl.bRequestType & USB_DIR_IN);
+	u8	recipient = (u8)(udc->ctrl.brequesttype & USB_RECIP_MASK);
+	u8	direction = (u8)(udc->ctrl.brequesttype & USB_DIR_IN);
 	u8	ep_adrs;
 	int	result = -EINVAL;
 
-	if ((udc->ctrl.wValue != 0x0000) || (direction != USB_DIR_IN))
+	if ((udc->ctrl.wvalue != 0x0000) || (direction != USB_DIR_IN))
 		return result;
 
-	length = min_t(u16, udc->ctrl.wLength, sizeof(status_data));
+	length = min_t(u16, udc->ctrl.wlength, sizeof(status_data));
 
 	switch (recipient) {
 	case USB_RECIP_DEVICE:
-		if (udc->ctrl.wIndex == 0x0000) {
+		if (udc->ctrl.windex == 0x0000) {
 			if (udc->gadget.is_selfpowered)
 				status_data |= (1 << USB_DEVICE_SELF_POWERED);
 
@@ -1594,8 +1594,8 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
 		break;
 
 	case USB_RECIP_ENDPOINT:
-		if (0x0000 == (udc->ctrl.wIndex & 0xFF70)) {
-			ep_adrs = (u8)(udc->ctrl.wIndex & 0xFF);
+		if (0x0000 == (udc->ctrl.windex & 0xFF70)) {
+			ep_adrs = (u8)(udc->ctrl.windex & 0xFF);
 			result = _nbu2ss_get_ep_stall(udc, ep_adrs);
 
 			if (result > 0)
@@ -1635,20 +1635,20 @@ static int std_req_set_feature(struct nbu2ss_udc *udc)
 static int std_req_set_address(struct nbu2ss_udc *udc)
 {
 	int		result = 0;
-	u32		wValue = udc->ctrl.wValue;
+	u32		wvalue = udc->ctrl.wvalue;
 
-	if ((udc->ctrl.bRequestType != 0x00)	||
-	    (udc->ctrl.wIndex != 0x0000)	||
-		(udc->ctrl.wLength != 0x0000)) {
+	if ((udc->ctrl.brequesttype != 0x00)	||
+	    (udc->ctrl.windex != 0x0000)	||
+		(udc->ctrl.wlength != 0x0000)) {
 		return -EINVAL;
 	}
 
-	if (wValue != (wValue & 0x007F))
+	if (wvalue != (wvalue & 0x007F))
 		return -EINVAL;
 
-	wValue <<= USB_ADRS_SHIFT;
+	wvalue <<= USB_ADRS_SHIFT;
 
-	_nbu2ss_writel(&udc->p_regs->USB_ADDRESS, wValue);
+	_nbu2ss_writel(&udc->p_regs->USB_ADDRESS, wvalue);
 	_nbu2ss_create_ep0_packet(udc, udc->ep0_buf, 0);
 
 	return result;
@@ -1657,17 +1657,17 @@ static int std_req_set_address(struct nbu2ss_udc *udc)
 /*-------------------------------------------------------------------------*/
 static int std_req_set_configuration(struct nbu2ss_udc *udc)
 {
-	u32 ConfigValue = (u32)(udc->ctrl.wValue & 0x00ff);
+	u32 configvalue = (u32)(udc->ctrl.wvalue & 0x00ff);
 
-	if ((udc->ctrl.wIndex != 0x0000)	||
-	    (udc->ctrl.wLength != 0x0000)	||
-		(udc->ctrl.bRequestType != 0x00)) {
+	if ((udc->ctrl.windex != 0x0000)	||
+	    (udc->ctrl.wlength != 0x0000)	||
+		(udc->ctrl.brequesttype != 0x00)) {
 		return -EINVAL;
 	}
 
-	udc->curr_config = ConfigValue;
+	udc->curr_config = configvalue;
 
-	if (ConfigValue > 0) {
+	if (configvalue > 0) {
 		_nbu2ss_bitset(&udc->p_regs->USB_CONTROL, CONF);
 		udc->devstate = USB_STATE_CONFIGURED;
 
@@ -1701,18 +1701,18 @@ static inline int _nbu2ss_decode_request(struct nbu2ss_udc *udc)
 	_nbu2ss_read_request_data(udc, (u32 *)p_ctrl);
 
 	/* ep0 state control */
-	if (p_ctrl->wLength == 0) {
+	if (p_ctrl->wlength == 0) {
 		udc->ep0state = EP0_IN_STATUS_PHASE;
 
 	} else {
-		if (p_ctrl->bRequestType & USB_DIR_IN)
+		if (p_ctrl->brequesttype & USB_DIR_IN)
 			udc->ep0state = EP0_IN_DATA_PHASE;
 		else
 			udc->ep0state = EP0_OUT_DATA_PHASE;
 	}
 
-	if ((p_ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
-		switch (p_ctrl->bRequest) {
+	if ((p_ctrl->brequesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
+		switch (p_ctrl->brequest) {
 		case USB_REQ_GET_STATUS:
 			nret = std_req_get_status(udc);
 			bcall_back = FALSE;
@@ -1747,7 +1747,7 @@ static inline int _nbu2ss_decode_request(struct nbu2ss_udc *udc)
 			if (nret >= 0) {
 				/*--------------------------------------*/
 				/* Status Stage */
-				nret = EP0_send_NULL(udc, TRUE);
+				nret = ep0_send_null(udc, TRUE);
 			}
 		}
 
@@ -1780,7 +1780,7 @@ static inline int _nbu2ss_ep0_in_data_stage(struct nbu2ss_udc *udc)
 	nret = _nbu2ss_ep0_in_transfer(udc, req);
 	if (nret == 0) {
 		udc->ep0state = EP0_OUT_STATUS_PAHSE;
-		EP0_receive_NULL(udc, TRUE);
+		ep0_receive_null(udc, TRUE);
 	}
 
 	return 0;
@@ -1800,7 +1800,7 @@ static inline int _nbu2ss_ep0_out_data_stage(struct nbu2ss_udc *udc)
 	nret = _nbu2ss_ep0_out_transfer(udc, req);
 	if (nret == 0) {
 		udc->ep0state = EP0_IN_STATUS_PHASE;
-		EP0_send_NULL(udc, TRUE);
+		ep0_send_null(udc, TRUE);
 
 	} else if (nret < 0) {
 		_nbu2ss_bitset(&udc->p_regs->EP0_CONTROL, EP0_BCLR);
@@ -1974,7 +1974,7 @@ static inline void _nbu2ss_epn_in_int(
 			status =
 			_nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_STATUS);
 
-			if ((status & EPn_IN_FULL) == 0) {
+			if ((status & epn_in_full) == 0) {
 				/*-----------------------------------------*/
 				/* 0 Length Packet */
 				req->zero = false;
@@ -2065,18 +2065,18 @@ static inline void _nbu2ss_epn_out_dma_int(
 	}
 
 	ep_dmacnt = _nbu2ss_readl(&preg->EP_REGS[num].EP_LEN_DCNT)
-		 & EPn_DMACNT;
+		 & epn_dmacnt;
 	ep_dmacnt >>= 16;
 
 	for (i = 0; i < EPC_PLL_LOCK_COUNT; i++) {
 		dmacnt = _nbu2ss_readl(&preg->EP_DCR[num].EP_DCR1)
-			 & DCR1_EPn_DMACNT;
+			 & dcr1_epn_dmacnt;
 		dmacnt >>= 16;
 		if (ep_dmacnt == dmacnt)
 			break;
 	}
 
-	_nbu2ss_bitclr(&preg->EP_DCR[num].EP_DCR1, DCR1_EPn_REQEN);
+	_nbu2ss_bitclr(&preg->EP_DCR[num].EP_DCR1, dcr1_epn_reqen);
 
 	if (dmacnt != 0) {
 		mpkt = ep->ep.maxpacket;
@@ -2123,20 +2123,20 @@ static inline void _nbu2ss_epn_int(struct nbu2ss_udc *udc, u32 epnum)
 		return;
 	}
 
-	if (status & EPn_OUT_END_INT) {
-		status &= ~EPn_OUT_INT;
+	if (status & epn_out_end_int) {
+		status &= ~epn_out_int;
 		_nbu2ss_epn_out_dma_int(udc, ep, req);
 	}
 
-	if (status & EPn_OUT_INT)
+	if (status & epn_out_int)
 		_nbu2ss_epn_out_int(udc, ep, req);
 
-	if (status & EPn_IN_END_INT) {
-		status &= ~EPn_IN_INT;
+	if (status & epn_in_end_int) {
+		status &= ~epn_in_int;
 		_nbu2ss_epn_in_dma_int(udc, ep, req);
 	}
 
-	if (status & EPn_IN_INT)
+	if (status & epn_in_int)
 		_nbu2ss_epn_in_int(udc, ep, req);
 }
 
@@ -2239,7 +2239,7 @@ static void _nbu2ss_fifo_flush(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep)
 	} else {
 		/* EPn */
 		_nbu2ss_ep_dma_abort(udc, ep);
-		_nbu2ss_bitset(&p->EP_REGS[ep->epnum - 1].EP_CONTROL, EPn_BCLR);
+		_nbu2ss_bitset(&p->EP_REGS[ep->epnum - 1].EP_CONTROL, epn_bclr);
 	}
 }
 
@@ -2484,7 +2484,7 @@ static irqreturn_t _nbu2ss_udc_irq(int irq, void *_udc)
 			suspend_flag = 1;
 		}
 
-		if (status & EPn_INT) {
+		if (status & epn_int) {
 			/* EP INT */
 			int_bit = status >> 8;
 
@@ -2551,13 +2551,13 @@ static int nbu2ss_ep_enable(
 
 	ep->desc = desc;
 	ep->epnum = usb_endpoint_num(desc);
-	ep->direct = desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
+	ep->direct = desc->bendpointaddress & USB_ENDPOINT_DIR_MASK;
 	ep->ep_type = ep_type;
 	ep->wedged = 0;
 	ep->halted = FALSE;
 	ep->stalled = FALSE;
 
-	ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize);
+	ep->ep.maxpacket = le16_to_cpu(desc->wmaxpacketsize);
 
 	/* DMA setting */
 	_nbu2ss_ep_dma_init(udc, ep);
@@ -2874,7 +2874,7 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep)
 
 	} else {
 		data = _nbu2ss_readl(&preg->EP_REGS[ep->epnum - 1].EP_LEN_DCNT)
-			& EPn_LDATA;
+			& epn_ldata;
 	}
 
 	spin_unlock_irqrestore(&udc->lock, flags);
-- 
2.1.4




More information about the Kernelnewbies mailing list