aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-12-17 14:11:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-05 14:59:50 -0500
commitec9557d752e8758297ddecb34d0aca264616ecb2 (patch)
treedba9c420fddbd2745bbec0a96c9e1a5a9eb9d7d8
parent020a9ea7c2206be4382a09cbafc7c3bdf5bbf8a5 (diff)
imx-drm: imx-drm-core: merge imx_drm_crtc_register() into imx_drm_add_crtc()
There's no reason for this to be a separate function; merge the two together. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index 87d08f4be8d3..236ed66f116a 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -370,29 +370,6 @@ static void imx_drm_connector_unregister(
370} 370}
371 371
372/* 372/*
373 * register a crtc to the drm core
374 */
375static int imx_drm_crtc_register(struct imx_drm_crtc *imx_drm_crtc)
376{
377 struct imx_drm_device *imxdrm = __imx_drm_device();
378 int ret;
379
380 ret = drm_mode_crtc_set_gamma_size(imx_drm_crtc->crtc, 256);
381 if (ret)
382 return ret;
383
384 drm_crtc_helper_add(imx_drm_crtc->crtc,
385 imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs);
386
387 drm_crtc_init(imxdrm->drm, imx_drm_crtc->crtc,
388 imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs);
389
390 drm_mode_group_reinit(imxdrm->drm);
391
392 return 0;
393}
394
395/*
396 * Called by the CRTC driver when all CRTCs are registered. This 373 * Called by the CRTC driver when all CRTCs are registered. This
397 * puts all the pieces together and initializes the driver. 374 * puts all the pieces together and initializes the driver.
398 * Once this is called no more CRTCs can be registered since 375 * Once this is called no more CRTCs can be registered since
@@ -536,10 +513,18 @@ int imx_drm_add_crtc(struct drm_crtc *crtc,
536 513
537 *new_crtc = imx_drm_crtc; 514 *new_crtc = imx_drm_crtc;
538 515
539 ret = imx_drm_crtc_register(imx_drm_crtc); 516 ret = drm_mode_crtc_set_gamma_size(imx_drm_crtc->crtc, 256);
540 if (ret) 517 if (ret)
541 goto err_register; 518 goto err_register;
542 519
520 drm_crtc_helper_add(crtc,
521 imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs);
522
523 drm_crtc_init(imxdrm->drm, crtc,
524 imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs);
525
526 drm_mode_group_reinit(imxdrm->drm);
527
543 imx_drm_update_possible_crtcs(); 528 imx_drm_update_possible_crtcs();
544 529
545 mutex_unlock(&imxdrm->mutex); 530 mutex_unlock(&imxdrm->mutex);