summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/sja1105/sja1105_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_spi.c')
-rw-r--r--drivers/net/dsa/sja1105/sja1105_spi.c11
1 files changed, 6 insertions, 5 deletions
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,