From patchwork Sun Mar 26 14:41:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 96015 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp853471qgd; Sun, 26 Mar 2017 07:43:15 -0700 (PDT) X-Received: by 10.99.163.91 with SMTP id v27mr19354281pgn.171.1490539395776; Sun, 26 Mar 2017 07:43:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a74si6836527pfj.78.2017.03.26.07.43.15; Sun, 26 Mar 2017 07:43:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbdCZOnL (ORCPT + 1 other); Sun, 26 Mar 2017 10:43:11 -0400 Received: from mail-wr0-f181.google.com ([209.85.128.181]:36738 "EHLO mail-wr0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbdCZOnJ (ORCPT ); Sun, 26 Mar 2017 10:43:09 -0400 Received: by mail-wr0-f181.google.com with SMTP id w11so10707280wrc.3 for ; Sun, 26 Mar 2017 07:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nWkUeaxeGMxaj0cB7gWYS2wiwG302GpGU8GcxUamdic=; b=F/SzTh8i30EYcU4GUEKYOK7BgymlXRVkd4Mo3wHVMYlAoNI4Y1E/iYzPaRVnBnVFQE 169FPF5SBMfgDP42pYDTbybKbqCfxX4NTGXa00JoliVM0xGauip8vByqYcfOFSQeiN6/ nX6Shr9V+xeoaKl/rT5GacfcMPkG8RB39A8GQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nWkUeaxeGMxaj0cB7gWYS2wiwG302GpGU8GcxUamdic=; b=Dcjp/wQIbOn0ZiTsRZsgE8zCTwZ529qm/FoQHjYHXjf3EFtwRMCX8nq0HN+EsrLFsE zGk6fMfdhgZqo/rZhqoiiJo74holS/Gzijceec+9qx2CnVSPaMoGYtkmOPdvxJPNNZIM 38ckSjlCEhNgGlu+sfIdHXXIaG3lzB+a7VM9bizYBcpRtrzRHNC5BGFU8IG534Fs1ZDT VX5zbDtwecmNiO4sVLk/BdF3SpLHtXBqjICoXsxDC/wmCy6AaZxKgBukpMcvkI5p2uRs qthSXuSBf1oIDP5OA8yh1jBwiizW+jRKYh6fbW8MgQz2MqLviYCrCnKrdotYjHUy8cIO ODaQ== X-Gm-Message-State: AFeK/H0KqLokFbZtyMUFBzTC5Eb/MW82kX+xi/TdWzHLAbxIj3l4cqB4t65hymfJ80nsbFWL X-Received: by 10.28.182.7 with SMTP id g7mr6068632wmf.108.1490539372311; Sun, 26 Mar 2017 07:42:52 -0700 (PDT) Received: from localhost.localdomain (li1529-187.members.linode.com. [139.162.244.187]) by smtp.gmail.com with ESMTPSA id l90sm10619516wmi.25.2017.03.26.07.42.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Mar 2017 07:42:51 -0700 (PDT) From: Leo Yan To: Russell King , Dmitry Torokhov , Alessandro Zummo , Alexandre Belloni , Linus Walleij , Baptiste Reynal , Alex Williamson , Jaroslav Kysela , Takashi Iwai , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, alsa-devel@alsa-project.org Cc: Leo Yan Subject: [PATCH 5/5] ALSA: AACI: Convert to use devm_ioremap_resource() Date: Sun, 26 Mar 2017 22:41:54 +0800 Message-Id: <1490539314-9681-6-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490539314-9681-1-git-send-email-leo.yan@linaro.org> References: <1490539314-9681-1-git-send-email-leo.yan@linaro.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Convert to use devm_ioremap_resource() in probe function, otherwise it's missed to unremap this region if probe failed or rmmod module. Signed-off-by: Leo Yan --- sound/arm/aaci.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 4140b1b..2078568 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -990,19 +990,13 @@ static int aaci_probe(struct amba_device *dev, struct aaci *aaci; int ret, i; - ret = amba_request_regions(dev, NULL); - if (ret) - return ret; - aaci = aaci_init_card(dev); - if (!aaci) { - ret = -ENOMEM; - goto out; - } + if (!aaci) + return -ENOMEM; - aaci->base = ioremap(dev->res.start, resource_size(&dev->res)); - if (!aaci->base) { - ret = -ENOMEM; + aaci->base = devm_ioremap_resource(&dev->dev, &dev->res); + if (IS_ERR(aaci->base)) { + ret = PTR_ERR(aaci->base); goto out; } @@ -1064,9 +1058,7 @@ static int aaci_probe(struct amba_device *dev, } out: - if (aaci) - snd_card_free(aaci->card); - amba_release_regions(dev); + snd_card_free(aaci->card); return ret; } @@ -1079,7 +1071,6 @@ static int aaci_remove(struct amba_device *dev) writel(0, aaci->base + AACI_MAINCR); snd_card_free(card); - amba_release_regions(dev); } return 0;