]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/musb/g_ep0.c
musb_hdrc: Search and replace bRecip with recip
[linux-2.6-omap-h63xx.git] / drivers / usb / musb / g_ep0.c
index 4d2838b4c5d239d7ea9bcff4f11d15b755d02926..c85e60292dd606746361c04b76b96ccd719475ec 100644 (file)
@@ -72,33 +72,33 @@ static char *decode_ep0stage(u8 stage)
  */
 static int service_tx_status_request(
        struct musb *musb,
-       const struct usb_ctrlrequest *pControlRequest)
+       const struct usb_ctrlrequest *ctrlrequest)
 {
        void __iomem    *mbase = musb->mregs;
        int handled = 1;
-       u8 bResult[2], epnum = 0;
-       const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK;
+       u8 result[2], epnum = 0;
+       const u8 recip = ctrlrequest->bRequestType & USB_RECIP_MASK;
 
-       bResult[1] = 0;
+       result[1] = 0;
 
-       switch (bRecip) {
+       switch (recip) {
        case USB_RECIP_DEVICE:
-               bResult[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED;
-               bResult[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP;
+               result[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED;
+               result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP;
 #ifdef CONFIG_USB_MUSB_OTG
                if (musb->g.is_otg) {
-                       bResult[0] |= musb->g.b_hnp_enable
+                       result[0] |= musb->g.b_hnp_enable
                                << USB_DEVICE_B_HNP_ENABLE;
-                       bResult[0] |= musb->g.a_alt_hnp_support
+                       result[0] |= musb->g.a_alt_hnp_support
                                << USB_DEVICE_A_ALT_HNP_SUPPORT;
-                       bResult[0] |= musb->g.a_hnp_support
+                       result[0] |= musb->g.a_hnp_support
                                << USB_DEVICE_A_HNP_SUPPORT;
                }
 #endif
                break;
 
        case USB_RECIP_INTERFACE:
-               bResult[0] = 0;
+               result[0] = 0;
                break;
 
        case USB_RECIP_ENDPOINT: {
@@ -107,9 +107,9 @@ static int service_tx_status_request(
                u16             tmp;
                void __iomem    *regs;
 
-               epnum = (u8) pControlRequest->wIndex;
+               epnum = (u8) ctrlrequest->wIndex;
                if (!epnum) {
-                       bResult[0] = 0;
+                       result[0] = 0;
                        break;
                }
 
@@ -136,7 +136,7 @@ static int service_tx_status_request(
                                                & MGC_M_RXCSR_P_SENDSTALL;
                musb_ep_select(mbase, 0);
 
-               bResult[0] = tmp ? 1 : 0;
+               result[0] = tmp ? 1 : 0;
                } break;
 
        default:
@@ -147,11 +147,11 @@ static int service_tx_status_request(
 
        /* fill up the fifo; caller updates csr0 */
        if (handled > 0) {
-               u16     len = le16_to_cpu(pControlRequest->wLength);
+               u16     len = le16_to_cpu(ctrlrequest->wLength);
 
                if (len > 2)
                        len = 2;
-               musb_write_fifo(&musb->endpoints[0], len, bResult);
+               musb_write_fifo(&musb->endpoints[0], len, result);
        }
 
        return handled;
@@ -170,16 +170,16 @@ static int service_tx_status_request(
  */
 static int
 service_in_request(struct musb *musb,
-               const struct usb_ctrlrequest *pControlRequest)
+               const struct usb_ctrlrequest *ctrlrequest)
 {
        int handled = 0;        /* not handled */
 
-       if ((pControlRequest->bRequestType & USB_TYPE_MASK)
+       if ((ctrlrequest->bRequestType & USB_TYPE_MASK)
                        == USB_TYPE_STANDARD) {
-               switch (pControlRequest->bRequest) {
+               switch (ctrlrequest->bRequest) {
                case USB_REQ_GET_STATUS:
                        handled = service_tx_status_request(musb,
-                                       pControlRequest);
+                                       ctrlrequest);
                        break;
 
                /* case USB_REQ_SYNC_FRAME: */
@@ -225,29 +225,29 @@ static inline void musb_try_b_hnp_enable(struct musb *musb)
  */
 static int
 service_zero_data_request(struct musb *musb,
-               struct usb_ctrlrequest *pControlRequest)
+               struct usb_ctrlrequest *ctrlrequest)
 __releases(musb->lock)
 __acquires(musb->lock)
 {
        int handled = -EINVAL;
        void __iomem *mbase = musb->mregs;
-       const u8 bRecip = pControlRequest->bRequestType & USB_RECIP_MASK;
+       const u8 recip = ctrlrequest->bRequestType & USB_RECIP_MASK;
 
        /* the gadget driver handles everything except what we MUST handle */
-       if ((pControlRequest->bRequestType & USB_TYPE_MASK)
+       if ((ctrlrequest->bRequestType & USB_TYPE_MASK)
                        == USB_TYPE_STANDARD) {
-               switch (pControlRequest->bRequest) {
+               switch (ctrlrequest->bRequest) {
                case USB_REQ_SET_ADDRESS:
                        /* change it after the status stage */
-                       musb->bSetAddress = TRUE;
-                       musb->address = (u8) (pControlRequest->wValue & 0x7f);
+                       musb->set_address = TRUE;
+                       musb->address = (u8) (ctrlrequest->wValue & 0x7f);
                        handled = 1;
                        break;
 
                case USB_REQ_CLEAR_FEATURE:
-                       switch (bRecip) {
+                       switch (recip) {
                        case USB_RECIP_DEVICE:
-                               if (pControlRequest->wValue
+                               if (ctrlrequest->wValue
                                                != USB_DEVICE_REMOTE_WAKEUP)
                                        break;
                                musb->may_wakeup = 0;
@@ -256,16 +256,16 @@ __acquires(musb->lock)
                        case USB_RECIP_INTERFACE:
                                break;
                        case USB_RECIP_ENDPOINT:{
-                               const u8 epnum = pControlRequest->wIndex & 0x0f;
+                               const u8 epnum = ctrlrequest->wIndex & 0x0f;
                                struct musb_ep *musb_ep;
 
                                if (epnum == 0
                                                || epnum >= MUSB_C_NUM_EPS
-                                               || pControlRequest->wValue
+                                               || ctrlrequest->wValue
                                                        != USB_ENDPOINT_HALT)
                                        break;
 
-                               if (pControlRequest->wIndex & USB_DIR_IN)
+                               if (ctrlrequest->wIndex & USB_DIR_IN)
                                        musb_ep = &musb->endpoints[epnum].ep_in;
                                else
                                        musb_ep = &musb->endpoints[epnum].ep_out;
@@ -289,20 +289,20 @@ __acquires(musb->lock)
                        break;
 
                case USB_REQ_SET_FEATURE:
-                       switch (bRecip) {
+                       switch (recip) {
                        case USB_RECIP_DEVICE:
                                handled = 1;
-                               switch (pControlRequest->wValue) {
+                               switch (ctrlrequest->wValue) {
                                case USB_DEVICE_REMOTE_WAKEUP:
                                        musb->may_wakeup = 1;
                                        break;
                                case USB_DEVICE_TEST_MODE:
                                        if (musb->g.speed != USB_SPEED_HIGH)
                                                goto stall;
-                                       if (pControlRequest->wIndex & 0xff)
+                                       if (ctrlrequest->wIndex & 0xff)
                                                goto stall;
 
-                                       switch (pControlRequest->wIndex >> 8) {
+                                       switch (ctrlrequest->wIndex >> 8) {
                                        case 1:
                                                pr_debug("TEST_J\n");
                                                /* TEST_J */
@@ -365,7 +365,7 @@ stall:
 
                        case USB_RECIP_ENDPOINT:{
                                const u8                epnum =
-                                       pControlRequest->wIndex & 0x0f;
+                                       ctrlrequest->wIndex & 0x0f;
                                struct musb_ep          *musb_ep;
                                struct musb_hw_ep       *ep;
                                void __iomem            *regs;
@@ -374,13 +374,13 @@ stall:
 
                                if (epnum == 0
                                                || epnum >= MUSB_C_NUM_EPS
-                                               || pControlRequest->wValue
+                                               || ctrlrequest->wValue
                                                        != USB_ENDPOINT_HALT)
                                        break;
 
                                ep = musb->endpoints + epnum;
                                regs = ep->regs;
-                               is_in = pControlRequest->wIndex & USB_DIR_IN;
+                               is_in = ctrlrequest->wIndex & USB_DIR_IN;
                                if (is_in)
                                        musb_ep = &ep->ep_in;
                                else
@@ -559,7 +559,7 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req)
         * the TX FIFO right away, and give the controller a moment
         * to switch modes...
         */
-       musb->bSetAddress = FALSE;
+       musb->set_address = FALSE;
        musb->ackpend = MGC_M_CSR0_P_SVDRXPKTRDY;
        if (req->wLength == 0) {
                if (req->bRequestType & USB_DIR_IN)
@@ -578,15 +578,15 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req)
 
 static int
 forward_to_driver(struct musb *musb,
-               const struct usb_ctrlrequest *pControlRequest)
+               const struct usb_ctrlrequest *ctrlrequest)
 __releases(musb->lock)
 __acquires(musb->lock)
 {
        int retval;
-       if (!musb->pGadgetDriver)
+       if (!musb->gadget_driver)
                return -EOPNOTSUPP;
        spin_unlock(&musb->lock);
-       retval = musb->pGadgetDriver->setup(&musb->g, pControlRequest);
+       retval = musb->gadget_driver->setup(&musb->g, ctrlrequest);
        spin_lock(&musb->lock);
        return retval;
 }
@@ -661,8 +661,8 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb)
                 * we get 10 msec to receive this irq... until this
                 * is done we won't see the next packet.
                 */
-               if (musb->bSetAddress) {
-                       musb->bSetAddress = FALSE;
+               if (musb->set_address) {
+                       musb->set_address = FALSE;
                        musb_writeb(mbase, MGC_O_HDRC_FADDR, musb->address);
                }