[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1405321966-28184-3-git-send-email-m.szyprowski@samsung.com>
Date: Mon, 14 Jul 2014 09:12:44 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
linaro-mm-sig@...ts.linaro.org, devicetree@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Michal Nazarewicz <mina86@...a86.com>,
Grant Likely <grant.likely@...aro.org>,
Tomasz Figa <t.figa@...sung.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
Laura Abbott <lauraa@...eaurora.org>,
Nishanth Peethambaran <nishanth.p@...il.com>,
Marc <marc.ceeeee@...il.com>,
Josh Cartwright <joshc@...eaurora.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Paul Mackerras <paulus@...ba.org>,
Jon Medhurst <tixy@...aro.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
"Aneesh Kumar K.V." <aneesh.kumar@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH v2 2/4] drivers: of: initialize and assign reserved memory to
newly created devices
Use recently introduced of_reserved_mem_device_init() function to
automatically assign respective reserved memory region to the newly created
platform and amba device.
Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
---
drivers/of/platform.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 6c48d73a7fd7..a7f967866f13 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -21,6 +21,7 @@
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
const struct of_device_id of_default_bus_match_table[] = {
@@ -237,12 +238,15 @@ static struct platform_device *of_platform_device_create_pdata(
dev->dev.bus = &platform_bus_type;
dev->dev.platform_data = platform_data;
+ of_reserved_mem_device_init(&dev->dev);
+
/* We do not fill the DMA ops for platform devices by default.
* This is currently the responsibility of the platform code
* to do such, possibly using a device notifier
*/
if (of_device_add(dev) != 0) {
+ of_reserved_mem_device_release(&dev->dev);
platform_device_put(dev);
goto err_clear_flag;
}
@@ -304,6 +308,8 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
else
of_device_make_bus_id(&dev->dev);
+ of_reserved_mem_device_init(&dev->dev);
+
/* Allow the HW Peripheral ID to be overridden */
prop = of_get_property(node, "arm,primecell-periphid", NULL);
if (prop)
@@ -330,6 +336,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
return dev;
err_free:
+ of_reserved_mem_device_release(&dev->dev);
amba_device_put(dev);
err_clear_flag:
of_node_clear_flag(node, OF_POPULATED);
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists