From 01934c2a691882185b3021d437df13bcba07711d Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 19 Dec 2014 11:21:32 +0100 Subject: drm/fb-helper: Propagate errors from initial config failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make drm_fb_helper_initial_config() return an int rather than a bool so that the error can be properly propagated. While at it, update drivers to propagate errors further rather than just ignore them. v2: - cirrus: No cleanup is required, the top-level cirrus_driver_load() will do it as part of cirrus_driver_unload() in its cleanup path. Reported-by: Fengguang Wu Cc: David Airlie Cc: Daniel Vetter Cc: Patrik Jakobsson Cc: Rob Clark Cc: Tomi Valkeinen Cc: Alex Deucher Cc: Christian König Cc: Ben Skeggs Signed-off-by: Thierry Reding Reviewed-by: Alex Deucher Reviewed-by: Patrik Jakobsson Reviewed-by: Christian König [danvet: Squash in simplification patch from kbuild.] Signed-off-by: Daniel Vetter --- drivers/gpu/drm/qxl/qxl_fb.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/drm/qxl/qxl_fb.c') diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c index 3d7c1d00a424..f778c0e8ae3c 100644 --- a/drivers/gpu/drm/qxl/qxl_fb.c +++ b/drivers/gpu/drm/qxl/qxl_fb.c @@ -686,14 +686,24 @@ int qxl_fbdev_init(struct qxl_device *qdev) ret = drm_fb_helper_init(qdev->ddev, &qfbdev->helper, qxl_num_crtc /* num_crtc - QXL supports just 1 */, QXLFB_CONN_LIMIT); - if (ret) { - kfree(qfbdev); - return ret; - } + if (ret) + goto free; + + ret = drm_fb_helper_single_add_all_connectors(&qfbdev->helper); + if (ret) + goto fini; + + ret = drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel); + if (ret) + goto fini; - drm_fb_helper_single_add_all_connectors(&qfbdev->helper); - drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel); return 0; + +fini: + drm_fb_helper_fini(&qfbdev->helper); +free: + kfree(qfbdev); + return ret; } void qxl_fbdev_fini(struct qxl_device *qdev) -- cgit v1.2.3-70-g09d2