Skip to contentSkip to conversation

net: mdiobus: Debug print fwnode handle instead of raw pointer

PATCH Superseded Alexander Dahl 3 participants 3 messages Sep 5, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mdiobus: Debug print fwnode handle instead of raw pointer

Was slightly misleading before, because printed is pointer to fwnode, not to phy device, as placement in message suggested. Include header for dev_dbg() declaration while at it.

Output before:

    [  +0.001247] mdio_bus f802c000.ethernet-ffffffff: registered phy 2612f00a fwnode at address 3

Output after:

    [  +0.001229] mdio_bus f802c000.ethernet-ffffffff: registered phy fwnode /ahb/apb/ethernet@f802c000/ethernet-phy@3 at address 3
---
 drivers/net/mdio/fwnode_mdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mdio/fwnode_mdio.c +2 -1
index fd02f5cbc853..b156493d7084 100644
@@ -7,6 +7,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/dev_printk.h>
 #include <linux/fwnode_mdio.h>
 #include <linux/of.h>
 #include <linux/phy.h>
@@ -104,7 +105,7 @@ int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
 		return rc;
 	}
 
-	dev_dbg(&mdio->dev, "registered phy %p fwnode at address %i\n",
+	dev_dbg(&mdio->dev, "registered phy fwnode %pfw at address %i\n",
 		child, addr);
 	return 0;
 }

base-commit: 8e69c96df771ab469cec278edb47009351de4da6

Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alexander Dahl

Was slightly misleading before, because printed is pointer to fwnode, not to phy device, as placement in message suggested. Include header for dev_dbg() declaration while at it.

Output before:

Quoted 7 lines
    [  +0.001247] mdio_bus f802c000.ethernet-ffffffff: registered phy 2612f00a fwnode at address 3

Output after:

    [  +0.001229] mdio_bus f802c000.ethernet-ffffffff: registered phy fwnode /ahb/apb/ethernet@f802c000/ethernet-phy@3 at address 3

The patch itself looks good. But i think this should be for net-next, not net. '2612f00a' is not particularly useful, but i don't think it causes problems for anybody as required by the Stable rules.

So the Subject should be [PATCH net-next]

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

Andrew

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alexander Dahl
Quoted 6 lines · Alexander Dahl

Was slightly misleading before, because printed is pointer to fwnode, not to phy device, as placement in message suggested. Include header for dev_dbg() declaration while at it.

Output before:

Quoted 7 lines
     [  +0.001247] mdio_bus f802c000.ethernet-ffffffff: registered phy 2612f00a fwnode at address 3

Output after:

     [  +0.001229] mdio_bus f802c000.ethernet-ffffffff: registered phy fwnode /ahb/apb/ethernet@f802c000/ethernet-phy@3 at address 3
Signature · 1 line
Florian