drm/mgag200: switch to drm_*_get(), drm_*_put() helpers
authorCihangir Akturk <cakturk@gmail.com>
Fri, 11 Aug 2017 12:33:00 +0000 (15:33 +0300)
committerSean Paul <seanpaul@chromium.org>
Fri, 11 Aug 2017 15:56:03 +0000 (11:56 -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-15-git-send-email-cakturk@gmail.com
drivers/gpu/drm/mgag200/mgag200_cursor.c
drivers/gpu/drm/mgag200/mgag200_fb.c
drivers/gpu/drm/mgag200/mgag200_main.c

index 2ac3fcbfea7bc988667eb5b2819712187dd8be81..968e20379d54d6f05ec7e5db64e82b4ba36b3395 100644 (file)
@@ -248,7 +248,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
 out_unreserve1:
        mgag200_bo_unreserve(pixels_2);
 out_unref:
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
 
        return ret;
 }
index 9d914ca69996b93bb0a0f1275e4a553d04432dfd..30726c9fe28c810486a127c3dfbd92c07836b2e3 100644 (file)
@@ -232,7 +232,7 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
 err_alloc_fbi:
        vfree(sysram);
 err_sysram:
-       drm_gem_object_unreference_unlocked(gobj);
+       drm_gem_object_put_unlocked(gobj);
 
        return ret;
 }
@@ -245,7 +245,7 @@ static int mga_fbdev_destroy(struct drm_device *dev,
        drm_fb_helper_unregister_fbi(&mfbdev->helper);
 
        if (mfb->obj) {
-               drm_gem_object_unreference_unlocked(mfb->obj);
+               drm_gem_object_put_unlocked(mfb->obj);
                mfb->obj = NULL;
        }
        drm_fb_helper_fini(&mfbdev->helper);
index dce8a3eb5a1065cba88368f25405784a5432910b..780f983b0294ded7d2f0a222bd185597995f982a 100644 (file)
@@ -18,7 +18,7 @@ static void mga_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
        struct mga_framebuffer *mga_fb = to_mga_framebuffer(fb);
 
-       drm_gem_object_unreference_unlocked(mga_fb->obj);
+       drm_gem_object_put_unlocked(mga_fb->obj);
        drm_framebuffer_cleanup(fb);
        kfree(fb);
 }
@@ -59,13 +59,13 @@ mgag200_user_framebuffer_create(struct drm_device *dev,
 
        mga_fb = kzalloc(sizeof(*mga_fb), GFP_KERNEL);
        if (!mga_fb) {
-               drm_gem_object_unreference_unlocked(obj);
+               drm_gem_object_put_unlocked(obj);
                return ERR_PTR(-ENOMEM);
        }
 
        ret = mgag200_framebuffer_init(dev, mga_fb, mode_cmd, obj);
        if (ret) {
-               drm_gem_object_unreference_unlocked(obj);
+               drm_gem_object_put_unlocked(obj);
                kfree(mga_fb);
                return ERR_PTR(ret);
        }
@@ -317,7 +317,7 @@ int mgag200_dumb_create(struct drm_file *file,
                return ret;
 
        ret = drm_gem_handle_create(file, gobj, &handle);
-       drm_gem_object_unreference_unlocked(gobj);
+       drm_gem_object_put_unlocked(gobj);
        if (ret)
                return ret;
 
@@ -366,6 +366,6 @@ mgag200_dumb_mmap_offset(struct drm_file *file,
        bo = gem_to_mga_bo(obj);
        *offset = mgag200_bo_mmap_offset(bo);
 
-       drm_gem_object_unreference_unlocked(obj);
+       drm_gem_object_put_unlocked(obj);
        return 0;
 }