[4/5] pinctrl: qcom: Use devm_platform_get_and_ioremap_resource()

Message ID 20230306144641.21955-1-quic_mdalam@quicinc.com
State New
Headers
Series [1/5] mtd: nand: raw: qcom_nandc: Use devm_platform_get_and_ioremap_resource() |

Commit Message

Md Sadre Alam March 6, 2023, 2:46 p.m. UTC
  Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Linus Walleij March 9, 2023, 1:51 p.m. UTC | #1
On Mon, Mar 6, 2023 at 3:46 PM Md Sadre Alam <quic_mdalam@quicinc.com> wrote:

> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>

This patch (nr 4) applied to the pinctrl tree as obviously correct.
I guess it is independent from the other patches since I was only CC:ed
on this one.

Yours,
Linus Walleij
  

Patch

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index daeb79a9a602..e25e7b5cdda2 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1480,8 +1480,7 @@  int msm_pinctrl_probe(struct platform_device *pdev,
 				return PTR_ERR(pctrl->regs[i]);
 		}
 	} else {
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		pctrl->regs[0] = devm_ioremap_resource(&pdev->dev, res);
+		pctrl->regs[0] = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 		if (IS_ERR(pctrl->regs[0]))
 			return PTR_ERR(pctrl->regs[0]);