Skip to content

Commit

Permalink
can: hi311x: fix a signedness bug in hi3110_cmd()
Browse files Browse the repository at this point in the history
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: 57e83fb ("can: hi311x: Add Holt HI-311x CAN driver")
Link: https://lore.kernel.org/r/20210729141246.GA1267@kili
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
Dan Carpenter authored and marckleinebudde committed Jul 30, 2021
1 parent 8a7b46f commit f6b3c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/spi/hi311x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f6b3c78

Please sign in to comment.