Commit 64c78579 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

musb_hdrc: Fixes before pulling from mainline tree

Latest musb_hdrc code wouldn't:
  * build ... because there's now a standard WARN() macro
  * build without false printf format warnings ... "%zd" is for ssize_t,
    while "%zu" is for size_t
Signed-off-by: default avatarDavid Brownell <david-b@pacbell.net>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 205f37af
...@@ -862,10 +862,10 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket) ...@@ -862,10 +862,10 @@ cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket)
/* we always expect at least one reusable BD! */ /* we always expect at least one reusable BD! */
if (!tail) { if (!tail) {
WARN("rx dma%d -- no BDs? need %d\n", rx->index, n_bds); WARNING("rx dma%d -- no BDs? need %d\n", rx->index, n_bds);
return; return;
} else if (i < n_bds) } else if (i < n_bds)
WARN("rx dma%d -- only %d of %d BDs\n", rx->index, i, n_bds); WARNING("rx dma%d -- only %d of %d BDs\n", rx->index, i, n_bds);
tail->next = NULL; tail->next = NULL;
tail->hw_next = 0; tail->hw_next = 0;
...@@ -963,13 +963,13 @@ static int cppi_channel_program(struct dma_channel *ch, ...@@ -963,13 +963,13 @@ static int cppi_channel_program(struct dma_channel *ch,
case MUSB_DMA_STATUS_BUS_ABORT: case MUSB_DMA_STATUS_BUS_ABORT:
case MUSB_DMA_STATUS_CORE_ABORT: case MUSB_DMA_STATUS_CORE_ABORT:
/* fault irq handler should have handled cleanup */ /* fault irq handler should have handled cleanup */
WARN("%cX DMA%d not cleaned up after abort!\n", WARNING("%cX DMA%d not cleaned up after abort!\n",
cppi_ch->transmit ? 'T' : 'R', cppi_ch->transmit ? 'T' : 'R',
cppi_ch->index); cppi_ch->index);
/* WARN_ON(1); */ /* WARN_ON(1); */
break; break;
case MUSB_DMA_STATUS_BUSY: case MUSB_DMA_STATUS_BUSY:
WARN("program active channel? %cX DMA%d\n", WARNING("program active channel? %cX DMA%d\n",
cppi_ch->transmit ? 'T' : 'R', cppi_ch->transmit ? 'T' : 'R',
cppi_ch->index); cppi_ch->index);
/* WARN_ON(1); */ /* WARN_ON(1); */
......
...@@ -120,7 +120,7 @@ void musb_platform_disable(struct musb *musb) ...@@ -120,7 +120,7 @@ void musb_platform_disable(struct musb *musb)
musb_writel(musb->ctrl_base, DAVINCI_USB_EOI_REG, 0); musb_writel(musb->ctrl_base, DAVINCI_USB_EOI_REG, 0);
if (is_dma_capable() && !dma_off) if (is_dma_capable() && !dma_off)
WARN("dma still active\n"); WARNING("dma still active\n");
} }
...@@ -329,7 +329,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) ...@@ -329,7 +329,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
musb->int_usb &= ~MUSB_INTR_VBUSERROR; musb->int_usb &= ~MUSB_INTR_VBUSERROR;
musb->xceiv.state = OTG_STATE_A_WAIT_VFALL; musb->xceiv.state = OTG_STATE_A_WAIT_VFALL;
mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
WARN("VBUS error workaround (delay coming)\n"); WARNING("VBUS error workaround (delay coming)\n");
} else if (is_host_enabled(musb) && drvvbus) { } else if (is_host_enabled(musb) && drvvbus) {
musb->is_active = 1; musb->is_active = 1;
MUSB_HST_MODE(musb); MUSB_HST_MODE(musb);
......
...@@ -443,7 +443,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -443,7 +443,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
MUSB_DEV_MODE(musb); MUSB_DEV_MODE(musb);
break; break;
default: default:
WARN("bogus %s RESUME (%s)\n", WARNING("bogus %s RESUME (%s)\n",
"host", "host",
otg_state_string(musb)); otg_state_string(musb));
} }
...@@ -477,7 +477,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -477,7 +477,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
break; break;
#endif #endif
default: default:
WARN("bogus %s RESUME (%s)\n", WARNING("bogus %s RESUME (%s)\n",
"peripheral", "peripheral",
otg_state_string(musb)); otg_state_string(musb));
} }
...@@ -799,7 +799,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb, ...@@ -799,7 +799,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
break; break;
#endif /* GADGET */ #endif /* GADGET */
default: default:
WARN("unhandled DISCONNECT transition (%s)\n", WARNING("unhandled DISCONNECT transition (%s)\n",
otg_state_string(musb)); otg_state_string(musb));
break; break;
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#define yprintk(facility, format, args...) \ #define yprintk(facility, format, args...) \
do { printk(facility "%s %d: " format , \ do { printk(facility "%s %d: " format , \
__func__, __LINE__ , ## args); } while (0) __func__, __LINE__ , ## args); } while (0)
#define WARN(fmt, args...) yprintk(KERN_WARNING, fmt, ## args) #define WARNING(fmt, args...) yprintk(KERN_WARNING, fmt, ## args)
#define INFO(fmt, args...) yprintk(KERN_INFO, fmt, ## args) #define INFO(fmt, args...) yprintk(KERN_INFO, fmt, ## args)
#define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args) #define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args)
......
...@@ -466,7 +466,7 @@ void musb_g_tx(struct musb *musb, u8 epnum) ...@@ -466,7 +466,7 @@ void musb_g_tx(struct musb *musb, u8 epnum)
csr = musb_readw(epio, MUSB_TXCSR); csr = musb_readw(epio, MUSB_TXCSR);
request->actual += musb_ep->dma->actual_len; request->actual += musb_ep->dma->actual_len;
DBG(4, "TXCSR%d %04x, dma off, " DBG(4, "TXCSR%d %04x, dma off, "
"len %Zd, req %p\n", "len %zu, req %p\n",
epnum, csr, epnum, csr,
musb_ep->dma->actual_len, musb_ep->dma->actual_len,
request); request);
...@@ -795,7 +795,7 @@ void musb_g_rx(struct musb *musb, u8 epnum) ...@@ -795,7 +795,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
request->actual += musb_ep->dma->actual_len; request->actual += musb_ep->dma->actual_len;
DBG(4, "RXCSR%d %04x, dma off, %04x, len %Zd, req %p\n", DBG(4, "RXCSR%d %04x, dma off, %04x, len %zu, req %p\n",
epnum, csr, epnum, csr,
musb_readw(epio, MUSB_RXCSR), musb_readw(epio, MUSB_RXCSR),
musb_ep->dma->actual_len, request); musb_ep->dma->actual_len, request);
...@@ -1886,7 +1886,7 @@ void musb_g_resume(struct musb *musb) ...@@ -1886,7 +1886,7 @@ void musb_g_resume(struct musb *musb)
} }
break; break;
default: default:
WARN("unhandled RESUME transition (%s)\n", WARNING("unhandled RESUME transition (%s)\n",
otg_state_string(musb)); otg_state_string(musb));
} }
} }
...@@ -1916,7 +1916,7 @@ void musb_g_suspend(struct musb *musb) ...@@ -1916,7 +1916,7 @@ void musb_g_suspend(struct musb *musb)
/* REVISIT if B_HOST, clear DEVCTL.HOSTREQ; /* REVISIT if B_HOST, clear DEVCTL.HOSTREQ;
* A_PERIPHERAL may need care too * A_PERIPHERAL may need care too
*/ */
WARN("unhandled SUSPEND transition (%s)\n", WARNING("unhandled SUSPEND transition (%s)\n",
otg_state_string(musb)); otg_state_string(musb));
} }
} }
......
...@@ -584,7 +584,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep) ...@@ -584,7 +584,7 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, struct musb_hw_ep *ep)
} else { } else {
csr = musb_readw(ep->regs, MUSB_RXCSR); csr = musb_readw(ep->regs, MUSB_RXCSR);
if (csr & MUSB_RXCSR_RXPKTRDY) if (csr & MUSB_RXCSR_RXPKTRDY)
WARN("rx%d, packet/%d ready?\n", ep->epnum, WARNING("rx%d, packet/%d ready?\n", ep->epnum,
musb_readw(ep->regs, MUSB_RXCOUNT)); musb_readw(ep->regs, MUSB_RXCOUNT));
musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG); musb_h_flush_rxfifo(ep, MUSB_RXCSR_CLRDATATOG);
...@@ -1403,7 +1403,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1403,7 +1403,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
pipe = urb->pipe; pipe = urb->pipe;
DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zd)\n", DBG(5, "<== hw %d rxcsr %04x, urb actual %d (+dma %zu)\n",
epnum, rx_csr, urb->actual_length, epnum, rx_csr, urb->actual_length,
dma ? dma->actual_len : 0); dma ? dma->actual_len : 0);
...@@ -1486,7 +1486,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) ...@@ -1486,7 +1486,7 @@ void musb_host_rx(struct musb *musb, u8 epnum)
done = true; done = true;
} }
DBG(2, "RXCSR%d %04x, reqpkt, len %zd%s\n", epnum, rx_csr, DBG(2, "RXCSR%d %04x, reqpkt, len %zu%s\n", epnum, rx_csr,
xfer_len, dma ? ", dma" : ""); xfer_len, dma ? ", dma" : "");
rx_csr &= ~MUSB_RXCSR_H_REQPKT; rx_csr &= ~MUSB_RXCSR_H_REQPKT;
...@@ -2125,7 +2125,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd) ...@@ -2125,7 +2125,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
return 0; return 0;
if (is_host_active(musb) && musb->is_active) { if (is_host_active(musb) && musb->is_active) {
WARN("trying to suspend as %s is_active=%i\n", WARNING("trying to suspend as %s is_active=%i\n",
otg_state_string(musb), musb->is_active); otg_state_string(musb), musb->is_active);
return -EBUSY; return -EBUSY;
} else } else
......
...@@ -680,7 +680,7 @@ static int musb_proc_write(struct file *file, const char __user *buffer, ...@@ -680,7 +680,7 @@ static int musb_proc_write(struct file *file, const char __user *buffer,
reg |= MUSB_DEVCTL_HR; reg |= MUSB_DEVCTL_HR;
musb_writeb(mbase, MUSB_DEVCTL, reg); musb_writeb(mbase, MUSB_DEVCTL, reg);
/* MUSB_HST_MODE( ((struct musb*)data) ); */ /* MUSB_HST_MODE( ((struct musb*)data) ); */
/* WARN("Host Mode\n"); */ /* WARNING("Host Mode\n"); */
} }
break; break;
......
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