From: Dejin Zheng <zhengdejin5@gmail.com>
To: gregkh@linuxfoundation.org, rafael@kernel.org,
hminas@synopsys.com, mathias.nyman@intel.com,
bgolaszewski@baylibre.com, arnd@arndb.de,
geert+renesas@glider.be, tomas.winkler@intel.com,
tglx@linutronix.de, hdegoede@redhat.com, treding@nvidia.com,
suzuki.poulose@arm.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Dejin Zheng <zhengdejin5@gmail.com>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH v4 5/5] driver core: platform: Reimplement devm_platform_ioremap_resource
Date: Tue, 24 Mar 2020 00:06:12 +0800 [thread overview]
Message-ID: <20200323160612.17277-6-zhengdejin5@gmail.com> (raw)
In-Reply-To: <20200323160612.17277-1-zhengdejin5@gmail.com>
Reimplement devm_platform_ioremap_resource() by calling
devm_platform_ioremap_and_get_resource() with res = NULL to
simplify the code.
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
v3 -> v4:
- modified this patch's commit comment.
v2 -> v3:
- add this patch to simplify the code by Geert's suggestion.
drivers/base/platform.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 3e8a9fb91dcd..16b54ebc6958 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -95,10 +95,7 @@ EXPORT_SYMBOL_GPL(devm_platform_get_and_ioremap_resource);
void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index)
{
- struct resource *res;
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- return devm_ioremap_resource(&pdev->dev, res);
+ return devm_platform_get_and_ioremap_resource(pdev, index, NULL);
}
EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);
--
2.25.0
prev parent reply other threads:[~2020-03-23 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 16:06 [PATCH v4 0/5] drivers: new helper for ioremapping memory resources Dejin Zheng
2020-03-23 16:06 ` [PATCH v4 1/5] drivers: provide devm_platform_get_and_ioremap_resource() Dejin Zheng
2020-03-23 16:06 ` [PATCH v4 2/5] usb: host: xhci-plat: convert to devm_platform_get_and_ioremap_resource Dejin Zheng
2020-03-23 16:06 ` [PATCH v4 3/5] usb: host: hisilicon: " Dejin Zheng
2020-03-23 16:06 ` [PATCH v4 4/5] usb: dwc2: " Dejin Zheng
2020-03-23 16:06 ` Dejin Zheng [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=20200323160612.17277-6-zhengdejin5@gmail.com \
--to=zhengdejin5@gmail.com \
--cc=arnd@arndb.de \
--cc=bgolaszewski@baylibre.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=hminas@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=rafael@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=tglx@linutronix.de \
--cc=tomas.winkler@intel.com \
--cc=treding@nvidia.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
all inboxes | Powered by JetHome®