diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-02-28 23:53:16 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:25 +0300 |
commit | 9184f8d94c389c4712b4f393cca4a09c9e770514 (patch) | |
tree | 1ae545557db59ebd99d3657460cda799b9307166 /drivers/gpu/drm/omapdrm/dss/base.c | |
parent | 6a7c5a2200ad10a23912d3f40ef104f0d0543de4 (diff) | |
download | kernel_replicant_linux-9184f8d94c389c4712b4f393cca4a09c9e770514.tar.gz kernel_replicant_linux-9184f8d94c389c4712b4f393cca4a09c9e770514.tar.bz2 kernel_replicant_linux-9184f8d94c389c4712b4f393cca4a09c9e770514.zip |
drm/omap: dss: Create and use omapdss_device_is_registered()
The omapdss_component_is_loaded() function test whether a component is
loaded by checking whether it is present in the displays list or the
outputs list. Simplify the implementation by checking for the component
in the global omap_dss_device list.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/base.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/base.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 18b72d7c717a..63fe0a717884 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -71,6 +71,24 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev) mutex_unlock(&omapdss_devices_lock); } +static bool omapdss_device_is_registered(struct device_node *node) +{ + struct omap_dss_device *dssdev; + bool found = false; + + mutex_lock(&omapdss_devices_lock); + + list_for_each_entry(dssdev, &omapdss_devices_list, list) { + if (dssdev->dev->of_node == node) { + found = true; + break; + } + } + + mutex_unlock(&omapdss_devices_lock); + return found; +} + /* ----------------------------------------------------------------------------- * Components Handling */ @@ -157,9 +175,7 @@ static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp) { if (comp->dss_core_component) return true; - if (omapdss_component_is_display(comp->node)) - return true; - if (omapdss_component_is_output(comp->node)) + if (omapdss_device_is_registered(comp->node)) return true; return false; |