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 <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
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)