Switch to using the bus_find_device_by_of_node helper

Cc: Mathieu Poirier <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
---
 drivers/hwtracing/coresight/of_coresight.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/hwtracing/coresight/of_coresight.c 
b/drivers/hwtracing/coresight/of_coresight.c
index 7045930..9b7a0c0 100644
--- a/drivers/hwtracing/coresight/of_coresight.c
+++ b/drivers/hwtracing/coresight/of_coresight.c
@@ -18,11 +18,6 @@
 #include <asm/smp_plat.h>
 
 
-static int of_dev_node_match(struct device *dev, void *data)
-{
-       return dev->of_node == data;
-}
-
 static struct device *
 of_coresight_get_endpoint_device(struct device_node *endpoint)
 {
@@ -32,8 +27,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
         * If we have a non-configurable replicator, it will be found on the
         * platform bus.
         */
-       dev = bus_find_device(&platform_bus_type, NULL,
-                             endpoint, of_dev_node_match);
+       dev = bus_find_device_by_of_node(&platform_bus_type, NULL, endpoint);
        if (dev)
                return dev;
 
@@ -41,8 +35,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
         * We have a configurable component - circle through the AMBA bus
         * looking for the device that matches the endpoint node.
         */
-       return bus_find_device(&amba_bustype, NULL,
-                              endpoint, of_dev_node_match);
+       return bus_find_device_by_of_node(&amba_bustype, NULL, endpoint);
 }
 
 static inline bool of_coresight_legacy_ep_is_input(struct device_node *ep)
-- 
2.7.4

Reply via email to