linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage
@ 2013-06-18 10:05 Sachin Kamat
  2013-06-18 10:05 ` [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs Sachin Kamat
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sachin Kamat @ 2013-06-18 10:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

Include the missing header file to fix the following build error:
drivers/mfd/davinci_voicecodec.c: In function ‘davinci_vc_probe’:
drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration of function
‘io_v2p’ [-Werror=implicit-function-declaration]
   (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_WFIFO);

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
This series is based on Samuel's mfd-next tree and is compile tested.
---
 include/linux/mfd/davinci_voicecodec.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 0ab6132..6b0e974 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -28,6 +28,7 @@
 #include <linux/mfd/core.h>
 
 #include <mach/edma.h>
+#include <mach/hardware.h>
 
 /*
  * Register values.
-- 
1.7.9.5


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

* [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs
  2013-06-18 10:05 [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
@ 2013-06-18 10:05 ` Sachin Kamat
  2013-06-19  7:58   ` Lee Jones
  2013-06-19  9:58 ` [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
  2013-06-20  8:23 ` Samuel Ortiz
  2 siblings, 1 reply; 5+ messages in thread
From: Sachin Kamat @ 2013-06-18 10:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat, Miguel Aguilar

devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
---
 drivers/mfd/davinci_voicecodec.c       |   48 +++++++-------------------------
 include/linux/mfd/davinci_voicecodec.h |    2 --
 2 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index b6e2973..fb64398 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -46,7 +46,7 @@ void davinci_vc_write(struct davinci_vc *davinci_vc,
 static int __init davinci_vc_probe(struct platform_device *pdev)
 {
 	struct davinci_vc *davinci_vc;
-	struct resource *res, *mem;
+	struct resource *res;
 	struct mfd_cell *cell = NULL;
 	int ret;
 
@@ -58,7 +58,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	davinci_vc->clk = clk_get(&pdev->dev, NULL);
+	davinci_vc->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(davinci_vc->clk)) {
 		dev_dbg(&pdev->dev,
 			    "could not get the clock for voice codec\n");
@@ -67,35 +67,18 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 	clk_enable(davinci_vc->clk);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "no mem resource\n");
-		ret = -ENODEV;
-		goto fail2;
-	}
-
-	davinci_vc->pbase = res->start;
-	davinci_vc->base_size = resource_size(res);
 
-	mem = request_mem_region(davinci_vc->pbase, davinci_vc->base_size,
-				 pdev->name);
-	if (!mem) {
-		dev_err(&pdev->dev, "VCIF region already claimed\n");
-		ret = -EBUSY;
-		goto fail2;
-	}
-
-	davinci_vc->base = ioremap(davinci_vc->pbase, davinci_vc->base_size);
-	if (!davinci_vc->base) {
-		dev_err(&pdev->dev, "can't ioremap mem resource.\n");
-		ret = -ENOMEM;
-		goto fail3;
+	davinci_vc->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(davinci_vc->base)) {
+		ret = PTR_ERR(davinci_vc->base);
+		goto fail;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENXIO;
-		goto fail4;
+		goto fail;
 	}
 
 	davinci_vc->davinci_vcif.dma_tx_channel = res->start;
@@ -106,7 +89,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENXIO;
-		goto fail4;
+		goto fail;
 	}
 
 	davinci_vc->davinci_vcif.dma_rx_channel = res->start;
@@ -132,19 +115,13 @@ static int __init davinci_vc_probe(struct platform_device *pdev)
 			      DAVINCI_VC_CELLS, NULL, 0, NULL);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "fail to register client devices\n");
-		goto fail4;
+		goto fail;
 	}
 
 	return 0;
 
-fail4:
-	iounmap(davinci_vc->base);
-fail3:
-	release_mem_region(davinci_vc->pbase, davinci_vc->base_size);
-fail2:
+fail:
 	clk_disable(davinci_vc->clk);
-	clk_put(davinci_vc->clk);
-	davinci_vc->clk = NULL;
 
 	return ret;
 }
@@ -155,12 +132,7 @@ static int davinci_vc_remove(struct platform_device *pdev)
 
 	mfd_remove_devices(&pdev->dev);
 
-	iounmap(davinci_vc->base);
-	release_mem_region(davinci_vc->pbase, davinci_vc->base_size);
-
 	clk_disable(davinci_vc->clk);
-	clk_put(davinci_vc->clk);
-	davinci_vc->clk = NULL;
 
 	return 0;
 }
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 6b0e974..810aee7 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -113,8 +113,6 @@ struct davinci_vc {
 
 	/* Memory resources */
 	void __iomem *base;
-	resource_size_t pbase;
-	size_t base_size;
 
 	/* MFD cells */
 	struct mfd_cell cells[DAVINCI_VC_CELLS];
-- 
1.7.9.5


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

* Re: [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs
  2013-06-18 10:05 ` [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs Sachin Kamat
@ 2013-06-19  7:58   ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2013-06-19  7:58 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, sameo, Miguel Aguilar

On Tue, 18 Jun 2013, Sachin Kamat wrote:

> devm_* APIs are device managed and make code simpler.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> ---
>  drivers/mfd/davinci_voicecodec.c       |   48 +++++++-------------------------
>  include/linux/mfd/davinci_voicecodec.h |    2 --
>  2 files changed, 10 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c

Applied, thanks.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage
  2013-06-18 10:05 [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
  2013-06-18 10:05 ` [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs Sachin Kamat
@ 2013-06-19  9:58 ` Sachin Kamat
  2013-06-20  8:23 ` Samuel Ortiz
  2 siblings, 0 replies; 5+ messages in thread
From: Sachin Kamat @ 2013-06-19  9:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: lee.jones, sameo, sachin.kamat

Hi Lee,

On 18 June 2013 15:35, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Include the missing header file to fix the following build error:
> drivers/mfd/davinci_voicecodec.c: In function ‘davinci_vc_probe’:
> drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration of function
> ‘io_v2p’ [-Werror=implicit-function-declaration]
>    (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_WFIFO);
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> This series is based on Samuel's mfd-next tree and is compile tested.
> ---
>  include/linux/mfd/davinci_voicecodec.h |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
> index 0ab6132..6b0e974 100644
> --- a/include/linux/mfd/davinci_voicecodec.h
> +++ b/include/linux/mfd/davinci_voicecodec.h
> @@ -28,6 +28,7 @@
>  #include <linux/mfd/core.h>
>
>  #include <mach/edma.h>
> +#include <mach/hardware.h>
>
>  /*
>   * Register values.
> --
> 1.7.9.5
>

Now that you have applied patch 2 of this series and sent the pull
request, I guess Samuel will take this one directly.

-- 
With warm regards,
Sachin

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

* Re: [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage
  2013-06-18 10:05 [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
  2013-06-18 10:05 ` [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs Sachin Kamat
  2013-06-19  9:58 ` [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
@ 2013-06-20  8:23 ` Samuel Ortiz
  2 siblings, 0 replies; 5+ messages in thread
From: Samuel Ortiz @ 2013-06-20  8:23 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, lee.jones

Hi Sachin,

On Tue, Jun 18, 2013 at 03:35:39PM +0530, Sachin Kamat wrote:
> Include the missing header file to fix the following build error:
> drivers/mfd/davinci_voicecodec.c: In function ‘davinci_vc_probe’:
> drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration of function
> ‘io_v2p’ [-Werror=implicit-function-declaration]
>    (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_WFIFO);
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> This series is based on Samuel's mfd-next tree and is compile tested.
> ---
>  include/linux/mfd/davinci_voicecodec.h |    1 +
>  1 file changed, 1 insertion(+)
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2013-06-20  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 10:05 [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
2013-06-18 10:05 ` [PATCH 2/2] mfd: davinci_voicecodec: Convert to use devm_* APIs Sachin Kamat
2013-06-19  7:58   ` Lee Jones
2013-06-19  9:58 ` [PATCH 1/2] mfd: davinci_voicecodec: Fix build breakage Sachin Kamat
2013-06-20  8:23 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).