Skip to content

Commit fea88a1

Browse files
Chen Nilag-linaro
authored andcommitted
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: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20240705092800.3221159-1-nichen@iscas.ac.cn Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 8400291 commit fea88a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/video/backlight/l4f00242t03.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static const struct lcd_ops l4f_ops = {
166166
static int l4f00242t03_probe(struct spi_device *spi)
167167
{
168168
struct l4f00242t03_priv *priv;
169+
int ret;
169170

170171
priv = devm_kzalloc(&spi->dev, sizeof(struct l4f00242t03_priv),
171172
GFP_KERNEL);
@@ -174,7 +175,9 @@ static int l4f00242t03_probe(struct spi_device *spi)
174175

175176
spi_set_drvdata(spi, priv);
176177
spi->bits_per_word = 9;
177-
spi_setup(spi);
178+
ret = spi_setup(spi);
179+
if (ret < 0)
180+
return dev_err_probe(&spi->dev, ret, "Unable to setup spi.\n");
178181

179182
priv->spi = spi;
180183

0 commit comments

Comments
 (0)