summaryrefslogtreecommitdiff
path: root/include/linux/of_address.h
diff options
context:
space:
mode:
authorMatthias Brugger <matthias.bgg@gmail.com>2014-07-18 11:36:39 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-07-23 12:02:30 +0200
commitefd342fb0031a17758571dce42e3f373d94e2fec (patch)
tree914578b4b0944ae5ca884e18ffe13cd223dccb14 /include/linux/of_address.h
parent7e1391876c8f95df9241deb78fa98e799e7bb05e (diff)
of: Provide a function to request and map memory
A call to of_iomap does not request the memory region. This patch adds the function of_io_request_and_map which requests the memory region before mapping it. Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com> Suggested-by: Thomas Gleixner <tglx@linutronix.de> Suggested-by: Rob Herring <robh@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'include/linux/of_address.h')
-rw-r--r--include/linux/of_address.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index c13b8782a4eb..fb7b7221e063 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -109,7 +109,12 @@ static inline bool of_dma_is_coherent(struct device_node *np)
extern int of_address_to_resource(struct device_node *dev, int index,
struct resource *r);
void __iomem *of_iomap(struct device_node *node, int index);
+void __iomem *of_io_request_and_map(struct device_node *device,
+ int index, char *name);
#else
+
+#include <linux/io.h>
+
static inline int of_address_to_resource(struct device_node *dev, int index,
struct resource *r)
{
@@ -120,6 +125,12 @@ static inline void __iomem *of_iomap(struct device_node *device, int index)
{
return NULL;
}
+
+static inline void __iomem *of_io_request_and_map(struct device_node *device,
+ int index, char *name)
+{
+ return IOMEM_ERR_PTR(-EINVAL);
+}
#endif
#if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)