Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414753 > unrolled thread

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

Started byThierry Reding <thierry.reding@gmail.com>
First post2016-06-06 10:40 +0200
Last post2016-06-06 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 04/22] i2c: core: Use of_device_match() Thierry Reding <thierry.reding@gmail.com> - 2016-06-06 10:40 +0200

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

FromThierry Reding <thierry.reding@gmail.com>
Date2016-06-06 10:40 +0200
Subject[PATCH 04/22] i2c: core: Use of_device_match()
Message-ID<rGYeK-2qH-25@gated-at.bofh.it>
From: Thierry Reding <treding@nvidia.com>

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

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web