Commit 87615c96 authored by Russell King's avatar Russell King Committed by David S. Miller

net: dsa: warn if phylink_mac_link_state returns error

Issue a warning to the kernel log if phylink_mac_link_state() returns
an error. This should not occur, but let's make it visible.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3c04d357
...@@ -457,6 +457,7 @@ static void dsa_port_phylink_mac_pcs_get_state(struct phylink_config *config, ...@@ -457,6 +457,7 @@ static void dsa_port_phylink_mac_pcs_get_state(struct phylink_config *config,
{ {
struct dsa_port *dp = container_of(config, struct dsa_port, pl_config); struct dsa_port *dp = container_of(config, struct dsa_port, pl_config);
struct dsa_switch *ds = dp->ds; struct dsa_switch *ds = dp->ds;
int err;
/* Only called for inband modes */ /* Only called for inband modes */
if (!ds->ops->phylink_mac_link_state) { if (!ds->ops->phylink_mac_link_state) {
...@@ -464,8 +465,12 @@ static void dsa_port_phylink_mac_pcs_get_state(struct phylink_config *config, ...@@ -464,8 +465,12 @@ static void dsa_port_phylink_mac_pcs_get_state(struct phylink_config *config,
return; return;
} }
if (ds->ops->phylink_mac_link_state(ds, dp->index, state) < 0) err = ds->ops->phylink_mac_link_state(ds, dp->index, state);
if (err < 0) {
dev_err(ds->dev, "p%d: phylink_mac_link_state() failed: %d\n",
dp->index, err);
state->link = 0; state->link = 0;
}
} }
static void dsa_port_phylink_mac_config(struct phylink_config *config, static void dsa_port_phylink_mac_config(struct phylink_config *config,
......
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