Skip to content

Commit

Permalink
backlight: hx8357: Make use of dev_err_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Lee Jones committed Mar 7, 2024
1 parent 2f15475 commit 7244d89
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/video/backlight/hx8357.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 7244d89

Please sign in to comment.