lkml.org 
[lkml]   [2015]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] ARM OMAP2+ GPMC: add bus children
Date
This patch adds support for spawning busses as children of the GPMC.

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
---
arch/arm/mach-omap2/gpmc.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 4fa5ff1..c6c8543 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -27,6 +27,7 @@
#include <linux/of_address.h>
#include <linux/of_mtd.h>
#include <linux/of_device.h>
+#include <linux/of_platform.h>
#include <linux/mtd/nand.h>
#include <linux/pm_runtime.h>

@@ -1589,9 +1590,20 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
gpmc_cs_set_timings(cs, &gpmc_t);

no_timings:
- if (of_platform_device_create(child, NULL, &pdev->dev))
+
+ if (of_match_node(of_default_bus_match_table, child)) {
+
+ /* ignore return code, because 0 is ambiguous */
+ of_platform_populate(child, of_default_bus_match_table, NULL, &pdev->dev);
return 0;

+ } else {
+
+ if (of_platform_device_create(child, NULL, &pdev->dev))
+ return 0;
+
+ }
+
dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
ret = -ENODEV;

--
2.3.0


\
 
 \ /
  Last update: 2015-02-16 17:01    [W:0.140 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site