summaryrefslogtreecommitdiffstats
path: root/lib/devres.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2019-10-22 10:43:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-05 18:32:21 +0100
commitb873af620e58863b70ae9cf97f6fab4cf4c544af (patch)
tree11d74bd61433e6949461435d450b1819c9de4218 /lib/devres.c
parent6e924822752cb1664fa8f76cb9c0927490bca139 (diff)
downloadlinux-b873af620e58863b70ae9cf97f6fab4cf4c544af.tar.gz
linux-b873af620e58863b70ae9cf97f6fab4cf4c544af.tar.bz2
linux-b873af620e58863b70ae9cf97f6fab4cf4c544af.zip
lib: devres: provide devm_ioremap_resource_wc()
Provide a variant of devm_ioremap_resource() for write-combined ioremap. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20191022084318.22256-4-brgl@bgdev.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/devres.c')
-rw-r--r--lib/devres.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/devres.c b/lib/devres.c
index a14c727128c1..97fb44e5b4d6 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -169,6 +169,21 @@ void __iomem *devm_ioremap_resource(struct device *dev,
}
EXPORT_SYMBOL(devm_ioremap_resource);
+/**
+ * devm_ioremap_resource_wc() - write-combined variant of
+ * devm_ioremap_resource()
+ * @dev: generic device to handle the resource for
+ * @res: resource to be handled
+ *
+ * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
+ * on failure. Usage example:
+ */
+void __iomem *devm_ioremap_resource_wc(struct device *dev,
+ const struct resource *res)
+{
+ return __devm_ioremap_resource(dev, res, DEVM_IOREMAP_WC);
+}
+
/*
* devm_of_iomap - Requests a resource and maps the memory mapped IO
* for a given device_node managed by a given device