All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spmi: pmic-arb: convert to devm_platform_ioremap_resource_byname()
@ 2020-02-15  8:22 qiwuchen55
  0 siblings, 0 replies; only message in thread
From: qiwuchen55 @ 2020-02-15  8:22 UTC (permalink / raw)
  To: sboyd, allison, gregkh, linus.walleij, tglx; +Cc: linux-arm-msm, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

Use devm_platform_ioremap_resource_byname() instead of calling
platform_get_resource_byname() and devm_ioremap_resource() separately
to simplify the code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 drivers/spmi/spmi-pmic-arb.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index de844b4..c65815c 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -1203,17 +1203,15 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
 		else
 			pmic_arb->ver_ops = &pmic_arb_v5;
 
-		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-						   "obsrvr");
-		pmic_arb->rd_base = devm_ioremap_resource(&ctrl->dev, res);
+		pmic_arb->rd_base =
+			devm_platform_ioremap_resource_byname(pdev, "obsrvr");
 		if (IS_ERR(pmic_arb->rd_base)) {
 			err = PTR_ERR(pmic_arb->rd_base);
 			goto err_put_ctrl;
 		}
 
-		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-						   "chnls");
-		pmic_arb->wr_base = devm_ioremap_resource(&ctrl->dev, res);
+		pmic_arb->wr_base =
+			devm_platform_ioremap_resource_byname(pdev, "chnls");
 		if (IS_ERR(pmic_arb->wr_base)) {
 			err = PTR_ERR(pmic_arb->wr_base);
 			goto err_put_ctrl;
@@ -1223,15 +1221,13 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
 	dev_info(&ctrl->dev, "PMIC arbiter version %s (0x%x)\n",
 		 pmic_arb->ver_ops->ver_str, hw_ver);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "intr");
-	pmic_arb->intr = devm_ioremap_resource(&ctrl->dev, res);
+	pmic_arb->intr = devm_platform_ioremap_resource_byname(pdev, "intr");
 	if (IS_ERR(pmic_arb->intr)) {
 		err = PTR_ERR(pmic_arb->intr);
 		goto err_put_ctrl;
 	}
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cnfg");
-	pmic_arb->cnfg = devm_ioremap_resource(&ctrl->dev, res);
+	pmic_arb->cnfg = devm_platform_ioremap_resource_byname(pdev, "cnfg");
 	if (IS_ERR(pmic_arb->cnfg)) {
 		err = PTR_ERR(pmic_arb->cnfg);
 		goto err_put_ctrl;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-15  8:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15  8:22 [PATCH] spmi: pmic-arb: convert to devm_platform_ioremap_resource_byname() qiwuchen55

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.