mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: musb: cppi: fix build errors due to DBG and missing musb variable
@ 2011-08-03 13:39 Per Forlin
  2011-08-03 13:43 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Per Forlin @ 2011-08-03 13:39 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, linaro-dev, stable, Per Forlin

From: Per Forlin <per.forlin@linaro.org>

Replace DBG with dev_dbg add fix invalid access of musb->controller.
With this patch cppi_dma builds successfully.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Cc: <stable@kernel.org>
---
 drivers/usb/musb/cppi_dma.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index 149f3f3..318fb4e 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -226,8 +226,10 @@ static int cppi_controller_stop(struct dma_controller *c)
 	struct cppi		*controller;
 	void __iomem		*tibase;
 	int			i;
+	struct musb		*musb;
 
 	controller = container_of(c, struct cppi, controller);
+	musb = controller->musb;
 
 	tibase = controller->tibase;
 	/* DISABLE INDIVIDUAL CHANNEL Interrupts */
@@ -289,9 +291,11 @@ cppi_channel_allocate(struct dma_controller *c,
 	u8			index;
 	struct cppi_channel	*cppi_ch;
 	void __iomem		*tibase;
+	struct musb		*musb;
 
 	controller = container_of(c, struct cppi, controller);
 	tibase = controller->tibase;
+	musb = controller->musb;
 
 	/* ep0 doesn't use DMA; remember cppi indices are 0..N-1 */
 	index = ep->epnum - 1;
@@ -339,7 +343,8 @@ static void cppi_channel_release(struct dma_channel *channel)
 	c = container_of(channel, struct cppi_channel, channel);
 	tibase = c->controller->tibase;
 	if (!c->hw_ep)
-		dev_dbg(musb->controller, "releasing idle DMA channel %p\n", c);
+		dev_dbg(c->controller->musb->controller,
+			"releasing idle DMA channel %p\n", c);
 	else if (!c->transmit)
 		core_rxirq_enable(tibase, c->index + 1);
 
@@ -357,10 +362,11 @@ cppi_dump_rx(int level, struct cppi_channel *c, const char *tag)
 
 	musb_ep_select(base, c->index + 1);
 
-	DBG(level, "RX DMA%d%s: %d left, csr %04x, "
-			"%08x H%08x S%08x C%08x, "
-			"B%08x L%08x %08x .. %08x"
-			"\n",
+	dev_dbg(c->controller->musb->controller,
+		"RX DMA%d%s: %d left, csr %04x, "
+		"%08x H%08x S%08x C%08x, "
+		"B%08x L%08x %08x .. %08x"
+		"\n",
 		c->index, tag,
 		musb_readl(c->controller->tibase,
 			DAVINCI_RXCPPI_BUFCNT0_REG + 4 * c->index),
@@ -387,10 +393,11 @@ cppi_dump_tx(int level, struct cppi_channel *c, const char *tag)
 
 	musb_ep_select(base, c->index + 1);
 
-	DBG(level, "TX DMA%d%s: csr %04x, "
-			"H%08x S%08x C%08x %08x, "
-			"F%08x L%08x .. %08x"
-			"\n",
+	dev_dbg(c->controller->musb->controller,
+		"TX DMA%d%s: csr %04x, "
+		"H%08x S%08x C%08x %08x, "
+		"F%08x L%08x .. %08x"
+		"\n",
 		c->index, tag,
 		musb_readw(c->hw_ep->regs, MUSB_TXCSR),
 
@@ -1022,6 +1029,7 @@ static bool cppi_rx_scan(struct cppi *cppi, unsigned ch)
 	int				i;
 	dma_addr_t			safe2ack;
 	void __iomem			*regs = rx->hw_ep->regs;
+	struct musb			*musb = cppi->musb;
 
 	cppi_dump_rx(6, rx, "/K");
 
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: musb: cppi: fix build errors due to DBG and missing musb variable
  2011-08-03 13:39 [PATCH] usb: musb: cppi: fix build errors due to DBG and missing musb variable Per Forlin
@ 2011-08-03 13:43 ` Felipe Balbi
  2011-08-03 13:55   ` Per Forlin
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2011-08-03 13:43 UTC (permalink / raw)
  To: Per Forlin
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
	linaro-dev, stable, Per Forlin

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

Hi,

On Wed, Aug 03, 2011 at 03:39:15PM +0200, Per Forlin wrote:
> From: Per Forlin <per.forlin@linaro.org>
> 
> Replace DBG with dev_dbg add fix invalid access of musb->controller.
> With this patch cppi_dma builds successfully.
> 
> Signed-off-by: Per Forlin <per.forlin@linaro.org>
> Cc: <stable@kernel.org>

applied, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: musb: cppi: fix build errors due to DBG and missing musb variable
  2011-08-03 13:43 ` Felipe Balbi
@ 2011-08-03 13:55   ` Per Forlin
  0 siblings, 0 replies; 3+ messages in thread
From: Per Forlin @ 2011-08-03 13:55 UTC (permalink / raw)
  To: balbi
  Cc: Per Forlin, Greg Kroah-Hartman, linux-usb, linux-kernel,
	linaro-dev, stable

On 3 August 2011 15:43, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Wed, Aug 03, 2011 at 03:39:15PM +0200, Per Forlin wrote:
>> From: Per Forlin <per.forlin@linaro.org>
>>
>> Replace DBG with dev_dbg add fix invalid access of musb->controller.
>> With this patch cppi_dma builds successfully.
>>
>> Signed-off-by: Per Forlin <per.forlin@linaro.org>
>> Cc: <stable@kernel.org>
>
> applied, thanks
>
I forgot to mention. This patch is not tested on target because I
don't have any davinci board. None the less this driver is more useful
now when it builds.

Regards,
Per

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-03 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 13:39 [PATCH] usb: musb: cppi: fix build errors due to DBG and missing musb variable Per Forlin
2011-08-03 13:43 ` Felipe Balbi
2011-08-03 13:55   ` Per Forlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®