From f2ea55775e0591aa292e2e8d9707d0196df73d61 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 28 May 2018 16:49:36 +0300 Subject: drm/omap: Don't call .detect() operation recursively Instead of calling the .detect() operation recursively from the display device back to the first device that provides hot plug detection support, iterate over the devices manually in the DRM connector .detect() implementation. This moves the complexity to a single central location and simplifies the logic in omap_dss_device drivers. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/displays/connector-hdmi.c') diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c index 54bfd7156360..0d22d7004c98 100644 --- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c @@ -141,10 +141,7 @@ static bool hdmic_detect(struct omap_dss_device *dssdev) struct omap_dss_device *src = dssdev->src; bool connected; - if (ddata->hpd_gpio) - connected = gpiod_get_value_cansleep(ddata->hpd_gpio); - else - connected = src->ops->detect(src); + connected = gpiod_get_value_cansleep(ddata->hpd_gpio); if (!connected && src->ops->hdmi.lost_hotplug) src->ops->hdmi.lost_hotplug(src); return connected; @@ -317,6 +314,7 @@ static int hdmic_probe(struct platform_device *pdev) dssdev->type = OMAP_DISPLAY_TYPE_HDMI; dssdev->owner = THIS_MODULE; dssdev->of_ports = BIT(0); + dssdev->ops_flags = ddata->hpd_gpio ? OMAP_DSS_DEVICE_OP_DETECT : 0; omapdss_display_init(dssdev); omapdss_device_register(dssdev); -- cgit v1.2.3