Commit 00ed6729 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace bEndNumber with current_epnum

Search and replace bEndNumber with current_epnum
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 2f8e9ec9
...@@ -159,7 +159,7 @@ __acquires(ep->musb->Lock) ...@@ -159,7 +159,7 @@ __acquires(ep->musb->Lock)
static void nuke(struct musb_ep *ep, const int status) static void nuke(struct musb_ep *ep, const int status)
{ {
struct musb_request *req = NULL; struct musb_request *req = NULL;
void __iomem *epio = ep->musb->endpoints[ep->bEndNumber].regs; void __iomem *epio = ep->musb->endpoints[ep->current_epnum].regs;
ep->busy = 1; ep->busy = 1;
...@@ -869,7 +869,7 @@ static int musb_gadget_enable(struct usb_ep *ep, ...@@ -869,7 +869,7 @@ static int musb_gadget_enable(struct usb_ep *ep,
regs = hw_ep->regs; regs = hw_ep->regs;
musb = musb_ep->musb; musb = musb_ep->musb;
mbase = musb->mregs; mbase = musb->mregs;
bEnd = musb_ep->bEndNumber; bEnd = musb_ep->current_epnum;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->Lock, flags);
...@@ -1006,7 +1006,7 @@ static int musb_gadget_disable(struct usb_ep *ep) ...@@ -1006,7 +1006,7 @@ static int musb_gadget_disable(struct usb_ep *ep)
musb_ep = to_musb_ep(ep); musb_ep = to_musb_ep(ep);
musb = musb_ep->musb; musb = musb_ep->musb;
bEnd = musb_ep->bEndNumber; bEnd = musb_ep->current_epnum;
epio = musb->endpoints[bEnd].regs; epio = musb->endpoints[bEnd].regs;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->Lock, flags);
...@@ -1052,7 +1052,7 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) ...@@ -1052,7 +1052,7 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags)
if (pRequest) { if (pRequest) {
INIT_LIST_HEAD(&pRequest->request.list); INIT_LIST_HEAD(&pRequest->request.list);
pRequest->request.dma = DMA_ADDR_INVALID; pRequest->request.dma = DMA_ADDR_INVALID;
pRequest->bEnd = musb_ep->bEndNumber; pRequest->bEnd = musb_ep->current_epnum;
pRequest->ep = musb_ep; pRequest->ep = musb_ep;
} }
...@@ -1121,7 +1121,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, ...@@ -1121,7 +1121,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
/* request is mine now... */ /* request is mine now... */
pRequest->request.actual = 0; pRequest->request.actual = 0;
pRequest->request.status = -EINPROGRESS; pRequest->request.status = -EINPROGRESS;
pRequest->bEnd = musb_ep->bEndNumber; pRequest->bEnd = musb_ep->current_epnum;
pRequest->bTx = musb_ep->is_in; pRequest->bTx = musb_ep->is_in;
if (is_dma_capable() && musb_ep->dma) { if (is_dma_capable() && musb_ep->dma) {
...@@ -1201,7 +1201,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest) ...@@ -1201,7 +1201,7 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *pRequest)
else if (is_dma_capable() && musb_ep->dma) { else if (is_dma_capable() && musb_ep->dma) {
struct dma_controller *c = musb->pDmaController; struct dma_controller *c = musb->pDmaController;
MGC_SelectEnd(musb->mregs, musb_ep->bEndNumber); MGC_SelectEnd(musb->mregs, musb_ep->current_epnum);
if (c->channel_abort) if (c->channel_abort)
status = c->channel_abort(musb_ep->dma); status = c->channel_abort(musb_ep->dma);
else else
...@@ -1229,7 +1229,7 @@ done: ...@@ -1229,7 +1229,7 @@ done:
int musb_gadget_set_halt(struct usb_ep *ep, int value) int musb_gadget_set_halt(struct usb_ep *ep, int value)
{ {
struct musb_ep *musb_ep = to_musb_ep(ep); struct musb_ep *musb_ep = to_musb_ep(ep);
u8 bEnd = musb_ep->bEndNumber; u8 bEnd = musb_ep->current_epnum;
struct musb *musb = musb_ep->musb; struct musb *musb = musb_ep->musb;
void __iomem *epio = musb->endpoints[bEnd].regs; void __iomem *epio = musb->endpoints[bEnd].regs;
void __iomem *mbase; void __iomem *mbase;
...@@ -1311,7 +1311,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep) ...@@ -1311,7 +1311,7 @@ static int musb_gadget_fifo_status(struct usb_ep *ep)
if (musb_ep->desc && !musb_ep->is_in) { if (musb_ep->desc && !musb_ep->is_in) {
struct musb *musb = musb_ep->musb; struct musb *musb = musb_ep->musb;
int bEnd = musb_ep->bEndNumber; int bEnd = musb_ep->current_epnum;
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
unsigned long flags; unsigned long flags;
...@@ -1330,7 +1330,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep) ...@@ -1330,7 +1330,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep)
{ {
struct musb_ep *musb_ep = to_musb_ep(ep); struct musb_ep *musb_ep = to_musb_ep(ep);
struct musb *musb = musb_ep->musb; struct musb *musb = musb_ep->musb;
u8 nEnd = musb_ep->bEndNumber; u8 nEnd = musb_ep->current_epnum;
void __iomem *epio = musb->endpoints[nEnd].regs; void __iomem *epio = musb->endpoints[nEnd].regs;
void __iomem *mbase; void __iomem *mbase;
unsigned long flags; unsigned long flags;
...@@ -1561,7 +1561,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in) ...@@ -1561,7 +1561,7 @@ init_peripheral_ep(struct musb *musb, struct musb_ep *ep, u8 bEnd, int is_in)
memset(ep, 0, sizeof *ep); memset(ep, 0, sizeof *ep);
ep->bEndNumber = bEnd; ep->current_epnum = bEnd;
ep->musb = musb; ep->musb = musb;
ep->hw_ep = hw_ep; ep->hw_ep = hw_ep;
ep->is_in = is_in; ep->is_in = is_in;
......
...@@ -62,7 +62,7 @@ struct musb_ep { ...@@ -62,7 +62,7 @@ struct musb_ep {
char name[12]; char name[12];
struct musb_hw_ep *hw_ep; struct musb_hw_ep *hw_ep;
struct musb *musb; struct musb *musb;
u8 bEndNumber; u8 current_epnum;
/* ... when enabled/disabled ... */ /* ... when enabled/disabled ... */
u8 type; u8 type;
......
...@@ -153,10 +153,10 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) ...@@ -153,10 +153,10 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max)
code = snprintf(buf, max, code = snprintf(buf, max,
"\n%s (hw%d): %s%s, csr %04x maxp %04x\n", "\n%s (hw%d): %s%s, csr %04x maxp %04x\n",
ep->name, ep->bEndNumber, ep->name, ep->current_epnum,
mode, ep->dma ? " dma" : "", mode, ep->dma ? " dma" : "",
musb_readw(regs, musb_readw(regs,
(ep->is_in || !ep->bEndNumber) (ep->is_in || !ep->current_epnum)
? MGC_O_HDRC_TXCSR ? MGC_O_HDRC_TXCSR
: MGC_O_HDRC_RXCSR), : MGC_O_HDRC_RXCSR),
musb_readw(regs, ep->is_in musb_readw(regs, ep->is_in
...@@ -169,8 +169,8 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) ...@@ -169,8 +169,8 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max)
buf += code; buf += code;
max -= code; max -= code;
if (is_cppi_enabled() && ep->bEndNumber) { if (is_cppi_enabled() && ep->current_epnum) {
unsigned cppi = ep->bEndNumber - 1; unsigned cppi = ep->current_epnum - 1;
void __iomem *base = ep->musb->ctrl_base; void __iomem *base = ep->musb->ctrl_base;
unsigned off1 = cppi << 2; unsigned off1 = cppi << 2;
void __iomem *ram = base; void __iomem *ram = base;
...@@ -190,7 +190,7 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) ...@@ -190,7 +190,7 @@ static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max)
"%08x %08x, %08x %08x; " "%08x %08x, %08x %08x; "
"%08x %08x %08x .. %08x\n", "%08x %08x %08x .. %08x\n",
ep->is_in ? 'T' : 'R', ep->is_in ? 'T' : 'R',
ep->bEndNumber - 1, tmp, ep->current_epnum - 1, tmp,
musb_readl(ram, 0 * 4), musb_readl(ram, 0 * 4),
musb_readl(ram, 1 * 4), musb_readl(ram, 1 * 4),
musb_readl(ram, 2 * 4), musb_readl(ram, 2 * 4),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment