Thread (25 messages) flat view 25 messages, 2 authors, 2016-06-06
STALE3716d

[PATCH 04/22] i2c: core: Use of_device_match()

From: Thierry Reding <hidden>
Date: 2016-06-06 08:32:27
Also in: lkml
Subsystem: i2c subsystem, the rest · Maintainers: Andi Shyti, Linus Torvalds

From: Thierry Reding <redacted>

Use the common implementation rather than the I2C-private variant.

Signed-off-by: Thierry Reding <redacted>
---
 drivers/i2c/i2c-core.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index af11b658984d..f0c7d8a64013 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1426,18 +1426,13 @@ static void of_i2c_register_devices(struct i2c_adapter *adap)
 	}
 }
 
-static int of_dev_node_match(struct device *dev, void *data)
-{
-	return dev->of_node == data;
-}
-
 /* must call put_device() when done with returned i2c_client device */
 struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
 {
 	struct device *dev;
 	struct i2c_client *client;
 
-	dev = bus_find_device(&i2c_bus_type, NULL, node, of_dev_node_match);
+	dev = bus_find_device(&i2c_bus_type, NULL, node, of_device_match);
 	if (!dev)
 		return NULL;
 
@@ -1455,7 +1450,7 @@ struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
 	struct device *dev;
 	struct i2c_adapter *adapter;
 
-	dev = bus_find_device(&i2c_bus_type, NULL, node, of_dev_node_match);
+	dev = bus_find_device(&i2c_bus_type, NULL, node, of_device_match);
 	if (!dev)
 		return NULL;
 
-- 
2.8.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help