drm/rockchip: switch to drm_*_get(), drm_*_put() helpers
authorCihangir Akturk <cakturk@gmail.com>
Fri, 11 Aug 2017 12:33:06 +0000 (15:33 +0300)
committerSean Paul <seanpaul@chromium.org>
Fri, 11 Aug 2017 15:35:21 +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-21-git-send-email-cakturk@gmail.com
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
drivers/gpu/drm/rockchip/rockchip_drm_gem.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c

index 8a0f75612d4b4376daddd434b65668e14627f337..70773041785bf8b1a34077f1e7c2fae49f71b1a0 100644 (file)
@@ -48,7 +48,7 @@ static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb)
        int i;
 
        for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++)
-               drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]);
+               drm_gem_object_put_unlocked(rockchip_fb->obj[i]);
 
        drm_framebuffer_cleanup(fb);
        kfree(rockchip_fb);
@@ -144,7 +144,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
                        width * drm_format_plane_cpp(mode_cmd->pixel_format, i);
 
                if (obj->size < min_size) {
-                       drm_gem_object_unreference_unlocked(obj);
+                       drm_gem_object_put_unlocked(obj);
                        ret = -EINVAL;
                        goto err_gem_object_unreference;
                }
@@ -161,7 +161,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
 
 err_gem_object_unreference:
        for (i--; i >= 0; i--)
-               drm_gem_object_unreference_unlocked(objs[i]);
+               drm_gem_object_put_unlocked(objs[i]);
        return ERR_PTR(ret);
 }
 
index ce946b9c57a9f36e7c3d50c6e4c00c837565690a..724579ebf947f537ca774fb6229dbb0a653683c0 100644 (file)
@@ -173,7 +173,7 @@ void rockchip_drm_fbdev_fini(struct drm_device *dev)
        drm_fb_helper_unregister_fbi(helper);
 
        if (helper->fb)
-               drm_framebuffer_unreference(helper->fb);
+               drm_framebuffer_put(helper->fb);
 
        drm_fb_helper_fini(helper);
 }
index f74333efe4bbdb32924afddc0c139573147618ca..1869c8bb76c8173677be56c1d68a8364cf80a1f2 100644 (file)
@@ -383,7 +383,7 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv,
                goto err_handle_create;
 
        /* drop reference from allocate - handle holds it now. */
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return rk_obj;
 
index 948719dddc364e4fa6291f9fa7336f16834ea732..bf9ed0e639731cf15d0847674856a7082986ac76 100644 (file)
@@ -1026,7 +1026,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
                if (old_plane_state->fb == new_plane_state->fb)
                        continue;
 
-               drm_framebuffer_reference(old_plane_state->fb);
+               drm_framebuffer_get(old_plane_state->fb);
                drm_flip_work_queue(&vop->fb_unref_work, old_plane_state->fb);
                set_bit(VOP_PENDING_FB_UNREF, &vop->pending);
                WARN_ON(drm_crtc_vblank_get(crtc) != 0);
@@ -1150,7 +1150,7 @@ static void vop_fb_unref_worker(struct drm_flip_work *work, void *val)
        struct drm_framebuffer *fb = val;
 
        drm_crtc_vblank_put(&vop->crtc);
-       drm_framebuffer_unreference(fb);
+       drm_framebuffer_put(fb);
 }
 
 static void vop_handle_vblank(struct vop *vop)