drm/crtc: Use drm_mode_object_put() in __drm_framebuffer_unregister()
authorLiu Ying <[email protected]>
Mon, 29 Feb 2016 03:21:10 +0000 (11:21 +0800)
committerDaniel Vetter <[email protected]>
Mon, 29 Feb 2016 16:51:09 +0000 (17:51 +0100)
The function __drm_framebuffer_unregister() has boilerplate code to drop idr
reference.  Let's replace it with drm_mode_object_put() to simplify the code.

Signed-off-by: Liu Ying <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_crtc.c

index 65258acddb902000bbb9c458f7c5a1f1a8b62c49..579505c0a4988daf9425e84963fec1b9361de67b 100644 (file)
@@ -430,9 +430,7 @@ EXPORT_SYMBOL(drm_framebuffer_init);
 static void __drm_framebuffer_unregister(struct drm_device *dev,
                                         struct drm_framebuffer *fb)
 {
-       mutex_lock(&dev->mode_config.idr_mutex);
-       idr_remove(&dev->mode_config.crtc_idr, fb->base.id);
-       mutex_unlock(&dev->mode_config.idr_mutex);
+       drm_mode_object_put(dev, &fb->base);
 
        fb->base.id = 0;
 }