Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: Don't fail if no TE-gpio is defined for DSI driver

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: ee6c8b5afa62 ("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>

authored by

Marek Szyprowski and committed by
Inki Dae
8e3fa9d8 25b52279

+3 -1
+3 -1
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1336 1336 int te_gpio_irq; 1337 1337 1338 1338 dsi->te_gpio = devm_gpiod_get_optional(dsi->dev, "te", GPIOD_IN); 1339 - if (IS_ERR(dsi->te_gpio)) { 1339 + if (!dsi->te_gpio) { 1340 + return 0; 1341 + } else if (IS_ERR(dsi->te_gpio)) { 1340 1342 dev_err(dsi->dev, "gpio request failed with %ld\n", 1341 1343 PTR_ERR(dsi->te_gpio)); 1342 1344 return PTR_ERR(dsi->te_gpio);