diff options
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/lantiq_gswip.c | 8 | ||||
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_main.c | 6 | ||||
-rw-r--r-- | drivers/net/dsa/sja1105/sja1105_spi.c | 11 |
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index 553831df58fe..4e64835deac2 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -1235,7 +1235,7 @@ static void gswip_port_fast_age(struct dsa_switch *ds, int port) err = gswip_pce_table_entry_read(priv, &mac_bridge); if (err) { - dev_err(priv->dev, "failed to read mac brigde: %d\n", + dev_err(priv->dev, "failed to read mac bridge: %d\n", err); return; } @@ -1252,7 +1252,7 @@ static void gswip_port_fast_age(struct dsa_switch *ds, int port) mac_bridge.valid = false; err = gswip_pce_table_entry_write(priv, &mac_bridge); if (err) { - dev_err(priv->dev, "failed to write mac brigde: %d\n", + dev_err(priv->dev, "failed to write mac bridge: %d\n", err); return; } @@ -1328,7 +1328,7 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port, err = gswip_pce_table_entry_write(priv, &mac_bridge); if (err) - dev_err(priv->dev, "failed to write mac brigde: %d\n", err); + dev_err(priv->dev, "failed to write mac bridge: %d\n", err); return err; } @@ -1360,7 +1360,7 @@ static int gswip_port_fdb_dump(struct dsa_switch *ds, int port, err = gswip_pce_table_entry_read(priv, &mac_bridge); if (err) { - dev_err(priv->dev, "failed to write mac brigde: %d\n", + dev_err(priv->dev, "failed to write mac bridge: %d\n", err); return err; } diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index 50ff625c85d6..0663b78a2f6c 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -1070,7 +1070,11 @@ static u8 sja1105_stp_state_get(struct sja1105_private *priv, int port) return BR_STATE_LEARNING; if (mac[port].ingress && mac[port].egress && mac[port].dyn_learn) return BR_STATE_FORWARDING; - return -EINVAL; + /* This is really an error condition if the MAC was in none of the STP + * states above. But treating the port as disabled does nothing, which + * is adequate, and it also resets the MAC to a known state later on. + */ + return BR_STATE_DISABLED; } /* For situations where we need to change a setting at runtime that is only diff --git a/drivers/net/dsa/sja1105/sja1105_spi.c b/drivers/net/dsa/sja1105/sja1105_spi.c index 244a94ccfc18..2eb70b8acfc3 100644 --- a/drivers/net/dsa/sja1105/sja1105_spi.c +++ b/drivers/net/dsa/sja1105/sja1105_spi.c @@ -466,14 +466,15 @@ int sja1105_static_config_upload(struct sja1105_private *priv) "invalid, retrying...\n"); continue; } - } while (--retries && (status.crcchkl == 1 || status.crcchkg == 1 || - status.configs == 0 || status.ids == 1)); + /* Success! */ + break; + } while (--retries); if (!retries) { rc = -EIO; dev_err(dev, "Failed to upload config to device, giving up\n"); goto out; - } else if (retries != RETRIES - 1) { + } else if (retries != RETRIES) { dev_info(dev, "Succeeded after %d tried\n", RETRIES - retries); } @@ -483,7 +484,7 @@ out: return rc; } -struct sja1105_regs sja1105et_regs = { +static struct sja1105_regs sja1105et_regs = { .device_id = 0x0, .prod_id = 0x100BC3, .status = 0x1, @@ -508,7 +509,7 @@ struct sja1105_regs sja1105et_regs = { .rmii_ext_tx_clk = {0x100018, 0x10001F, 0x100026, 0x10002D, 0x100034}, }; -struct sja1105_regs sja1105pqrs_regs = { +static struct sja1105_regs sja1105pqrs_regs = { .device_id = 0x0, .prod_id = 0x100BC3, .status = 0x1, |