aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2016-10-11 17:26:13 -0400
committerWolfram Sang <wsa@the-dreams.de>2016-10-11 17:37:26 -0400
commitb2edcdae3d9a29b25f6c161a8711caa74ce49991 (patch)
tree010bb73a88b60fb40dd7731d7059979f51ce57f0 /drivers/i2c/i2c-core.c
parent74f47f07e53daeca1d16812fa7c9bf3145bd8216 (diff)
parent7e4c224abfe8e2a00f56a2ef0198e6de3ca1852c (diff)
Merge tag 'tegra-for-4.8-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into i2c/for-next
[wsa: fell through the cracks, applied to 4.9 now] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> i2c: 'i2c-bus' node support for v4.8-rc1 This includes the device tree binding and I2C core changes to support the i2c-bus subnode that I2C masters can use to describe their slaves in a separate namespace and therefore avoid clashing with potentially other subnodes.
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 98fffa3a09f7..5ab67219f71e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1680,7 +1680,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
1680 1680
1681static void of_i2c_register_devices(struct i2c_adapter *adap) 1681static void of_i2c_register_devices(struct i2c_adapter *adap)
1682{ 1682{
1683 struct device_node *node; 1683 struct device_node *bus, *node;
1684 1684
1685 /* Only register child devices if the adapter has a node pointer set */ 1685 /* Only register child devices if the adapter has a node pointer set */
1686 if (!adap->dev.of_node) 1686 if (!adap->dev.of_node)
@@ -1688,11 +1688,17 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
1688 1688
1689 dev_dbg(&adap->dev, "of_i2c: walking child nodes\n"); 1689 dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
1690 1690
1691 for_each_available_child_of_node(adap->dev.of_node, node) { 1691 bus = of_get_child_by_name(adap->dev.of_node, "i2c-bus");
1692 if (!bus)
1693 bus = of_node_get(adap->dev.of_node);
1694
1695 for_each_available_child_of_node(bus, node) {
1692 if (of_node_test_and_set_flag(node, OF_POPULATED)) 1696 if (of_node_test_and_set_flag(node, OF_POPULATED))
1693 continue; 1697 continue;
1694 of_i2c_register_device(adap, node); 1698 of_i2c_register_device(adap, node);
1695 } 1699 }
1700
1701 of_node_put(bus);
1696} 1702}
1697 1703
1698static int of_dev_node_match(struct device *dev, void *data) 1704static int of_dev_node_match(struct device *dev, void *data)