From e76171b046e95e45266f3a4f4b900a5647e80d70 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 24 Nov 2013 13:02:52 +0000 Subject: imx-drm: imx-drm-core: sanitise imx_drm_encoder_get_mux_id() Address the following issues: - imx_drm_encoder_get_mux_id() searches the CRTC list for the matching CRTC, and returns the position within this list as the MUX programming value for encoders. This is sub-optimal for two reasons: 1. It relies upon the CRTC list not changing during the lifetime of the driver. 2. It is dependent on the initialisation order of the CRTCs. We address (1) in this patch, leaving (2) until a better solution can be found, as (2) requires larger changes. - imx_drm_encoder is unused. Instead, pass the drm_encoder which is slightly more useful; all callers pass encoder->crtc as the required crtc, so move this inside the function. Acked-by: Philipp Zabel Acked-by: Shawn Guo Reviewed-by: Fabio Estevam Signed-off-by: Russell King --- drivers/staging/imx-drm/imx-hdmi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/imx-drm/imx-hdmi.c') diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index 05cf8a07b45..a90f08d52ee 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -1467,8 +1467,7 @@ static void imx_hdmi_encoder_prepare(struct drm_encoder *encoder) static void imx_hdmi_encoder_commit(struct drm_encoder *encoder) { struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder); - int mux = imx_drm_encoder_get_mux_id(hdmi->imx_drm_encoder, - encoder->crtc); + int mux = imx_drm_encoder_get_mux_id(encoder); imx_hdmi_set_ipu_di_mux(hdmi, mux); -- cgit v1.2.3-70-g09d2