Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
From: qiwuchen55@gmail.com
To: sboyd@kernel.org, allison@lohutok.net,
	gregkh@linuxfoundation.org, linus.walleij@linaro.org,
	tglx@linutronix.de
Cc: linux-arm-msm@vger.kernel.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: [PATCH] spmi: pmic-arb: convert to devm_platform_ioremap_resource_byname()
Date: Sat, 15 Feb 2020 16:22:47 +0800
Message-ID: <1581754967-27090-1-git-send-email-qiwuchen55@gmail.com> (raw)

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


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1581754967-27090-1-git-send-email-qiwuchen55@gmail.com \
    --to=qiwuchen55@gmail.com \
    --cc=allison@lohutok.net \
    --cc=chenqiwu@xiaomi.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git