netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Valerio Riedel <hvr@gnu.org>
To: netdev@vger.kernel.org
Cc: Andy Fleming <afleming@freescale.com>
Subject: [PATCH] phy: mdiobus_register(): initialize all phy_map entries
Date: Wed, 10 May 2006 12:12:57 -0400	[thread overview]
Message-ID: <E1FdrJ3-00030d-LS@fencepost.gnu.org> (raw)


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);
 
-- 

                 reply	other threads:[~2006-05-10 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1FdrJ3-00030d-LS@fencepost.gnu.org \
    --to=hvr@gnu.org \
    --cc=afleming@freescale.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).