linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com,
	yamada.masahiro@socionext.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Mukesh Ojha <mojha@codeaurora.org>
Subject: [PATCH 4/7] irqchip/irq-mbigen.c: Use devm_platform_ioremap_resource()
Date: Thu,  4 Apr 2019 12:50:10 +0530	[thread overview]
Message-ID: <1554362413-3305-5-git-send-email-mojha@codeaurora.org> (raw)
In-Reply-To: <1554362413-3305-1-git-send-email-mojha@codeaurora.org>

devm_platform_ioremap_resource() internally have platform_get_resource()
and devm_ioremap_resource() in it. So instead of calling them separately
use devm_platform_ioremap_resource() directly.

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/irqchip/irq-ls-scfg-msi.c | 4 +---
 drivers/irqchip/irq-mbigen.c      | 9 +--------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index c671b32..aec5a2f 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -336,7 +336,6 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *match;
 	struct ls_scfg_msi *msi_data;
-	struct resource *res;
 	int i, ret;
 
 	match = of_match_device(ls_scfg_msi_id, &pdev->dev);
@@ -349,8 +348,7 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
 
 	msi_data->cfg = (struct ls_scfg_msi_cfg *) match->data;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	msi_data->regs = devm_ioremap_resource(&pdev->dev, res);
+	msi_data->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(msi_data->regs)) {
 		dev_err(&pdev->dev, "failed to initialize 'regs'\n");
 		return PTR_ERR(msi_data->regs);
diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
index 98b6e1d..c9aedfb 100644
--- a/drivers/irqchip/irq-mbigen.c
+++ b/drivers/irqchip/irq-mbigen.c
@@ -327,7 +327,6 @@ static inline int mbigen_acpi_create_domain(struct platform_device *pdev,
 static int mbigen_device_probe(struct platform_device *pdev)
 {
 	struct mbigen_device *mgn_chip;
-	struct resource *res;
 	int err;
 
 	mgn_chip = devm_kzalloc(&pdev->dev, sizeof(*mgn_chip), GFP_KERNEL);
@@ -335,13 +334,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mgn_chip->pdev = pdev;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
-	mgn_chip->base = devm_ioremap(&pdev->dev, res->start,
-				      resource_size(res));
+	mgn_chip->base = devm_platform_ioremap_resource(pdev, 0);
 	if (!mgn_chip->base) {
 		dev_err(&pdev->dev, "failed to ioremap %pR\n", res);
 		return -ENOMEM;
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-04-04  7:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  7:20 [PATCH 0/7] irqchip: Use devm_platform_ioremap_resource() Mukesh Ojha
2019-04-04  7:20 ` [PATCH 1/7] irqchip/irq-uniphier-aidet: " Mukesh Ojha
2019-04-04  7:20 ` [PATCH 2/7] irqchip/irq-imgpdc.c: " Mukesh Ojha
2019-04-29  8:13   ` Marc Zyngier
2019-04-29  8:24     ` Marc Zyngier
2019-04-04  7:20 ` [PATCH 3/7] irqchip/irq-ts4800.c: " Mukesh Ojha
2019-04-04  7:20 ` Mukesh Ojha [this message]
2019-04-29  8:16   ` [PATCH 4/7] irqchip/irq-mbigen.c: " Marc Zyngier
2019-04-04  7:20 ` [PATCH 5/7] irqchip/irq-mvebu-icu: " Mukesh Ojha
2019-04-04  7:20 ` [PATCH 6/7] irqchip/irq-mvebu-pic: " Mukesh Ojha
2019-04-04  7:20 ` [PATCH 7/7] irqchip/irq-mvebu-sei: " Mukesh Ojha
2019-04-29  8:19   ` Marc Zyngier
2019-04-29  8:27 ` [PATCH 0/7] irqchip: " Marc Zyngier

Reply instructions:

You may reply publicly 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=1554362413-3305-5-git-send-email-mojha@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=yamada.masahiro@socionext.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).