Commit 2f8e9ec9 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace bEndCount with nr_endpoints

Search and replace bEndCount with nr_endpoints
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 8e66bb23
...@@ -1601,7 +1601,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb) ...@@ -1601,7 +1601,7 @@ static inline void __init musb_g_init_endpoints(struct musb *musb)
INIT_LIST_HEAD(&(musb->g.ep_list)); INIT_LIST_HEAD(&(musb->g.ep_list));
for (bEnd = 0, hw_ep = musb->endpoints; for (bEnd = 0, hw_ep = musb->endpoints;
bEnd < musb->bEndCount; bEnd < musb->nr_endpoints;
bEnd++, hw_ep++) { bEnd++, hw_ep++) {
if (hw_ep->bIsSharedFifo /* || !bEnd */) { if (hw_ep->bIsSharedFifo /* || !bEnd */) {
init_peripheral_ep(musb, &hw_ep->ep_in, bEnd, 0); init_peripheral_ep(musb, &hw_ep->ep_in, bEnd, 0);
...@@ -1797,7 +1797,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver) ...@@ -1797,7 +1797,7 @@ stop_activity(struct musb *musb, struct usb_gadget_driver *driver)
*/ */
if (driver) { if (driver) {
for (i = 0, hw_ep = musb->endpoints; for (i = 0, hw_ep = musb->endpoints;
i < musb->bEndCount; i < musb->nr_endpoints;
i++, hw_ep++) { i++, hw_ep++) {
MGC_SelectEnd(musb->mregs, i); MGC_SelectEnd(musb->mregs, i);
if (hw_ep->bIsSharedFifo /* || !bEnd */) { if (hw_ep->bIsSharedFifo /* || !bEnd */) {
......
...@@ -1706,7 +1706,7 @@ static int musb_schedule( ...@@ -1706,7 +1706,7 @@ static int musb_schedule(
wBestDiff = 4096; wBestDiff = 4096;
nBestEnd = -1; nBestEnd = -1;
for (nEnd = 1; nEnd < musb->bEndCount; nEnd++) { for (nEnd = 1; nEnd < musb->nr_endpoints; nEnd++) {
int diff; int diff;
if (musb->periodic[nEnd]) if (musb->periodic[nEnd])
......
...@@ -528,7 +528,7 @@ static int dump_header_stats(struct musb *musb, char *buffer) ...@@ -528,7 +528,7 @@ static int dump_header_stats(struct musb *musb, char *buffer)
#endif #endif
", debug=%d [eps=%d]\n", ", debug=%d [eps=%d]\n",
debug, debug,
musb->bEndCount); musb->nr_endpoints);
if (code <= 0) if (code <= 0)
goto done; goto done;
count += code; count += code;
...@@ -802,7 +802,7 @@ static int musb_proc_read(char *page, char **start, ...@@ -802,7 +802,7 @@ static int musb_proc_read(char *page, char **start,
/* generate the report for the end points */ /* generate the report for the end points */
// REVISIT ... not unless something's connected! // REVISIT ... not unless something's connected!
for (bEnd = 0; count >= 0 && bEnd < musb->bEndCount; for (bEnd = 0; count >= 0 && bEnd < musb->nr_endpoints;
bEnd++) { bEnd++) {
code = dump_end_info(musb, bEnd, buffer, count); code = dump_end_info(musb, bEnd, buffer, count);
if (code > 0) { if (code > 0) {
......
...@@ -403,7 +403,7 @@ struct musb { ...@@ -403,7 +403,7 @@ struct musb {
#define VBUSERR_RETRY_COUNT 3 #define VBUSERR_RETRY_COUNT 3
u16 vbuserr_retry; u16 vbuserr_retry;
u16 wEndMask; u16 wEndMask;
u8 bEndCount; u8 nr_endpoints;
u8 board_mode; /* enum musb_mode */ u8 board_mode; /* enum musb_mode */
int (*board_set_power)(int state); int (*board_set_power)(int state);
......
...@@ -671,7 +671,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB, ...@@ -671,7 +671,7 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 bIntrUSB,
/* start any periodic Tx transfers waiting for current frame */ /* start any periodic Tx transfers waiting for current frame */
wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME); wFrame = musb_readw(mbase, MGC_O_HDRC_FRAME);
ep = musb->endpoints; ep = musb->endpoints;
for (bEnd = 1; (bEnd < musb->bEndCount) for (bEnd = 1; (bEnd < musb->nr_endpoints)
&& (musb->wEndMask >= (1 << bEnd)); && (musb->wEndMask >= (1 << bEnd));
bEnd++, ep++) { bEnd++, ep++) {
// FIXME handle framecounter wraps (12 bits) // FIXME handle framecounter wraps (12 bits)
...@@ -1153,7 +1153,7 @@ static int __init ep_config_from_table(struct musb *musb) ...@@ -1153,7 +1153,7 @@ static int __init ep_config_from_table(struct musb *musb)
return -EINVAL; return -EINVAL;
} }
epn++; epn++;
musb->bEndCount = max(epn, musb->bEndCount); musb->nr_endpoints = max(epn, musb->nr_endpoints);
} }
printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n", printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
...@@ -1196,7 +1196,7 @@ static int __init ep_config_from_hw(struct musb *musb) ...@@ -1196,7 +1196,7 @@ static int __init ep_config_from_hw(struct musb *musb)
/* 0's returned when no more endpoints */ /* 0's returned when no more endpoints */
break; break;
} }
musb->bEndCount++; musb->nr_endpoints++;
musb->wEndMask |= (1 << bEnd); musb->wEndMask |= (1 << bEnd);
hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f); hw_ep->wMaxPacketSizeTx = 1 << (reg & 0x0f);
...@@ -1338,7 +1338,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) ...@@ -1338,7 +1338,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE; musb->endpoints[0].wMaxPacketSizeRx = MGC_END0_FIFOSIZE;
/* discover endpoint configuration */ /* discover endpoint configuration */
musb->bEndCount = 1; musb->nr_endpoints = 1;
musb->wEndMask = 1; musb->wEndMask = 1;
if (reg & MGC_M_CONFIGDATA_DYNFIFO) { if (reg & MGC_M_CONFIGDATA_DYNFIFO) {
...@@ -1361,7 +1361,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb) ...@@ -1361,7 +1361,7 @@ static int __init musb_core_init(u16 wType, struct musb *musb)
return status; return status;
/* finish init, and print endpoint config */ /* finish init, and print endpoint config */
for (i = 0; i < musb->bEndCount; i++) { for (i = 0; i < musb->nr_endpoints; i++) {
struct musb_hw_ep *hw_ep = musb->endpoints + i; struct musb_hw_ep *hw_ep = musb->endpoints + i;
hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase; hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
......
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