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


Groups > linux.kernel > #1414754

[PATCH 09/22] of: mdio: Use of_device_match()

From Thierry Reding <thierry.reding@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 09/22] of: mdio: Use of_device_match()
Date 2016-06-06 10:40 +0200
Message-ID <rGYeK-2qH-19@gated-at.bofh.it> (permalink)
References <rGYeJ-2qH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Thierry Reding <treding@nvidia.com>

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

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/of/of_mdio.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index e051e1b57609..5d7d95900f44 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -16,6 +16,7 @@
 #include <linux/phy.h>
 #include <linux/phy_fixed.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/of_irq.h>
 #include <linux/of_mdio.h>
@@ -265,12 +266,6 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 }
 EXPORT_SYMBOL(of_mdiobus_register);
 
-/* Helper function for of_phy_find_device */
-static int of_phy_match(struct device *dev, void *phy_np)
-{
-	return dev->of_node == phy_np;
-}
-
 /**
  * of_phy_find_device - Give a PHY node, find the phy_device
  * @phy_np: Pointer to the phy's device tree node
@@ -286,7 +281,7 @@ struct phy_device *of_phy_find_device(struct device_node *phy_np)
 	if (!phy_np)
 		return NULL;
 
-	d = bus_find_device(&mdio_bus_type, NULL, phy_np, of_phy_match);
+	d = bus_find_device(&mdio_bus_type, NULL, phy_np, of_device_match);
 	if (d) {
 		mdiodev = to_mdio_device(d);
 		if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY)
-- 
2.8.3

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web