can: mcp251xfd: remove useless code in mcp251xfd_chip_softreset
authorKaixu Xia <kaixuxia@tencent.com>
Tue, 17 Nov 2020 09:29:12 +0000 (17:29 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 20 Nov 2020 11:06:47 +0000 (12:06 +0100)
It would directly return if the variable err equals to 0 or other errors.
Only when the err equals to -ETIMEDOUT it can reach the 'if (err)'
statement, so the 'if (err)' and last 'return -ETIMEDOUT' statements are
useless. Romove them.

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1605605352-25298-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

index afa8cfc..3297eb7 100644 (file)
@@ -644,10 +644,7 @@ static int mcp251xfd_chip_softreset(const struct mcp251xfd_priv *priv)
                return 0;
        }
 
-       if (err)
-               return err;
-
-       return -ETIMEDOUT;
+       return err;
 }
 
 static int mcp251xfd_chip_clock_init(const struct mcp251xfd_priv *priv)