summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/gma500
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-07 19:16:03 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-07 23:36:28 +0300
commitda7bdda2afdf1ae58546218b50771c2c646bb079 (patch)
treeacfc6c3e7f36f9726853be233d402e6b201c2215 /drivers/gpu/drm/gma500
parented84e2542d2278bf1eff14b6bbd60ba74c8a5602 (diff)
downloadlinux-da7bdda2afdf1ae58546218b50771c2c646bb079.tar.xz
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
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index da42d2e1d397..9b556b2c7e24 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -392,7 +392,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
info = drm_fb_helper_alloc_fbi(&fbdev->psb_fb_helper);
if (IS_ERR(info)) {
ret = PTR_ERR(info);
- goto err_free_range;
+ goto out;
}
info->par = fbdev;
@@ -400,7 +400,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
ret = psb_framebuffer_init(dev, psbfb, &mode_cmd, backing);
if (ret)
- goto err_release;
+ goto out;
fb = &psbfb->base;
psbfb->fbdev = info;
@@ -445,9 +445,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
psbfb->base.width, psbfb->base.height);
return 0;
-err_release:
- drm_fb_helper_release_fbi(&fbdev->psb_fb_helper);
-err_free_range:
+out:
psb_gtt_free_range(dev, backing);
return ret;
}
@@ -536,7 +534,6 @@ static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev)
struct psb_framebuffer *psbfb = &fbdev->pfb;
drm_fb_helper_unregister_fbi(&fbdev->psb_fb_helper);
- drm_fb_helper_release_fbi(&fbdev->psb_fb_helper);
drm_fb_helper_fini(&fbdev->psb_fb_helper);
drm_framebuffer_unregister_private(&psbfb->base);