lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191229104325.10132-3-tiny.windzz@gmail.com>
Date:   Sun, 29 Dec 2019 10:43:25 +0000
From:   Yangtao Li <tiny.windzz@...il.com>
To:     corbet@....net, gregkh@...uxfoundation.org,
        bgolaszewski@...libre.com, arnd@...db.de, sboyd@...nel.org,
        mchehab+samsung@...nel.org, matti.vaittinen@...rohmeurope.com,
        phil.edworthy@...esas.com, suzuki.poulose@....com,
        saravanak@...gle.com, heikki.krogerus@...ux.intel.com,
        dan.j.williams@...el.com, joe@...ches.com,
        jeffrey.t.kirsher@...el.com, mans@...sr.com, tglx@...utronix.de,
        hdegoede@...hat.com, akpm@...ux-foundation.org,
        ulf.hansson@...aro.org, ztuowen@...il.com,
        sergei.shtylyov@...entembedded.com, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH 2/2] drivers: platform: provide devm_platform_ioremap_resource_nocache()

Provide a nocache variant of devm_platform_ioremap_resource().

Signed-off-by: Yangtao Li <tiny.windzz@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ