Skip to contentSkip to conversation

of/i2c: don't register disabled devices

PATCH In review Dmitry Eremin-Solenikov 2 participants 3 messages Feb 20, 2013 – Feb 21, 2013 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of/i2c: don't register disabled devices

Don't register i2c slave device tree nodes which have status = "disabled" property.

---
 drivers/of/of_i2c.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/of/of_i2c.c +3 -0
index 1e173f3..63f3236 100644
@@ -35,6 +35,9 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
 		const __be32 *addr;
 		int len;
 
+		if (!of_device_is_available(node))
+			continue;
+
 		dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name);
 
 		if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) {
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Dmitry Eremin-Solenikov

Don't register i2c slave device tree nodes which have status = "disabled" property.

This is already in 3.8.

Rob

Quoted 20 lines
---
 drivers/of/of_i2c.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/of/of_i2c.c +3 -0
index 1e173f3..63f3236 100644
@@ -35,6 +35,9 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
 		const __be32 *addr;
 		int len;
 
+		if (!of_device_is_available(node))
+			continue;
+
 		dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name);
 
 		if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) {
#2 lore raw
Quoted 6 lines · Rob Herring
Quoted 3 lines · Dmitry Eremin-Solenikov

Don't register i2c slave device tree nodes which have status = "disabled" property.

This is already in 3.8.

Ah, true. Sorry for the noise then.

Signature · 2 lines
With best wishes
Dmitry