dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Liu Ying <gnuiyl@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/crtc: Use drm_mode_object_put() in __drm_framebuffer_unregister()
Date: Mon, 29 Feb 2016 17:53:09 +0100	[thread overview]
Message-ID: <20160229165309.GP32705@phenom.ffwll.local> (raw)
In-Reply-To: <1456716070-2602-1-git-send-email-gnuiyl@gmail.com>

On Mon, Feb 29, 2016 at 11:21:10AM +0800, Liu Ying wrote:
> 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 <gnuiyl@gmail.com>

Applied to drm-misc, thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 65258ac..579505c 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -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;
>  }
> -- 
> 2.5.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2016-02-29 16:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  3:21 [PATCH] drm/crtc: Use drm_mode_object_put() in __drm_framebuffer_unregister() Liu Ying
2016-02-29 16:53 ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160229165309.GP32705@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnuiyl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox