Commit 769ff528 authored by Su Hui's avatar Su Hui Committed by Lee Jones
Browse files

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: default avatarSu Hui <suhui@nfschina.com>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20231130051155.1235972-1-suhui@nfschina.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 64d9799d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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,