Commit 5c2a392d authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: tpd12s015: fix error handling

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent e43f2c33
...@@ -234,25 +234,30 @@ static int tpd_probe(struct platform_device *pdev) ...@@ -234,25 +234,30 @@ static int tpd_probe(struct platform_device *pdev)
if (r) if (r)
return r; return r;
gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0, gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 0,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->ct_cp_hpd_gpio = gpio; ddata->ct_cp_hpd_gpio = gpio;
gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1, gpio = devm_gpiod_get_index_optional(&pdev->dev, NULL, 1,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->ls_oe_gpio = gpio; ddata->ls_oe_gpio = gpio;
gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2, gpio = devm_gpiod_get_index(&pdev->dev, NULL, 2,
GPIOD_IN); GPIOD_IN);
if (IS_ERR(gpio)) if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
goto err_gpio; goto err_gpio;
}
ddata->hpd_gpio = gpio; ddata->hpd_gpio = gpio;
......
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