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


Groups > linux.kernel > #1414754 > unrolled thread

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

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

FromThierry Reding <thierry.reding@gmail.com>
Date2016-06-06 10:40 +0200
Subject[PATCH 09/22] of: mdio: Use of_device_match()
Message-ID<rGYeK-2qH-19@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web