]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: phy: improve logging in phylib
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 15 Jan 2019 20:50:25 +0000 (21:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jan 2019 05:03:44 +0000 (21:03 -0800)
Some time ago phydev_info() and friends have been added. They allow to
improve and simplify logging.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c

index d33e7b3caf03cb9af913f56dc47d732fe9b96a69..c0802d4d084e038af0c4483fc7517f882e78bced 100644 (file)
@@ -13,8 +13,6 @@
  *
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/errno.h>
@@ -814,8 +812,7 @@ int phy_start_interrupts(struct phy_device *phydev)
        if (request_threaded_irq(phydev->irq, NULL, phy_interrupt,
                                 IRQF_ONESHOT | IRQF_SHARED,
                                 phydev_name(phydev), phydev) < 0) {
-               pr_warn("%s: Can't get IRQ %d (PHY)\n",
-                       phydev->mdio.bus->name, phydev->irq);
+               phydev_warn(phydev, "Can't get IRQ %d\n", phydev->irq);
                phydev->irq = PHY_POLL;
                return 0;
        }
index a2423cbb218dfe8083ccbb7cd55db7da57447be0..1c7fe7a4c970dd103659c6f53c950bb918ede02a 100644 (file)
@@ -819,13 +819,13 @@ int phy_device_register(struct phy_device *phydev)
        /* Run all of the fixups for this PHY */
        err = phy_scan_fixups(phydev);
        if (err) {
-               pr_err("PHY %d failed to initialize\n", phydev->mdio.addr);
+               phydev_err(phydev, "failed to initialize\n");
                goto out;
        }
 
        err = device_add(&phydev->mdio.dev);
        if (err) {
-               pr_err("PHY %d failed to add\n", phydev->mdio.addr);
+               phydev_err(phydev, "failed to add\n");
                goto out;
        }