From patchwork Wed Feb 6 19:40:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 2106651 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5973C3FCFC for ; Wed, 6 Feb 2013 19:51:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10FB5E6159 for ; Wed, 6 Feb 2013 11:51:26 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A43CE6671 for ; Wed, 6 Feb 2013 11:50:16 -0800 (PST) Received: by mail-oa0-f43.google.com with SMTP id l10so1949858oag.30 for ; Wed, 06 Feb 2013 11:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=7MVSZBfjydBAS6vPTTCRKCChlMf1eP7I9+PknA11lzY=; b=QovMJtMVby5vT8DCYEViRJMo4tZBl1hq8FAHWw9apJkJUAg4Ww5irom3qTf5SoGjSH PlqimgxzIU87gbUhatn1+7zOviZOazw16FWT56zHVhb3o4ilfN3RoqxiEE3xRVMb6EZB UQLV5vp/a8B+qnbl57Hud9nb94QyEkgtoXiRhlYjsMK/61mklomvL40LXg4zBfbKYahH eJtvzcTX8p2t/9B0ER44L7gfgkI6vTIWayDe3nmKSrq64v1aqvmZtF3p0rKiYvE5lVFD XRGHmWhR6azW18hU8u+zSYW8DDwv6A8/H4cA+w03BPUq7k0K/IHfhUIZWQHm6AMSodho JmPw== X-Received: by 10.60.32.235 with SMTP id m11mr24061635oei.129.1360180216003; Wed, 06 Feb 2013 11:50:16 -0800 (PST) Received: from htj.dyndns.org (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id l5sm39989590pax.10.2013.02.06.11.50.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Feb 2013 11:50:15 -0800 (PST) From: Tejun Heo To: akpm@linux-foundation.org Subject: [PATCH 32/77] drm/exynos: convert to idr_alloc() Date: Wed, 6 Feb 2013 11:40:04 -0800 Message-Id: <1360179649-22465-33-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360179649-22465-1-git-send-email-tj@kernel.org> References: <1360179649-22465-1-git-send-email-tj@kernel.org> Cc: Tejun Heo , Kukjin Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Convert to the much saner new idr interface. Only compile tested. Signed-off-by: Tejun Heo Cc: David Airlie Cc: Kukjin Kim Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 90398df..1adce07 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -137,21 +137,15 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj, DRM_DEBUG_KMS("%s\n", __func__); -again: - /* ensure there is space available to allocate a handle */ - if (idr_pre_get(id_idr, GFP_KERNEL) == 0) { - DRM_ERROR("failed to get idr.\n"); - return -ENOMEM; - } - /* do the allocation under our mutexlock */ mutex_lock(lock); - ret = idr_get_new_above(id_idr, obj, 1, (int *)idp); + ret = idr_alloc(id_idr, obj, 1, 0, GFP_KERNEL); mutex_unlock(lock); - if (ret == -EAGAIN) - goto again; + if (ret < 0) + return ret; - return ret; + *idp = ret; + return 0; } static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id)