diff mbox

[1/4,media] sh_veu.c: Convert to devm_ioremap_resource()

Message ID 1362384921-7344-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat March 4, 2013, 8:15 a.m. UTC
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/media/platform/sh_veu.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Comments

Thierry Reding March 4, 2013, 9:12 a.m. UTC | #1
On Mon, Mar 04, 2013 at 01:45:18PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/media/platform/sh_veu.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
> index cb54c69..362d88e 100644
> --- a/drivers/media/platform/sh_veu.c
> +++ b/drivers/media/platform/sh_veu.c
> @@ -10,6 +10,7 @@
>   * published by the Free Software Foundation
>   */
>  
> +#include <linux/err.h>
>  #include <linux/fs.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> @@ -1164,9 +1165,9 @@ static int sh_veu_probe(struct platform_device *pdev)
>  
>  	veu->is_2h = resource_size(reg_res) == 0x22c;
>  
> -	veu->base = devm_request_and_ioremap(&pdev->dev, reg_res);
> -	if (!veu->base)
> -		return -ENOMEM;
> +	veu->base = devm_ioremap_resource(&pdev->dev, reg_res);
> +	if (IS_ERR(veu->base))
> +		return PTR_ERR(veu->base);
>  
>  	ret = devm_request_threaded_irq(&pdev->dev, irq, sh_veu_isr, sh_veu_bh,
>  					0, "veu", veu);

Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Guennadi Liakhovetski March 4, 2013, 9:25 a.m. UTC | #2
Hi

On Mon, 4 Mar 2013, Sachin Kamat wrote:

> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks for the patches. I'll add all 4 to my 3.10 queue.

Thanks
Guennadi

> ---
>  drivers/media/platform/sh_veu.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
> index cb54c69..362d88e 100644
> --- a/drivers/media/platform/sh_veu.c
> +++ b/drivers/media/platform/sh_veu.c
> @@ -10,6 +10,7 @@
>   * published by the Free Software Foundation
>   */
>  
> +#include <linux/err.h>
>  #include <linux/fs.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> @@ -1164,9 +1165,9 @@ static int sh_veu_probe(struct platform_device *pdev)
>  
>  	veu->is_2h = resource_size(reg_res) == 0x22c;
>  
> -	veu->base = devm_request_and_ioremap(&pdev->dev, reg_res);
> -	if (!veu->base)
> -		return -ENOMEM;
> +	veu->base = devm_ioremap_resource(&pdev->dev, reg_res);
> +	if (IS_ERR(veu->base))
> +		return PTR_ERR(veu->base);
>  
>  	ret = devm_request_threaded_irq(&pdev->dev, irq, sh_veu_isr, sh_veu_bh,
>  					0, "veu", veu);
> -- 
> 1.7.4.1
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index cb54c69..362d88e 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -10,6 +10,7 @@ 
  * published by the Free Software Foundation
  */
 
+#include <linux/err.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -1164,9 +1165,9 @@  static int sh_veu_probe(struct platform_device *pdev)
 
 	veu->is_2h = resource_size(reg_res) == 0x22c;
 
-	veu->base = devm_request_and_ioremap(&pdev->dev, reg_res);
-	if (!veu->base)
-		return -ENOMEM;
+	veu->base = devm_ioremap_resource(&pdev->dev, reg_res);
+	if (IS_ERR(veu->base))
+		return PTR_ERR(veu->base);
 
 	ret = devm_request_threaded_irq(&pdev->dev, irq, sh_veu_isr, sh_veu_bh,
 					0, "veu", veu);