Commit ab1198e5 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: phylink: use %pe for printing errors

Convert phylink to use %pe for printing error codes, which can print
them as errno symbols rather than numbers.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/E1nOyEI-00Buu8-K9@rmk-PC.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 74a335a0
...@@ -1182,9 +1182,8 @@ static int phylink_register_sfp(struct phylink *pl, ...@@ -1182,9 +1182,8 @@ static int phylink_register_sfp(struct phylink *pl,
bus = sfp_bus_find_fwnode(fwnode); bus = sfp_bus_find_fwnode(fwnode);
if (IS_ERR(bus)) { if (IS_ERR(bus)) {
ret = PTR_ERR(bus); phylink_err(pl, "unable to attach SFP bus: %pe\n", bus);
phylink_err(pl, "unable to attach SFP bus: %d\n", ret); return PTR_ERR(bus);
return ret;
} }
pl->sfp_bus = bus; pl->sfp_bus = bus;
...@@ -1380,11 +1379,11 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, ...@@ -1380,11 +1379,11 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
ret = phylink_validate(pl, supported, &config); ret = phylink_validate(pl, supported, &config);
if (ret) { if (ret) {
phylink_warn(pl, "validation of %s with support %*pb and advertisement %*pb failed: %d\n", phylink_warn(pl, "validation of %s with support %*pb and advertisement %*pb failed: %pe\n",
phy_modes(config.interface), phy_modes(config.interface),
__ETHTOOL_LINK_MODE_MASK_NBITS, phy->supported, __ETHTOOL_LINK_MODE_MASK_NBITS, phy->supported,
__ETHTOOL_LINK_MODE_MASK_NBITS, config.advertising, __ETHTOOL_LINK_MODE_MASK_NBITS, config.advertising,
ret); ERR_PTR(ret));
return ret; return ret;
} }
...@@ -2583,8 +2582,9 @@ static int phylink_sfp_config(struct phylink *pl, u8 mode, ...@@ -2583,8 +2582,9 @@ static int phylink_sfp_config(struct phylink *pl, u8 mode,
/* Ignore errors if we're expecting a PHY to attach later */ /* Ignore errors if we're expecting a PHY to attach later */
ret = phylink_validate(pl, support, &config); ret = phylink_validate(pl, support, &config);
if (ret) { if (ret) {
phylink_err(pl, "validation with support %*pb failed: %d\n", phylink_err(pl, "validation with support %*pb failed: %pe\n",
__ETHTOOL_LINK_MODE_MASK_NBITS, support, ret); __ETHTOOL_LINK_MODE_MASK_NBITS, support,
ERR_PTR(ret));
return ret; return ret;
} }
...@@ -2600,10 +2600,12 @@ static int phylink_sfp_config(struct phylink *pl, u8 mode, ...@@ -2600,10 +2600,12 @@ static int phylink_sfp_config(struct phylink *pl, u8 mode,
linkmode_copy(support1, support); linkmode_copy(support1, support);
ret = phylink_validate(pl, support1, &config); ret = phylink_validate(pl, support1, &config);
if (ret) { if (ret) {
phylink_err(pl, "validation of %s/%s with support %*pb failed: %d\n", phylink_err(pl,
"validation of %s/%s with support %*pb failed: %pe\n",
phylink_an_mode_str(mode), phylink_an_mode_str(mode),
phy_modes(config.interface), phy_modes(config.interface),
__ETHTOOL_LINK_MODE_MASK_NBITS, support, ret); __ETHTOOL_LINK_MODE_MASK_NBITS, support,
ERR_PTR(ret));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment