aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qualcomm
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2021-05-08 14:36:33 +0200
committerDavid S. Miller <davem@davemloft.net>2021-05-10 14:29:18 -0700
commitb76078df15935b54c353eb0461c95a6eaf73c7ca (patch)
treec16605662796e6f0773a395ca056dcb70975f49c /drivers/net/ethernet/qualcomm
parentneighbour: Remove redundant initialization of 'bucket' (diff)
downloadlinux-dev-b76078df15935b54c353eb0461c95a6eaf73c7ca.tar.xz
linux-dev-b76078df15935b54c353eb0461c95a6eaf73c7ca.zip
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: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm')
-rw-r--r--drivers/net/ethernet/qualcomm/qca_spi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index ab9b02574a15..3e2a54c2fc83 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -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,