Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit def84604 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller
Browse files

net: dsa: sja1105: Make dynamic_config_read return -ENOENT if not found



Conceptually, if an entry is not found in the requested hardware table,
it is not an invalid request - so change the error returned
appropriately.

Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 10c3be65
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -502,7 +502,7 @@ int sja1105_dynamic_config_read(struct sja1105_private *priv,
		 * So don't error out in that case.
		 * So don't error out in that case.
		 */
		 */
		if (!cmd.valident && blk_idx != BLK_IDX_MGMT_ROUTE)
		if (!cmd.valident && blk_idx != BLK_IDX_MGMT_ROUTE)
			return -EINVAL;
			return -ENOENT;
		cpu_relax();
		cpu_relax();
	} while (cmd.valid && --retries);
	} while (cmd.valid && --retries);


+1 −1
Original line number Original line Diff line number Diff line
@@ -948,7 +948,7 @@ static int sja1105_fdb_dump(struct dsa_switch *ds, int port,
		rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,
		rc = sja1105_dynamic_config_read(priv, BLK_IDX_L2_LOOKUP,
						 i, &l2_lookup);
						 i, &l2_lookup);
		/* No fdb entry at i, not an issue */
		/* No fdb entry at i, not an issue */
		if (rc == -EINVAL)
		if (rc == -ENOENT)
			continue;
			continue;
		if (rc) {
		if (rc) {
			dev_err(dev, "Failed to dump FDB: %d\n", rc);
			dev_err(dev, "Failed to dump FDB: %d\n", rc);