wlcore: spi: remove unnecessary variable
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Fri, 9 Jun 2017 03:24:30 +0000 (22:24 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 13 Jun 2017 07:06:22 +0000 (10:06 +0300)
Remove unnecessary variable and refactor the code.

Addresses-Coverity-ID: 1365000
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ti/wlcore/spi.c

index 698bfa9..fdabb92 100644 (file)
@@ -366,17 +366,14 @@ static int __wl12xx_spi_raw_write(struct device *child, int addr,
 static int __must_check wl12xx_spi_raw_write(struct device *child, int addr,
                                             void *buf, size_t len, bool fixed)
 {
-       int ret;
-
        /* The ELP wakeup write may fail the first time due to internal
         * hardware latency. It is safer to send the wakeup command twice to
         * avoid unexpected failures.
         */
        if (addr == HW_ACCESS_ELP_CTRL_REG)
-               ret = __wl12xx_spi_raw_write(child, addr, buf, len, fixed);
-       ret = __wl12xx_spi_raw_write(child, addr, buf, len, fixed);
+               __wl12xx_spi_raw_write(child, addr, buf, len, fixed);
 
-       return ret;
+       return __wl12xx_spi_raw_write(child, addr, buf, len, fixed);
 }
 
 /**