diff mbox series

fbdev: omapfb: panel-tpo-td043mtea1: fix error code in probe()

Message ID 6f80089a-9223-4434-8da1-c071dd9367b5@kili.mountain (mailing list archive)
State New, archived
Headers show
Series fbdev: omapfb: panel-tpo-td043mtea1: fix error code in probe() | expand

Commit Message

Dan Carpenter May 15, 2023, 10:32 a.m. UTC
This was using the wrong variable, "r", instead of "ddata->vcc_reg", so
it returned success instead of a negative error code.

Fixes: 0d3dbeb8142a ("video: fbdev: omapfb: panel-tpo-td043mtea1: Make use of the helper function dev_err_probe()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 .../video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Helge Deller May 19, 2023, 2:12 p.m. UTC | #1
On 5/15/23 12:32, Dan Carpenter wrote:
> This was using the wrong variable, "r", instead of "ddata->vcc_reg", so
> it returned success instead of a negative error code.
>
> Fixes: 0d3dbeb8142a ("video: fbdev: omapfb: panel-tpo-td043mtea1: Make use of the helper function dev_err_probe()")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   .../video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c   | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

applied.

Thanks!
Helge

>
> diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
> index 1eaa35c27835..477789cff8e0 100644
> --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
> +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
> @@ -491,7 +491,8 @@ static int tpo_td043_probe(struct spi_device *spi)
>
>   	ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
>   	if (IS_ERR(ddata->vcc_reg)) {
> -		r = dev_err_probe(&spi->dev, r, "failed to get LCD VCC regulator\n");
> +		r = dev_err_probe(&spi->dev, PTR_ERR(ddata->vcc_reg),
> +				  "failed to get LCD VCC regulator\n");
>   		goto err_regulator;
>   	}
>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
index 1eaa35c27835..477789cff8e0 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
@@ -491,7 +491,8 @@  static int tpo_td043_probe(struct spi_device *spi)
 
 	ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
 	if (IS_ERR(ddata->vcc_reg)) {
-		r = dev_err_probe(&spi->dev, r, "failed to get LCD VCC regulator\n");
+		r = dev_err_probe(&spi->dev, PTR_ERR(ddata->vcc_reg),
+				  "failed to get LCD VCC regulator\n");
 		goto err_regulator;
 	}