Commit b76078df authored by Stefan Wahren's avatar Stefan Wahren Committed by David S. Miller

net: qca_spi: Avoid reading signature three times in a row

There is no need to read the signature three times. So bail out
in case the second check failed.
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 48de7c0c
......@@ -506,6 +506,7 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
if (signature != QCASPI_GOOD_SIGNATURE) {
qca->sync = QCASPI_SYNC_UNKNOWN;
netdev_dbg(qca->net_dev, "sync: got CPU on, but signature was invalid, restart\n");
return;
} else {
/* ensure that the WRBUF is empty */
qcaspi_read_register(qca, SPI_REG_WRBUF_SPC_AVA,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment