From: Cai Huoqing <caihuoqing@baidu.com>
To: <gregkh@linuxfoundation.org>, <rafael@kernel.org>,
<patrice.chotard@foss.st.com>, <mchehab@kernel.org>,
<ryder.lee@mediatek.com>, <jianjun.wang@mediatek.com>,
<lorenzo.pieralisi@arm.com>, <robh@kernel.org>, <kw@linux.com>,
<bhelgaas@google.com>, <matthias.bgg@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-media@vger.kernel.org>, <linux-pci@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
Cai Huoqing <caihuoqing@baidu.com>
Subject: [PATCH v2 3/3] PCI: mediatek-gen3: Make use of the helper function devm_platform_get_and_ioremap_resource_byname()
Date: Thu, 2 Sep 2021 14:37:02 +0800 [thread overview]
Message-ID: <20210902063702.32066-4-caihuoqing@baidu.com> (raw)
In-Reply-To: <20210902063702.32066-1-caihuoqing@baidu.com>
Use the devm_platform_get_and_ioremap_resource_byname() helper
instead of calling platform_get_resource_byname() and
devm_ioremap_resource() separately.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
v1->v2: Use devm_platform_get_and_ioremap_resource_byname()
instead of devm_platform_ioremap_resource_byname().
drivers/pci/controller/pcie-mediatek-gen3.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index 17c59b0d6978..27009da62ec1 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -715,10 +715,7 @@ static int mtk_pcie_parse_port(struct mtk_pcie_port *port)
struct resource *regs;
int ret;
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcie-mac");
- if (!regs)
- return -EINVAL;
- port->base = devm_ioremap_resource(dev, regs);
+ port->base = devm_platform_get_and_ioremap_resource_byname(pdev, "pcie-mac", ®s);
if (IS_ERR(port->base)) {
dev_err(dev, "failed to map register base\n");
return PTR_ERR(port->base);
--
2.25.1
prev parent reply other threads:[~2021-09-02 6:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 6:36 [PATCH v2 0/3] drivers: Add the helper function devm_platform_get_and_ioremap_resource_byname() Cai Huoqing
2021-09-02 6:37 ` [PATCH v2 1/3] driver core: platform: " Cai Huoqing
2021-09-02 6:52 ` Greg KH
2021-09-02 8:05 ` Cai Huoqing
2021-09-02 8:25 ` Greg KH
2021-09-02 6:37 ` [PATCH v2 2/3] media: sti/c8sectpfe: Make use of " Cai Huoqing
2021-09-02 6:37 ` Cai Huoqing [this message]
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=20210902063702.32066-4-caihuoqing@baidu.com \
--to=caihuoqing@baidu.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jianjun.wang@mediatek.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=patrice.chotard@foss.st.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=ryder.lee@mediatek.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).