can: mcp251xfd: mcp251xfd_chip_clock_enable(): simplify return
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 16 Oct 2020 18:49:30 +0000 (20:49 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 29 Jan 2021 08:31:58 +0000 (09:31 +0100)
This patch simplifies the return of the mcp251xfd_chip_clock_enable()
function by direct returning the error.

Link: https://lore.kernel.org/r/20210128104644.2982125-8-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

index 04870a7..da5e8e4 100644 (file)
@@ -596,11 +596,9 @@ static int mcp251xfd_chip_clock_enable(const struct mcp251xfd_priv *priv)
                           "Timeout waiting for Oscillator Ready (osc=0x%08x, osc_reference=0x%08x)\n",
                           osc, osc_reference);
                return -ETIMEDOUT;
-       } else if (err) {
-               return err;
        }
 
-       return 0;
+       return err;
 }
 
 static int mcp251xfd_chip_softreset_do(const struct mcp251xfd_priv *priv)