UPSTREAM: drm/rockchip: Finish initialization before registering DRM device
authorTomasz Figa <tfiga@chromium.org>
Tue, 21 Jun 2016 04:27:34 +0000 (13:27 +0900)
committerMark Yao <mark.yao@rock-chips.com>
Tue, 3 Jan 2017 01:17:40 +0000 (09:17 +0800)
commit51239bb2232fdde4921dff0153e7a2dd1dd8dccf
tree6fc24dfb7b704b2261709376ee7db588dece315c
parentdb962056a03714ca40cc987e14182e08b8a816f7
UPSTREAM: drm/rockchip: Finish initialization before registering DRM device

Currently the driver calls drm_dev_register() directly after allocating
the DRM device and then continues with further initialization. This is
incorrect, because drm_dev_register() is supposed to be called after all
initialization is done. This problem was masked by the fact that
drm_dev_register() did not use to do anything special before, but
recently it started to call drm_connector_register_all(), which leads to
a crash if the driver is not fully initialized.

This patch fixes the problem by moving the call to drm_dev_register() to
the end of the initialization sequence and also removing the, now
unnecessary, call to drm_connector_register_all() from driver code.

Fixes: f706974a69b6 ("drm/rockchip: Drop drm_driver.load/unload callbacks")
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
[danvet: Fix up cleanup labels a bit.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1466483254-35373-1-git-send-email-tfiga@chromium.org
(cherry picked from commit 9127f99c4801f323ffbb3b755259f3a679f66c7c)

Change-Id: Ie6d56242507c413db5e1b93e587d89a3a2200db6
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_drv.c