From: Qinglang Miao <miaoqinglang@huawei.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Qinglang Miao" <miaoqinglang@huawei.com>
Subject: [PATCH -next] MIPS: OCTEON: use devm_platform_ioremap_resource
Date: Wed, 16 Sep 2020 14:21:27 +0800 [thread overview]
Message-ID: <20200916062127.190774-1-miaoqinglang@huawei.com> (raw)
Note that error handling on the result of a call to platform_get_resource()
is unneeded when the value is passed to devm_ioremap_resource(), so remove
it. Then use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
arch/mips/cavium-octeon/octeon-usb.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 950e6c6e8..97f6dc31e 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -498,7 +498,6 @@ static int __init dwc3_octeon_device_init(void)
const char compat_node_name[] = "cavium,octeon-7130-usb-uctl";
struct platform_device *pdev;
struct device_node *node;
- struct resource *res;
void __iomem *base;
/*
@@ -516,20 +515,13 @@ static int __init dwc3_octeon_device_init(void)
if (!pdev)
return -ENODEV;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res == NULL) {
- put_device(&pdev->dev);
- dev_err(&pdev->dev, "No memory resources\n");
- return -ENXIO;
- }
-
/*
* The code below maps in the registers necessary for
* setting up the clocks and reseting PHYs. We must
* release the resources so the dwc3 subsystem doesn't
* know the difference.
*/
- base = devm_ioremap_resource(&pdev->dev, res);
+ base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
put_device(&pdev->dev);
return PTR_ERR(base);
--
2.23.0
next reply other threads:[~2020-09-16 6:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 6:21 Qinglang Miao [this message]
2020-09-18 13:48 ` Thomas Bogendoerfer
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=20200916062127.190774-1-miaoqinglang@huawei.com \
--to=miaoqinglang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tsbogend@alpha.franken.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
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®