diff mbox series

[1/2] soc: amlogic: canvas: Make use of the helper function devm_platform_ioremap_resource()

Message ID 20210908071544.603-1-caihuoqing@baidu.com (mailing list archive)
State New, archived
Headers show
Series [1/2] soc: amlogic: canvas: Make use of the helper function devm_platform_ioremap_resource() | expand

Commit Message

Cai,Huoqing Sept. 8, 2021, 7:15 a.m. UTC
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/soc/amlogic/meson-canvas.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Neil Armstrong Sept. 8, 2021, 7:47 a.m. UTC | #1
On 08/09/2021 09:15, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/soc/amlogic/meson-canvas.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
> index d0329ad170d1..383b0cfc584e 100644
> --- a/drivers/soc/amlogic/meson-canvas.c
> +++ b/drivers/soc/amlogic/meson-canvas.c
> @@ -168,7 +168,6 @@ EXPORT_SYMBOL_GPL(meson_canvas_free);
>  
>  static int meson_canvas_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
>  	struct meson_canvas *canvas;
>  	struct device *dev = &pdev->dev;
>  
> @@ -176,8 +175,7 @@ static int meson_canvas_probe(struct platform_device *pdev)
>  	if (!canvas)
>  		return -ENOMEM;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	canvas->reg_base = devm_ioremap_resource(dev, res);
> +	canvas->reg_base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(canvas->reg_base))
>  		return PTR_ERR(canvas->reg_base);
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Neil Armstrong Sept. 13, 2021, 7:44 a.m. UTC | #2
Hi,

On Wed, 8 Sep 2021 15:15:42 +0800, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v5.16/drivers)

[1/2] soc: amlogic: canvas: Make use of the helper function devm_platform_ioremap_resource()
      https://git.kernel.org/amlogic/c/97a4a24087ce354ce0318449e6bd9e660f5c573b
[2/2] soc: amlogic: meson-clk-measure: Make use of the helper function devm_platform_ioremap_resource()
      https://git.kernel.org/amlogic/c/d54dbe9f0ec05935e10d6a38d81e54e2ec8b8a68
diff mbox series

Patch

diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index d0329ad170d1..383b0cfc584e 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -168,7 +168,6 @@  EXPORT_SYMBOL_GPL(meson_canvas_free);
 
 static int meson_canvas_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct meson_canvas *canvas;
 	struct device *dev = &pdev->dev;
 
@@ -176,8 +175,7 @@  static int meson_canvas_probe(struct platform_device *pdev)
 	if (!canvas)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	canvas->reg_base = devm_ioremap_resource(dev, res);
+	canvas->reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(canvas->reg_base))
 		return PTR_ERR(canvas->reg_base);