diff mbox series

[2/4] soc: mediatek: mmsys: Use devm_platform_ioremap_resource()

Message ID 20201006193320.405529-3-enric.balletbo@collabora.com (mailing list archive)
State New, archived
Headers show
Series soc: mediatek: Prepare MMSYS for DDP routing using tables | expand

Commit Message

Enric Balletbo i Serra Oct. 6, 2020, 7:33 p.m. UTC
For the common platform_get_resource()+devm_platform_ioremap() combination,
there is a helper, so use it and make the code a bit more compact.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 drivers/soc/mediatek/mtk-mmsys.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Chun-Kuang Hu Oct. 6, 2020, 11:21 p.m. UTC | #1
Enric Balletbo i Serra <enric.balletbo@collabora.com> 於 2020年10月7日 週三 上午3:33寫道:
>
> For the common platform_get_resource()+devm_platform_ioremap() combination,
> there is a helper, so use it and make the code a bit more compact.

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@mediatek.com>

>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
>  drivers/soc/mediatek/mtk-mmsys.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 36ad66bb221b..18f93979e14a 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -306,15 +306,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>         struct platform_device *clks;
>         struct platform_device *drm;
>         void __iomem *config_regs;
> -       struct resource *mem;
>         int ret;
>
> -       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       config_regs = devm_ioremap_resource(dev, mem);
> +       config_regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(config_regs)) {
>                 ret = PTR_ERR(config_regs);
> -               dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n",
> -                       ret);
> +               dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret);
>                 return ret;
>         }
>
> --
> 2.28.0
>
Chun-Kuang Hu Oct. 7, 2020, 12:01 a.m. UTC | #2
Chun-Kuang Hu <chunkuang.hu@kernel.org> 於 2020年10月7日 週三 上午7:21寫道:
>
> Enric Balletbo i Serra <enric.balletbo@collabora.com> 於 2020年10月7日 週三 上午3:33寫道:
> >
> > For the common platform_get_resource()+devm_platform_ioremap() combination,
> > there is a helper, so use it and make the code a bit more compact.
>
> Reviewed-by: Chun-Kuang Hu <chunkuang.hu@mediatek.com>
>

Sorry for typo,

Reviewed-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

> >
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> >
> >  drivers/soc/mediatek/mtk-mmsys.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> > index 36ad66bb221b..18f93979e14a 100644
> > --- a/drivers/soc/mediatek/mtk-mmsys.c
> > +++ b/drivers/soc/mediatek/mtk-mmsys.c
> > @@ -306,15 +306,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
> >         struct platform_device *clks;
> >         struct platform_device *drm;
> >         void __iomem *config_regs;
> > -       struct resource *mem;
> >         int ret;
> >
> > -       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -       config_regs = devm_ioremap_resource(dev, mem);
> > +       config_regs = devm_platform_ioremap_resource(pdev, 0);
> >         if (IS_ERR(config_regs)) {
> >                 ret = PTR_ERR(config_regs);
> > -               dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n",
> > -                       ret);
> > +               dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret);
> >                 return ret;
> >         }
> >
> > --
> > 2.28.0
> >
Matthias Brugger Nov. 27, 2020, 11:35 p.m. UTC | #3
On 06/10/2020 21:33, Enric Balletbo i Serra wrote:
> For the common platform_get_resource()+devm_platform_ioremap() combination,
> there is a helper, so use it and make the code a bit more compact.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

Applied to v5.10-next/soc

Thanks!

> ---
> 
>   drivers/soc/mediatek/mtk-mmsys.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 36ad66bb221b..18f93979e14a 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -306,15 +306,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>   	struct platform_device *clks;
>   	struct platform_device *drm;
>   	void __iomem *config_regs;
> -	struct resource *mem;
>   	int ret;
>   
> -	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	config_regs = devm_ioremap_resource(dev, mem);
> +	config_regs = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(config_regs)) {
>   		ret = PTR_ERR(config_regs);
> -		dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n",
> -			ret);
> +		dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret);
>   		return ret;
>   	}
>   
>
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index 36ad66bb221b..18f93979e14a 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -306,15 +306,12 @@  static int mtk_mmsys_probe(struct platform_device *pdev)
 	struct platform_device *clks;
 	struct platform_device *drm;
 	void __iomem *config_regs;
-	struct resource *mem;
 	int ret;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	config_regs = devm_ioremap_resource(dev, mem);
+	config_regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(config_regs)) {
 		ret = PTR_ERR(config_regs);
-		dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n",
-			ret);
+		dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret);
 		return ret;
 	}