History

net: phy: Added IRQ print to phylink_bringup_phy()

The information about the PHY attached to the PHYLINK instance is useful but is missing the IRQ prints that phy_attached_info() adds. phy_attached_info() is a bit long and it would not be possible to use phylink_info() anyway.

Florian Fainelli committed 6 years ago

Commit e27f1781 parent 76ccf523 files · +17 −4Browse files

Unified · Split

3 files
  1. drivers/net/phy/phy_device.c +10 −2
  2. drivers/net/phy/phylink.c +5 −2
  3. include/linux/phy.h +2 −0
drivers/net/phy/phy_device.c+10−2
@@ -1107,9 +1107,8 @@ void phy_attached_info(struct phy_device *phydev) · 1106 unmodified lines
1107EXPORT_SYMBOL(phy_attached_info);1107EXPORT_SYMBOL(phy_attached_info);
1108 1108
1109#define ATTACHED_FMT "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%s)"1109#define ATTACHED_FMT "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%s)"
1110void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)1110char *phy_attached_info_irq(struct phy_device *phydev)
1111{1111{
1112 const char *drv_name = phydev->drv ? phydev->drv->name : "unbound";
1113 char *irq_str;1112 char *irq_str;
1114 char irq_num[8];1113 char irq_num[8];
1115 1114
@@ -1126,6 +1125,14 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) · 10 unmodified lines
1126 break;1125 break;
1127 }1126 }
1128 1127
1128 return kasprintf(GFP_KERNEL, "%s", irq_str);
1129}
1130EXPORT_SYMBOL(phy_attached_info_irq);
1131
1132void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1133{
1134 const char *drv_name = phydev->drv ? phydev->drv->name : "unbound";
1135 char *irq_str = phy_attached_info_irq(phydev);
1129 1136
1130 if (!fmt) {1137 if (!fmt) {
1131 phydev_info(phydev, ATTACHED_FMT "\n",1138 phydev_info(phydev, ATTACHED_FMT "\n",
@@ -1142,6 +1149,7 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) · 10 unmodified lines
1142 vprintk(fmt, ap);1149 vprintk(fmt, ap);
1143 va_end(ap);1150 va_end(ap);
1144 }1151 }
1152 kfree(irq_str);
1145}1153}
1146EXPORT_SYMBOL(phy_attached_print);1154EXPORT_SYMBOL(phy_attached_print);
1147 1155
drivers/net/phy/phylink.c+5−2
@@ -726,6 +726,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, · 725 unmodified lines
726{726{
727 struct phylink_link_state config;727 struct phylink_link_state config;
728 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);728 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
729 char *irq_str;
729 int ret;730 int ret;
730 731
731 /*732 /*
@@ -761,9 +762,11 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, · 29 unmodified lines
761 phy->phylink = pl;762 phy->phylink = pl;
762 phy->phy_link_change = phylink_phy_change;763 phy->phy_link_change = phylink_phy_change;
763 764
765 irq_str = phy_attached_info_irq(phy);
764 phylink_info(pl,766 phylink_info(pl,
765 "PHY [%s] driver [%s]\n", dev_name(&phy->mdio.dev),767 "PHY [%s] driver [%s] (irq=%s)\n",
766 phy->drv->name);768 dev_name(&phy->mdio.dev), phy->drv->name, irq_str);
769 kfree(irq_str);
767 770
768 mutex_lock(&phy->lock);771 mutex_lock(&phy->lock);
769 mutex_lock(&pl->state_mutex);772 mutex_lock(&pl->state_mutex);
include/linux/phy.h+2−0
@@ -1131,6 +1131,8 @@ static inline void phy_unlock_mdio_bus(struct phy_device *phydev) · 1130 unmodified lines
1131 1131
1132void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)1132void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
1133 __printf(2, 3);1133 __printf(2, 3);
1134char *phy_attached_info_irq(struct phy_device *phydev)
1135 __malloc;
1134void phy_attached_info(struct phy_device *phydev);1136void phy_attached_info(struct phy_device *phydev);
1135 1137
1136/* Clause 22 PHY */1138/* Clause 22 PHY */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t