diff mbox

[U-Boot,v2,2/3] net: phy: Change to print all phys that are not found

Message ID 1444277971-31252-2-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Bin Meng Oct. 8, 2015, 4:19 a.m. UTC
In get_phy_device_by_mask(), when no phy is found, currently we only
print a message to show the first phy address that is not found. But
this is not always the case as multiple phys can be specified by
phy_mask. Change to print all phys that are not found, and to reduce
the console boot log, change to use 'debug' instead of 'printf'.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v2: None

 drivers/net/phy/phy.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Joe Hershberger Oct. 29, 2015, 7:29 p.m. UTC | #1
On Wed, Oct 7, 2015 at 11:19 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> In get_phy_device_by_mask(), when no phy is found, currently we only
> print a message to show the first phy address that is not found. But
> this is not always the case as multiple phys can be specified by
> phy_mask. Change to print all phys that are not found, and to reduce
> the console boot log, change to use 'debug' instead of 'printf'.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot-net/master, thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 4063894..d0b3e85 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -671,7 +671,14 @@  static struct phy_device *get_phy_device_by_mask(struct mii_dev *bus,
 		if (phydev)
 			return phydev;
 	}
-	printf("Phy %d not found\n", ffs(phy_mask) - 1);
+
+	debug("\n%s PHY: ", bus->name);
+	while (phy_mask) {
+		int addr = ffs(phy_mask) - 1;
+		debug("%d ", addr);
+		phy_mask &= ~(1 << addr);
+	}
+	debug("not found\n");
 
 	return NULL;
 }