From: Ziliang Liao <saraday@hust.edu.cn>
To: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>
Cc: hust-os-kernel-patches@googlegroups.com,
Ziliang Liao <saraday@hust.edu.cn>,
Dongliang Mu <dzm91@hust.edu.cn>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] bus: qcom-ebi2: simplify the code in qcom_ebi2_probe()
Date: Sun, 30 Apr 2023 20:51:54 +0800 [thread overview]
Message-ID: <20230430125154.126863-2-saraday@hust.edu.cn> (raw)
In-Reply-To: <20230430125154.126863-1-saraday@hust.edu.cn>
The code use platform_get_resource() and devm_ioremap_resource() to
allocate memory resources for the device. It can be simplified by using
devm_platform_ioremap_resource().
Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
Signed-off-by: Ziliang Liao <saraday@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
drivers/bus/qcom-ebi2.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index 3999e969e1cf..bd419398d1c1 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -294,7 +294,6 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct device_node *child;
struct device *dev = &pdev->dev;
- struct resource *res;
void __iomem *ebi2_base;
void __iomem *ebi2_xmem;
struct clk *ebi2xclk;
@@ -315,14 +314,12 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
return PTR_ERR(ebi2clk);
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ebi2_base = devm_ioremap_resource(dev, res);
+ ebi2_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ebi2_base)) {
return PTR_ERR(ebi2_base);
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- ebi2_xmem = devm_ioremap_resource(dev, res);
+ ebi2_xmem = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(ebi2_xmem)) {
return PTR_ERR(ebi2_xmem);
}
--
2.25.1
next prev parent reply other threads:[~2023-04-30 12:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-30 12:51 [PATCH 1/2] bus: qcom-ebi2: use prefix devm for clock resource allocation functions Ziliang Liao
2023-04-30 12:51 ` Ziliang Liao [this message]
2023-05-08 13:35 ` [PATCH 2/2] bus: qcom-ebi2: simplify the code in qcom_ebi2_probe() Linus Walleij
2023-05-08 16:22 ` Ziliang Liao
2023-05-09 7:06 ` Linus Walleij
2023-05-08 13:34 ` [PATCH 1/2] bus: qcom-ebi2: use prefix devm for clock resource allocation functions Linus Walleij
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=20230430125154.126863-2-saraday@hust.edu.cn \
--to=saraday@hust.edu.cn \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=dzm91@hust.edu.cn \
--cc=hust-os-kernel-patches@googlegroups.com \
--cc=konrad.dybcio@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®