OSDN Git Service

drm/omap: Allocate drm_device earlier and unref it as last step
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 12 Feb 2018 09:44:36 +0000 (11:44 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:25 +0000 (16:13 +0300)
commitfb96b67c8ae0c91e17f0f9fe88cfce406ace6a94
treeac73962624c4135d6bbe1b4ca842ba0322020fb4
parent5b394b2ddf0347bef56e50c69a58773c94343ff3
drm/omap: Allocate drm_device earlier and unref it as last step

If we allocate the drm_device earlier we can just return the error code
without the need to use goto.
Do the unref of the drm_device as a last step when cleaning up. This will
make the drm_device available longer for us and makes sure that we only
free up the memory when all other cleanups have been already done.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/omap_drv.c