netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: mdiobus_register(): initialize all phy_map entries
@ 2006-05-10 16:12 Herbert Valerio Riedel
  0 siblings, 0 replies; only message in thread
From: Herbert Valerio Riedel @ 2006-05-10 16:12 UTC (permalink / raw)
  To: netdev; +Cc: Andy Fleming


make sure phy_map entries whose PHY address is masked are initialized
to NULL, given that other code (such as mdiobus_unregister for
instance) assumes that non-NULL phy_map entries are allocated
phy_devices

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
---

 drivers/net/phy/mdio_bus.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Index: b/drivers/net/phy/mdio_bus.c
===================================================================
--- a/drivers/net/phy/mdio_bus.c	2006-05-10 17:02:12.000000000 +0200
+++ b/drivers/net/phy/mdio_bus.c	2006-05-10 17:05:27.000000000 +0200
@@ -60,8 +60,10 @@
 	for (i = 0; i < PHY_MAX_ADDR; i++) {
 		struct phy_device *phydev;
 
-		if (bus->phy_mask & (1 << i))
+		if (bus->phy_mask & (1 << i)) {
+			bus->phy_map[i] = NULL;
 			continue;
+		}
 
 		phydev = get_phy_device(bus, i);
 
-- 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-10 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10 16:12 [PATCH] phy: mdiobus_register(): initialize all phy_map entries Herbert Valerio Riedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).