imx-drm: imx-drm-core: make imx_drm_crtc_register() safer
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 16 Dec 2013 12:39:11 +0000 (12:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2013 01:12:55 +0000 (17:12 -0800)
commit9fe73d46edd358fc154f7332c8ff312e067255a0
tree74ae9aacecfad384f402514fc9c952c67cb7192e
parent942325c8b234fd67db976bd529d48320a6a73171
imx-drm: imx-drm-core: make imx_drm_crtc_register() safer

imx_drm_crtc_register() doesn't clean up the CRTC upon failure, which
leaves the CRTC attached to the DRM device.  Also, it does setup after
attaching the CRTC to the DRM device.

Fix this by reordering the function such that we do the setup before
drm_crtc_init(): this fixes both issues.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/imx-drm-core.c