From: Yangtao Li <tiny.windzz@gmail.com>
To: corbet@lwn.net, gregkh@linuxfoundation.org,
bgolaszewski@baylibre.com, arnd@arndb.de, sboyd@kernel.org,
mchehab+samsung@kernel.org, matti.vaittinen@fi.rohmeurope.com,
phil.edworthy@renesas.com, suzuki.poulose@arm.com,
saravanak@google.com, heikki.krogerus@linux.intel.com,
dan.j.williams@intel.com, joe@perches.com,
jeffrey.t.kirsher@intel.com, mans@mansr.com, tglx@linutronix.de,
hdegoede@redhat.com, akpm@linux-foundation.org,
ulf.hansson@linaro.org, ztuowen@gmail.com,
sergei.shtylyov@cogentembedded.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Yangtao Li <tiny.windzz@gmail.com>
Subject: [PATCH 2/2] drivers: platform: provide devm_platform_ioremap_resource_nocache()
Date: Sun, 29 Dec 2019 10:43:25 +0000 [thread overview]
Message-ID: <20191229104325.10132-3-tiny.windzz@gmail.com> (raw)
In-Reply-To: <20191229104325.10132-1-tiny.windzz@gmail.com>
Provide a nocache variant of devm_platform_ioremap_resource().
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
.../driver-api/driver-model/devres.rst | 1 +
drivers/base/platform.c | 19 +++++++++++++++++++
include/linux/platform_device.h | 3 +++
3 files changed, 23 insertions(+)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index af1b1b9e3a17..3b79a3207490 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -320,6 +320,7 @@ IOMAP
devm_ioremap_resource_nocache()
devm_ioremap_resource_wc()
devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device
+ devm_platform_ioremap_resource_nocache()
devm_platform_ioremap_resource_wc()
devm_platform_ioremap_resource_byname()
devm_iounmap()
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index cf6b6b722e5c..80f420b9b4d7 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -79,6 +79,25 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
}
EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);
+/**
+ * devm_platform_ioremap_resource_nocache - nocache variant of
+ * devm_platform_ioremap_resource()
+ *
+ * @pdev: platform device to use both for memory resource lookup as well as
+ * resource management
+ * @index: resource index
+ */
+void __iomem *
+devm_platform_ioremap_resource_nocache(struct platform_device *pdev,
+ unsigned int index)
+{
+ struct resource *res;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, index);
+ return devm_ioremap_resource_nocache(&pdev->dev, res);
+}
+EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_nocache);
+
/**
* devm_platform_ioremap_resource_wc - write-combined variant of
* devm_platform_ioremap_resource()
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 276a03c24691..b803e670b1c5 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -58,6 +58,9 @@ extern void __iomem *
devm_platform_ioremap_resource(struct platform_device *pdev,
unsigned int index);
extern void __iomem *
+devm_platform_ioremap_resource_nocache(struct platform_device *pdev,
+ unsigned int index);
+extern void __iomem *
devm_platform_ioremap_resource_wc(struct platform_device *pdev,
unsigned int index);
extern void __iomem *
--
2.17.1
next prev parent reply other threads:[~2019-12-29 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-29 10:43 [PATCH 1/2] lib: devres: provide devm_ioremap_resource_nocache() Yangtao Li
2019-12-29 10:43 ` [PATCH] platform: goldfish: pipe: switch to platform_get_irq Yangtao Li
2019-12-29 10:44 ` Frank Lee
2019-12-29 10:43 ` Yangtao Li [this message]
2019-12-29 12:12 ` [PATCH 2/2] drivers: platform: provide devm_platform_ioremap_resource_nocache() Bartosz Golaszewski
2019-12-29 12:11 ` [PATCH 1/2] lib: devres: provide devm_ioremap_resource_nocache() Bartosz Golaszewski
2019-12-29 14:36 ` Frank Lee
2019-12-29 15:04 ` Arnd Bergmann
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=20191229104325.10132-3-tiny.windzz@gmail.com \
--to=tiny.windzz@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bgolaszewski@baylibre.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=joe@perches.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mans@mansr.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mchehab+samsung@kernel.org \
--cc=phil.edworthy@renesas.com \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=suzuki.poulose@arm.com \
--cc=tglx@linutronix.de \
--cc=ulf.hansson@linaro.org \
--cc=ztuowen@gmail.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).