Skip to content

Commit

Permalink
drm/exynos: Don't fail if no TE-gpio is defined for DSI driver
Browse files Browse the repository at this point in the history
TE-gpio is optional and if it is not found then gpiod_get_optional()
returns NULL. In such case the code will continue and try to convert NULL
gpiod to irq what in turn fails. The failure is then propagated and driver
is not registered.

Fix this by returning early from exynos_dsi_register_te_irq() if no
TE-gpio is found.

Fixes: ee6c8b5 ("drm/exynos: Replace legacy gpio interface for gpiod interface")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
mszyprow authored and daeinki committed Feb 25, 2022
1 parent 586d090 commit 0a6e8d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/exynos/exynos_drm_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,9 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi,
int te_gpio_irq;

dsi->te_gpio = devm_gpiod_get_optional(dsi->dev, "te", GPIOD_IN);
if (IS_ERR(dsi->te_gpio)) {
if (!dsi->te_gpio) {
return 0;
} else if (IS_ERR(dsi->te_gpio)) {
dev_err(dsi->dev, "gpio request failed with %ld\n",
PTR_ERR(dsi->te_gpio));
return PTR_ERR(dsi->te_gpio);
Expand Down

0 comments on commit 0a6e8d0

Please sign in to comment.