Commit fea88a13 authored by Chen Ni's avatar Chen Ni Committed by Lee Jones

backlight: l4f00242t03: Add check for spi_setup

Add check for the return value of spi_setup() and return the error
if it fails in order to catch the error.
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20240705092800.3221159-1-nichen@iscas.ac.cnSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 8400291e
......@@ -166,6 +166,7 @@ static const struct lcd_ops l4f_ops = {
static int l4f00242t03_probe(struct spi_device *spi)
{
struct l4f00242t03_priv *priv;
int ret;
priv = devm_kzalloc(&spi->dev, sizeof(struct l4f00242t03_priv),
GFP_KERNEL);
......@@ -174,7 +175,9 @@ static int l4f00242t03_probe(struct spi_device *spi)
spi_set_drvdata(spi, priv);
spi->bits_per_word = 9;
spi_setup(spi);
ret = spi_setup(spi);
if (ret < 0)
return dev_err_probe(&spi->dev, ret, "Unable to setup spi.\n");
priv->spi = spi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment