drm/hisilicon: switch to drm_*_get(), drm_*_put() helpers
authorCihangir Akturk <cakturk@gmail.com>
Fri, 11 Aug 2017 12:32:56 +0000 (15:32 +0300)
committerSean Paul <seanpaul@chromium.org>
Fri, 11 Aug 2017 15:35:52 +0000 (11:35 -0400)
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-11-git-send-email-cakturk@gmail.com
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c
drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c

index 9740eed9231aa5af8084ae2e16e0b2fc2108706f..b92595c477ef63038811e1af940822599eb577e3 100644 (file)
@@ -157,7 +157,7 @@ out_unpin_bo:
 out_unreserve_ttm_bo:
        ttm_bo_unreserve(&bo->bo);
 out_unref_gem:
-       drm_gem_object_unreference_unlocked(gobj);
+       drm_gem_object_put_unlocked(gobj);
 
        return ret;
 }
@@ -172,7 +172,7 @@ static void hibmc_fbdev_destroy(struct hibmc_fbdev *fbdev)
        drm_fb_helper_fini(fbh);
 
        if (gfb)
-               drm_framebuffer_unreference(&gfb->fb);
+               drm_framebuffer_put(&gfb->fb);
 }
 
 static const struct drm_fb_helper_funcs hibmc_fbdev_helper_funcs = {
index ac457c779caad6affc1cbfa3b54c8805fc49852a..3518167a7dc4c2512bec7e792ab9c0fcf7a50a56 100644 (file)
@@ -444,7 +444,7 @@ int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
        }
 
        ret = drm_gem_handle_create(file, gobj, &handle);
-       drm_gem_object_unreference_unlocked(gobj);
+       drm_gem_object_put_unlocked(gobj);
        if (ret) {
                DRM_ERROR("failed to unreference GEM object: %d\n", ret);
                return ret;
@@ -479,7 +479,7 @@ int hibmc_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
        bo = gem_to_hibmc_bo(obj);
        *offset = hibmc_bo_mmap_offset(bo);
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
        return 0;
 }
 
@@ -487,7 +487,7 @@ static void hibmc_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
        struct hibmc_framebuffer *hibmc_fb = to_hibmc_framebuffer(fb);
 
-       drm_gem_object_unreference_unlocked(hibmc_fb->obj);
+       drm_gem_object_put_unlocked(hibmc_fb->obj);
        drm_framebuffer_cleanup(fb);
        kfree(hibmc_fb);
 }
@@ -543,7 +543,7 @@ hibmc_user_framebuffer_create(struct drm_device *dev,
 
        hibmc_fb = hibmc_framebuffer_init(dev, mode_cmd, obj);
        if (IS_ERR(hibmc_fb)) {
-               drm_gem_object_unreference_unlocked(obj);
+               drm_gem_object_put_unlocked(obj);
                return ERR_PTR((long)hibmc_fb);
        }
        return &hibmc_fb->fb;