Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbdHKQC4 (ORCPT ); Fri, 11 Aug 2017 12:02:56 -0400 Received: from mail-yw0-f180.google.com ([209.85.161.180]:34631 "EHLO mail-yw0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752703AbdHKQCz (ORCPT ); Fri, 11 Aug 2017 12:02:55 -0400 Date: Fri, 11 Aug 2017 12:02:52 -0400 From: Sean Paul To: Cihangir Akturk Cc: daniel@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Xinliang Liu , Rongrong Zou , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , Sean Paul , Gustavo Padovan , Gabriel Krisman Bertazi , Eric Anholt , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Wei Yongjun , Alex Deucher , Masahiro Yamada , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH v3 10/28] drm/hisilicon: switch to drm_*_get(), drm_*_put() helpers Message-ID: <20170811160252.ly4jfhachfminluk@art_vandelay> References: <1502454794-28558-1-git-send-email-cakturk@gmail.com> <1502454794-28558-11-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-11-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: 3153 Lines: 90 On Fri, Aug 11, 2017 at 03:32:56PM +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/hisilicon/hibmc/hibmc_drm_fbdev.c | 4 ++-- > drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 8 ++++---- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c > index 9740eed..b92595c 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c > @@ -157,7 +157,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, > out_unreserve_ttm_bo: > ttm_bo_unreserve(&bo->bo); > out_unref_gem: > - drm_gem_object_unreference_unlocked(gobj); > + drm_gem_object_put_unlocked(gobj); > > return ret; > } > @@ -172,7 +172,7 @@ static void hibmc_fbdev_destroy(struct hibmc_fbdev *fbdev) > drm_fb_helper_fini(fbh); > > if (gfb) > - drm_framebuffer_unreference(&gfb->fb); > + drm_framebuffer_put(&gfb->fb); > } > > static const struct drm_fb_helper_funcs hibmc_fbdev_helper_funcs = { > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c > index ac457c7..3518167 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c > @@ -444,7 +444,7 @@ int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, > } > > ret = drm_gem_handle_create(file, gobj, &handle); > - drm_gem_object_unreference_unlocked(gobj); > + drm_gem_object_put_unlocked(gobj); > if (ret) { > DRM_ERROR("failed to unreference GEM object: %d\n", ret); > return ret; > @@ -479,7 +479,7 @@ int hibmc_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, > bo = gem_to_hibmc_bo(obj); > *offset = hibmc_bo_mmap_offset(bo); > > - drm_gem_object_unreference_unlocked(obj); > + drm_gem_object_put_unlocked(obj); > return 0; > } > > @@ -487,7 +487,7 @@ static void hibmc_user_framebuffer_destroy(struct drm_framebuffer *fb) > { > struct hibmc_framebuffer *hibmc_fb = to_hibmc_framebuffer(fb); > > - drm_gem_object_unreference_unlocked(hibmc_fb->obj); > + drm_gem_object_put_unlocked(hibmc_fb->obj); > drm_framebuffer_cleanup(fb); > kfree(hibmc_fb); > } > @@ -543,7 +543,7 @@ hibmc_user_framebuffer_create(struct drm_device *dev, > > hibmc_fb = hibmc_framebuffer_init(dev, mode_cmd, obj); > if (IS_ERR(hibmc_fb)) { > - drm_gem_object_unreference_unlocked(obj); > + drm_gem_object_put_unlocked(obj); > return ERR_PTR((long)hibmc_fb); > } > return &hibmc_fb->fb; > -- > 2.7.4 > -- Sean Paul, Software Engineer, Google / Chromium OS