net: dsa: sja1105: Make dynamic_config_read return -ENOENT if not found
authorVladimir Oltean <olteanv@gmail.com>
Sun, 2 Jun 2019 21:11:59 +0000 (00:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Jun 2019 18:49:19 +0000 (11:49 -0700)
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: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_dynamic_config.c
drivers/net/dsa/sja1105/sja1105_main.c

index 7db1f825828735d01f4fa2391f777c16404e379f..02a67df4437ee78d819daaf37a3d0aa99ebbaea1 100644 (file)
@@ -502,7 +502,7 @@ int sja1105_dynamic_config_read(struct sja1105_private *priv,
                 * So don't error out in that case.
                 */
                if (!cmd.valident && blk_idx != BLK_IDX_MGMT_ROUTE)
-                       return -EINVAL;
+                       return -ENOENT;
                cpu_relax();
        } while (cmd.valid && --retries);
 
index c78d2def52f10e5265d6634a7b88d2c118057b97..dc9803efdbbd881c408e0ba11692a555320ad1e3 100644 (file)
@@ -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,
                                                 i, &l2_lookup);
                /* No fdb entry at i, not an issue */
-               if (rc == -EINVAL)
+               if (rc == -ENOENT)
                        continue;
                if (rc) {
                        dev_err(dev, "Failed to dump FDB: %d\n", rc);