drm/udl: 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-24-git-send-email-cakturk@gmail.com
This commit is contained in:
Cihangir Akturk 2017-08-11 15:33:09 +03:00 committed by Sean Paul
parent 6aeeadab79
commit 823ee8bc01
2 changed files with 5 additions and 5 deletions

View File

@ -309,7 +309,7 @@ static void udl_user_framebuffer_destroy(struct drm_framebuffer *fb)
struct udl_framebuffer *ufb = to_udl_fb(fb); struct udl_framebuffer *ufb = to_udl_fb(fb);
if (ufb->obj) if (ufb->obj)
drm_gem_object_unreference_unlocked(&ufb->obj->base); drm_gem_object_put_unlocked(&ufb->obj->base);
drm_framebuffer_cleanup(fb); drm_framebuffer_cleanup(fb);
kfree(ufb); kfree(ufb);
@ -403,7 +403,7 @@ static int udlfb_create(struct drm_fb_helper *helper,
return ret; return ret;
out_gfree: out_gfree:
drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base); drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
out: out:
return ret; return ret;
} }
@ -419,7 +419,7 @@ static void udl_fbdev_destroy(struct drm_device *dev,
drm_fb_helper_fini(&ufbdev->helper); drm_fb_helper_fini(&ufbdev->helper);
drm_framebuffer_unregister_private(&ufbdev->ufb.base); drm_framebuffer_unregister_private(&ufbdev->ufb.base);
drm_framebuffer_cleanup(&ufbdev->ufb.base); drm_framebuffer_cleanup(&ufbdev->ufb.base);
drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base); drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
} }
int udl_fbdev_init(struct drm_device *dev) int udl_fbdev_init(struct drm_device *dev)

View File

@ -52,7 +52,7 @@ udl_gem_create(struct drm_file *file,
return ret; return ret;
} }
drm_gem_object_unreference_unlocked(&obj->base); drm_gem_object_put_unlocked(&obj->base);
*handle_p = handle; *handle_p = handle;
return 0; return 0;
} }
@ -234,7 +234,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
*offset = drm_vma_node_offset_addr(&gobj->base.vma_node); *offset = drm_vma_node_offset_addr(&gobj->base.vma_node);
out: out:
drm_gem_object_unreference(&gobj->base); drm_gem_object_put(&gobj->base);
unlock: unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;