Skip to content

Commit c956798

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: sja1105: propagate exact error code from sja1105_dynamic_config_poll_valid()
Currently, sja1105_dynamic_config_wait_complete() returns either 0 or -ETIMEDOUT, because it just looks at the read_poll_timeout() return code. There will be future changes which move some more checks to sja1105_dynamic_config_poll_valid(). It is important that we propagate their exact return code (-ENOENT, -EINVAL), because callers of sja1105_dynamic_config_read() depend on them. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 02c652f commit c956798

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/net/dsa/sja1105/sja1105_dynamic_config.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,13 +1211,14 @@ sja1105_dynamic_config_wait_complete(struct sja1105_private *priv,
12111211
struct sja1105_dyn_cmd *cmd,
12121212
const struct sja1105_dynamic_table_ops *ops)
12131213
{
1214-
int rc;
1215-
1216-
return read_poll_timeout(sja1105_dynamic_config_poll_valid,
1217-
rc, rc != -EAGAIN,
1218-
SJA1105_DYNAMIC_CONFIG_SLEEP_US,
1219-
SJA1105_DYNAMIC_CONFIG_TIMEOUT_US,
1220-
false, priv, cmd, ops);
1214+
int err, rc;
1215+
1216+
err = read_poll_timeout(sja1105_dynamic_config_poll_valid,
1217+
rc, rc != -EAGAIN,
1218+
SJA1105_DYNAMIC_CONFIG_SLEEP_US,
1219+
SJA1105_DYNAMIC_CONFIG_TIMEOUT_US,
1220+
false, priv, cmd, ops);
1221+
return err < 0 ? err : rc;
12211222
}
12221223

12231224
/* Provides read access to the settings through the dynamic interface

0 commit comments

Comments
 (0)