drm/fb-helper: Automatically clean up fb_info
Noticed that everyone duplicates the same logic here and we could safe a few lines per driver. Yay for lots of drivers to make such tiny refactors worth-while! v2: Forgot to git add everything :( v3: Actually remove release_fbi (Sean, Emil, Chris) ... Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sean Paul <seanpaul@chromium.org> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170207161603.17611-1-daniel.vetter@ffwll.ch
Tento commit je obsažen v:
@@ -78,7 +78,7 @@ static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
|
||||
if (IS_ERR(fbi)) {
|
||||
dev_err(dev->dev, "Failed to create framebuffer info.\n");
|
||||
ret = PTR_ERR(fbi);
|
||||
goto err_rockchip_gem_free_object;
|
||||
goto out;
|
||||
}
|
||||
|
||||
helper->fb = rockchip_drm_framebuffer_init(dev, &mode_cmd,
|
||||
@@ -86,7 +86,7 @@ static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
|
||||
if (IS_ERR(helper->fb)) {
|
||||
dev_err(dev->dev, "Failed to allocate DRM framebuffer.\n");
|
||||
ret = PTR_ERR(helper->fb);
|
||||
goto err_release_fbi;
|
||||
goto out;
|
||||
}
|
||||
|
||||
fbi->par = helper;
|
||||
@@ -114,9 +114,7 @@ static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
|
||||
|
||||
return 0;
|
||||
|
||||
err_release_fbi:
|
||||
drm_fb_helper_release_fbi(helper);
|
||||
err_rockchip_gem_free_object:
|
||||
out:
|
||||
rockchip_gem_free_object(&rk_obj->base);
|
||||
return ret;
|
||||
}
|
||||
@@ -173,7 +171,6 @@ void rockchip_drm_fbdev_fini(struct drm_device *dev)
|
||||
helper = &private->fbdev_helper;
|
||||
|
||||
drm_fb_helper_unregister_fbi(helper);
|
||||
drm_fb_helper_release_fbi(helper);
|
||||
|
||||
if (helper->fb)
|
||||
drm_framebuffer_unreference(helper->fb);
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele