summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-01 16:47:44 +0200
committerLee Jones <lee@kernel.org>2024-03-07 09:03:28 +0000
commit7244d89ae306cdbe4d8891d61cff56b670827672 (patch)
tree8a6f9ed0b86a5427c647a3f93a49dbc8ea667e41 /drivers/video
parent2f15475b178e79e55221269e1d6a1120994162a7 (diff)
backlight: hx8357: Make use of dev_err_probe()
Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20240201144951.294215-4-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/hx8357.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 81d0984e9d8b..70a62755805a 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -579,10 +579,8 @@ static int hx8357_probe(struct spi_device *spi)
return -ENOMEM;
ret = spi_setup(spi);
- if (ret < 0) {
- dev_err(&spi->dev, "SPI setup failed.\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "SPI setup failed.\n");
lcd->spi = spi;
@@ -617,10 +615,8 @@ static int hx8357_probe(struct spi_device *spi)
hx8357_lcd_reset(lcdev);
ret = init_fn(lcdev);
- if (ret) {
- dev_err(&spi->dev, "Couldn't initialize panel\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "Couldn't initialize panel\n");
dev_info(&spi->dev, "Panel probed\n");