Commit a8daf03f authored by Cai Huoqing's avatar Cai Huoqing Committed by Sam Ravnborg

drm/panel: td043mtea1: Make use of the helper function dev_err_probe()

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916104642.11728-1-caihuoqing@baidu.com
parent d60b9391
......@@ -431,16 +431,14 @@ static int td043mtea1_probe(struct spi_device *spi)
memcpy(lcd->gamma, td043mtea1_def_gamma, sizeof(lcd->gamma));
lcd->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
if (IS_ERR(lcd->vcc_reg)) {
dev_err(&spi->dev, "failed to get VCC regulator\n");
return PTR_ERR(lcd->vcc_reg);
}
if (IS_ERR(lcd->vcc_reg))
return dev_err_probe(&spi->dev, PTR_ERR(lcd->vcc_reg),
"failed to get VCC regulator\n");
lcd->reset_gpio = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(lcd->reset_gpio)) {
dev_err(&spi->dev, "failed to get reset GPIO\n");
return PTR_ERR(lcd->reset_gpio);
}
if (IS_ERR(lcd->reset_gpio))
return dev_err_probe(&spi->dev, PTR_ERR(lcd->reset_gpio),
"failed to get reset GPIO\n");
spi->bits_per_word = 16;
spi->mode = SPI_MODE_0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment