projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8400291
)
backlight: l4f00242t03: Add check for spi_setup
author
Chen Ni
<nichen@iscas.ac.cn>
Fri, 5 Jul 2024 09:28:00 +0000
(17:28 +0800)
committer
Lee Jones
<lee@kernel.org>
Thu, 1 Aug 2024 12:40:14 +0000
(13:40 +0100)
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>
drivers/video/backlight/l4f00242t03.c
patch
|
blob
|
history
diff --git
a/drivers/video/backlight/l4f00242t03.c
b/drivers/video/backlight/l4f00242t03.c
index
dd0874f
..
4175a46
100644
(file)
--- a/
drivers/video/backlight/l4f00242t03.c
+++ b/
drivers/video/backlight/l4f00242t03.c
@@
-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;