OSDN Git Service

drm/omap: tpd12s015: fix error handling
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 22 Nov 2016 08:11:07 +0000 (10:11 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 8 Dec 2016 11:42:58 +0000 (13:42 +0200)
tpd12s015 driver is missing error value handling for gpio
initialization, causing 0 to be returned as an error if gpiod_get_*
fails. This may cause deferred probing to fail.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c

index 6d8f79b..58276a4 100644 (file)
@@ -234,25 +234,30 @@ static int tpd_probe(struct platform_device *pdev)
        if (r)
                return r;
 
-
        gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0,
                 GPIOD_OUT_LOW);
-       if (IS_ERR(gpio))
+       if (IS_ERR(gpio)) {
+               r = PTR_ERR(gpio);
                goto err_gpio;
+       }
 
        ddata->ct_cp_hpd_gpio = gpio;
 
        gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1,
                 GPIOD_OUT_LOW);
-       if (IS_ERR(gpio))
+       if (IS_ERR(gpio)) {
+               r = PTR_ERR(gpio);
                goto err_gpio;
+       }
 
        ddata->ls_oe_gpio = gpio;
 
        gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2,
                GPIOD_IN);
-       if (IS_ERR(gpio))
+       if (IS_ERR(gpio)) {
+               r = PTR_ERR(gpio);
                goto err_gpio;
+       }
 
        ddata->hpd_gpio = gpio;