Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753542AbdHKQDH (ORCPT ); Fri, 11 Aug 2017 12:03:07 -0400 Received: from mail-yw0-f181.google.com ([209.85.161.181]:34694 "EHLO mail-yw0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753247AbdHKQDF (ORCPT ); Fri, 11 Aug 2017 12:03:05 -0400 Date: Fri, 11 Aug 2017 12:03:02 -0400 From: Sean Paul To: Cihangir Akturk Cc: daniel@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dave Airlie , David Airlie , Daniel Vetter , Alex Deucher , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Laurent Pinchart , Sean Paul , Gabriel Krisman Bertazi , Peter Rosin , Wei Yongjun , Christian =?iso-8859-1?Q?K=F6nig?= , Arvind Yadav Subject: Re: [PATCH v3 14/28] drm/mgag200: switch to drm_*_get(), drm_*_put() helpers Message-ID: <20170811160302.fguscsz7vhtyw7go@art_vandelay> References: <1502454794-28558-1-git-send-email-cakturk@gmail.com> <1502454794-28558-15-git-send-email-cakturk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502454794-28558-15-git-send-email-cakturk@gmail.com> User-Agent: NeoMutt/20170306-66-6ddb52-dirty (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3648 Lines: 110 On Fri, Aug 11, 2017 at 03:33:00PM +0300, Cihangir Akturk wrote: > 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 Applied to drm-misc-next, thank you! Sean > --- > drivers/gpu/drm/mgag200/mgag200_cursor.c | 2 +- > drivers/gpu/drm/mgag200/mgag200_fb.c | 4 ++-- > drivers/gpu/drm/mgag200/mgag200_main.c | 10 +++++----- > 3 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c > index 2ac3fcb..968e203 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c > +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c > @@ -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; > } > diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c > index 9d914ca..30726c9 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_fb.c > +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c > @@ -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); > diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c > index dce8a3e..780f983 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_main.c > +++ b/drivers/gpu/drm/mgag200/mgag200_main.c > @@ -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; > } > -- > 2.7.4 > -- Sean Paul, Software Engineer, Google / Chromium OS