Subject: Re: linux-next: build failure after merge of the slave-dma tree

From: Vinod Koul <[email-masked]>
Date: Mon, 28 Jul 2014 12:46:22 +0530

On Mon, Jul 28, 2014 at 12:18:56PM +1000, Stephen Rothwell wrote:
> Hi Vinod,
> 
> After merging the slave-dma tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/dma/sun6i-dma.c: In function 'sun6i_dma_dump_chan_regs':
> drivers/dma/sun6i-dma.c:203:2: error: implicit declaration of function '__virt_to_phys' [-Werror=implicit-function-declaration]
>   phys_addr_t reg = __virt_to_phys((unsigned long)pchan->base);
>   ^
> 
> Caused by commit 555859308723 ("dmaengine: sun6i: Add driver for the
> Allwinner A31 DMA controller").  Presumably missing an include file.
> 
> I have used the slave-dma tree from next-20140725 for today.

Thanks, Feng's robot also gave such warning. SInce maxime didnt send any
fixes it, I am applying below to fix this.
We shouldnt have used __virt_to_phys here

--x8---
From: Vinod Koul <[email-masked]>
Date: Mon, 28 Jul 2014 11:57:25 +0530
Subject: [PATCH 1/2] dmaengine: sun6i: fix build failure on x86, xilinx targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since the driver defined COMPILE_TEST, it gets compiled for different arch's.
The driver uses __virt_to_phys() insteadof virt_to_phys, so replace it

drivers/dma/sun6i-dma.c: In function ‘sun6i_dma_dump_chan_regs’:
drivers/dma/sun6i-dma.c:203: error: implicit declaration of function '__virt_to_phys'

Reported-by: kbuild test robot <[email-masked]>
Reported-by: Stephen Rothwell <[email-masked]>
Signed-off-by: Vinod Koul <[email-masked]>
---
 drivers/dma/sun6i-dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index ce8d5d1..e9f99bb 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -200,7 +200,7 @@ static inline void sun6i_dma_dump_com_regs(struct sun6i_dma_dev *sdev)
 static inline void sun6i_dma_dump_chan_regs(struct sun6i_dma_dev *sdev,
 					    struct sun6i_pchan *pchan)
 {
-	phys_addr_t reg = __virt_to_phys((unsigned long)pchan->base);
+	phys_addr_t reg = virt_to_phys(pchan->base);
 
 	dev_dbg(sdev->slave.dev, "Chan %d reg: %pa\n"
 		"\t___en(%04x): \t0x%08x\n"
@@ -330,7 +330,7 @@ static inline int sun6i_dma_cfg_lli(struct sun6i_dma_lli *lli,
 static inline void sun6i_dma_dump_lli(struct sun6i_vchan *vchan,
 				      struct sun6i_dma_lli *lli)
 {
-	phys_addr_t p_lli = __virt_to_phys((unsigned long)lli);
+	phys_addr_t p_lli = virt_to_phys(lli);
 
 	dev_dbg(chan2dev(&vchan->vc.chan),
 		"\n\tdesc:   p - %pa v - 0x%p\n"
-- 
1.7.0.4