Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/cirrus: switch to drm_*_get(), drm_*_put() helpers

Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
and drm_*_unreference() helpers.

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to
use the new APIs.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1502454794-28558-7-git-send-email-cakturk@gmail.com

authored by

Cihangir Akturk and committed by
Sean Paul
6aeeadab 1feba03f

+6 -6
+1 -1
drivers/gpu/drm/cirrus/cirrus_fbdev.c
··· 251 251 drm_fb_helper_unregister_fbi(&gfbdev->helper); 252 252 253 253 if (gfb->obj) { 254 - drm_gem_object_unreference_unlocked(gfb->obj); 254 + drm_gem_object_put_unlocked(gfb->obj); 255 255 gfb->obj = NULL; 256 256 } 257 257
+5 -5
drivers/gpu/drm/cirrus/cirrus_main.c
··· 18 18 { 19 19 struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb); 20 20 21 - drm_gem_object_unreference_unlocked(cirrus_fb->obj); 21 + drm_gem_object_put_unlocked(cirrus_fb->obj); 22 22 drm_framebuffer_cleanup(fb); 23 23 kfree(fb); 24 24 } ··· 67 67 68 68 cirrus_fb = kzalloc(sizeof(*cirrus_fb), GFP_KERNEL); 69 69 if (!cirrus_fb) { 70 - drm_gem_object_unreference_unlocked(obj); 70 + drm_gem_object_put_unlocked(obj); 71 71 return ERR_PTR(-ENOMEM); 72 72 } 73 73 74 74 ret = cirrus_framebuffer_init(dev, cirrus_fb, mode_cmd, obj); 75 75 if (ret) { 76 - drm_gem_object_unreference_unlocked(obj); 76 + drm_gem_object_put_unlocked(obj); 77 77 kfree(cirrus_fb); 78 78 return ERR_PTR(ret); 79 79 } ··· 261 261 return ret; 262 262 263 263 ret = drm_gem_handle_create(file, gobj, &handle); 264 - drm_gem_object_unreference_unlocked(gobj); 264 + drm_gem_object_put_unlocked(gobj); 265 265 if (ret) 266 266 return ret; 267 267 ··· 310 310 bo = gem_to_cirrus_bo(obj); 311 311 *offset = cirrus_bo_mmap_offset(bo); 312 312 313 - drm_gem_object_unreference_unlocked(obj); 313 + drm_gem_object_put_unlocked(obj); 314 314 315 315 return 0; 316 316 }