diff options
author | Su Hui <suhui@nfschina.com> | 2023-11-30 13:11:56 +0800 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-12-07 15:54:55 +0000 |
commit | 769ff5283f0d7edc819743f183d51af077411107 (patch) | |
tree | ee5463a14f0620d3208919165fecea9feb81067b /drivers/video | |
parent | 64d9799d6dd04601227f602ae961e3f3d2f1f02b (diff) | |
download | lwn-769ff5283f0d7edc819743f183d51af077411107.tar.gz lwn-769ff5283f0d7edc819743f183d51af077411107.zip |
backlight: ili922x: Add an error code check in ili922x_write()
Clang static analyzer complains that value stored to 'ret' is never read.
Return the error code when spi_sync() failed.
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20231130051155.1235972-1-suhui@nfschina.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/ili922x.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c index 206e77afc56f..c8e0e655dc86 100644 --- a/drivers/video/backlight/ili922x.c +++ b/drivers/video/backlight/ili922x.c @@ -269,6 +269,10 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value) spi_message_add_tail(&xfer_regindex, &msg); ret = spi_sync(spi, &msg); + if (ret < 0) { + dev_err(&spi->dev, "Error sending SPI message 0x%x", ret); + return ret; + } spi_message_init(&msg); tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG, |