Skip to content

Commit 769ff52

Browse files
Su Huilag-linaro
authored andcommitted
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>
1 parent 64d9799 commit 769ff52

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/video/backlight/ili922x.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
269269
spi_message_add_tail(&xfer_regindex, &msg);
270270

271271
ret = spi_sync(spi, &msg);
272+
if (ret < 0) {
273+
dev_err(&spi->dev, "Error sending SPI message 0x%x", ret);
274+
return ret;
275+
}
272276

273277
spi_message_init(&msg);
274278
tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG,

0 commit comments

Comments
 (0)