summaryrefslogtreecommitdiff
path: root/drivers/fsi/fsi-master-hub.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2018-02-12 08:15:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-14 21:11:00 +0300
commitf6a2f8eb73f0dfa7e9293a3ba08f6fcb61dfbbe1 (patch)
tree826f37587c95ddda72a228a9cf287ce68c090d40 /drivers/fsi/fsi-master-hub.c
parent889ee9fe472af1a2407e3e604498a5edaf7f98ce (diff)
downloadlinux-f6a2f8eb73f0dfa7e9293a3ba08f6fcb61dfbbe1.tar.xz
fsi: Match fsi slaves and engines to available dt nodes
This change populates device tree nodes for scanned FSI slaves and engines. If the master populates ->of_node of the FSI master device, we'll look for matching slaves, and under those slaves we'll look for matching engines. This means that FSI drivers will have their ->of_node pointer populated if there's a corresponding DT node, which they can use for further device discover. Presence of device tree nodes is optional, and only required for fsi device drivers that need extra properties, or subordinate devices, to be enumerated. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fsi/fsi-master-hub.c')
-rw-r--r--drivers/fsi/fsi-master-hub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index 133b9bff1d65..3223a671a0ef 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -16,6 +16,7 @@
#include <linux/delay.h>
#include <linux/fsi.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/slab.h>
#include "fsi-master.h"
@@ -274,6 +275,7 @@ static int hub_master_probe(struct device *dev)
hub->master.dev.parent = dev;
hub->master.dev.release = hub_master_release;
+ hub->master.dev.of_node = of_node_get(dev_of_node(dev));
hub->master.n_links = links;
hub->master.read = hub_master_read;
@@ -302,6 +304,8 @@ static int hub_master_remove(struct device *dev)
fsi_master_unregister(&hub->master);
fsi_slave_release_range(hub->upstream->slave, hub->addr, hub->size);
+ of_node_put(hub->master.dev.of_node);
+
return 0;
}