From 5c718e015a0f1280440f90ebf1c18e2b98a102e4 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 2 Mar 2018 03:11:49 +0200 Subject: drm/omap: dss: Modify omapdss_find_output_from_display() to return channel The omapdss_find_output_from_display() function is only used to retrieve the dispc channel corresponding to the display. Return the dispc channel directly, and rename the function to omapdss_device_get_dispc_channel() to match its new purpose. The dssdev->id check is removed as the dssdev is guaranteed to be an output and have a non-zero id, as proved by the lack of crash despite the caller never checking the returned pointer before dereferencing it. As the function is not specific to outputs anymore, move it from output.c to base.c. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/base.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/gpu/drm/omapdrm/dss/base.c') diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 991c424960c7..272858972496 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -236,6 +236,15 @@ void omapdss_device_disconnect(struct omap_dss_device *src, } EXPORT_SYMBOL_GPL(omapdss_device_disconnect); +enum omap_channel omapdss_device_get_dispc_channel(struct omap_dss_device *dssdev) +{ + while (dssdev->src) + dssdev = dssdev->src; + + return dssdev->dispc_channel; +} +EXPORT_SYMBOL(omapdss_device_get_dispc_channel); + /* ----------------------------------------------------------------------------- * Components Handling */ -- cgit v1.2.3