diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-07-29 17:12:46 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-07-30 09:45:03 +0300 |
commit | f6b3c7848e66e9046c8a79a5b88fd03461cc252b (patch) | |
tree | 1af3e7913b1551225add44bed851b59a395b4ad8 /drivers/net/can | |
parent | 8a7b46fa7902a3d36ce44a64f4d66586d66206ea (diff) | |
download | linux-f6b3c7848e66e9046c8a79a5b88fd03461cc252b.tar.xz |
can: hi311x: fix a signedness bug in hi3110_cmd()
The hi3110_cmd() is supposed to return zero on success and negative
error codes on failure, but it was accidentally declared as a u8 when
it needs to be an int type.
Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver")
Link: https://lore.kernel.org/r/20210729141246.GA1267@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/spi/hi311x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c index dd17b8c53e1c..89d9c986a229 100644 --- a/drivers/net/can/spi/hi311x.c +++ b/drivers/net/can/spi/hi311x.c @@ -218,7 +218,7 @@ static int hi3110_spi_trans(struct spi_device *spi, int len) return ret; } -static u8 hi3110_cmd(struct spi_device *spi, u8 command) +static int hi3110_cmd(struct spi_device *spi, u8 command) { struct hi3110_priv *priv = spi_get_drvdata(spi); |