linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code
@ 2019-04-01  5:07 Anson Huang
  2019-04-01  8:11 ` Mukesh Ojha
  2019-04-08 11:41 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Anson Huang @ 2019-04-01  5:07 UTC (permalink / raw)
  To: Aisheng Dong, festevam@gmail.com, shawnguo@kernel.org,
	stefan@agner.ch, kernel@pengutronix.de, linus.walleij@linaro.org,
	s.hauer@pengutronix.de, linux-gpio@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
  Cc: dl-linux-imx

Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 188001b..cc6f5cc 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -785,7 +785,6 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 	struct pinctrl_desc *imx_pinctrl_desc;
 	struct device_node *np;
 	struct imx_pinctrl *ipctl;
-	struct resource *res;
 	struct regmap *gpr;
 	int ret, i;
 
@@ -817,8 +816,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
 			ipctl->pin_regs[i].conf_reg = -1;
 		}
 
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		ipctl->base = devm_ioremap_resource(&pdev->dev, res);
+		ipctl->base = devm_platform_ioremap_resource(pdev, 0);
 		if (IS_ERR(ipctl->base))
 			return PTR_ERR(ipctl->base);
 
-- 
2.7.4

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

* Re: [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code
  2019-04-01  5:07 [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code Anson Huang
@ 2019-04-01  8:11 ` Mukesh Ojha
  2019-04-08 11:41 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-04-01  8:11 UTC (permalink / raw)
  To: Anson Huang, Aisheng Dong, festevam@gmail.com,
	shawnguo@kernel.org, stefan@agner.ch, kernel@pengutronix.de,
	linus.walleij@linaro.org, s.hauer@pengutronix.de,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
  Cc: dl-linux-imx


On 4/1/2019 10:37 AM, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> ---
>   drivers/pinctrl/freescale/pinctrl-imx.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
> index 188001b..cc6f5cc 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -785,7 +785,6 @@ int imx_pinctrl_probe(struct platform_device *pdev,
>   	struct pinctrl_desc *imx_pinctrl_desc;
>   	struct device_node *np;
>   	struct imx_pinctrl *ipctl;
> -	struct resource *res;
>   	struct regmap *gpr;
>   	int ret, i;
>   
> @@ -817,8 +816,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
>   			ipctl->pin_regs[i].conf_reg = -1;
>   		}
>   
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		ipctl->base = devm_ioremap_resource(&pdev->dev, res);
> +		ipctl->base = devm_platform_ioremap_resource(pdev, 0);
>   		if (IS_ERR(ipctl->base))
>   			return PTR_ERR(ipctl->base);
>   

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

* Re: [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code
  2019-04-01  5:07 [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code Anson Huang
  2019-04-01  8:11 ` Mukesh Ojha
@ 2019-04-08 11:41 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2019-04-08 11:41 UTC (permalink / raw)
  To: Anson Huang
  Cc: Aisheng Dong, festevam@gmail.com, shawnguo@kernel.org,
	stefan@agner.ch, kernel@pengutronix.de, s.hauer@pengutronix.de,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, dl-linux-imx

On Mon, Apr 1, 2019 at 7:07 AM Anson Huang <anson.huang@nxp.com> wrote:

> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2019-04-08 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01  5:07 [PATCH] pinctrl: freescale: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-04-01  8:11 ` Mukesh Ojha
2019-04-08 11:41 ` Linus Walleij

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).