From patchwork Mon Aug 24 08:49:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 7061921 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C730A9F305 for ; Mon, 24 Aug 2015 08:49:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0492220390 for ; Mon, 24 Aug 2015 08:49:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9FC37203E3 for ; Mon, 24 Aug 2015 08:49:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BEAEB260671; Mon, 24 Aug 2015 10:49:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B342626063A; Mon, 24 Aug 2015 10:49:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 47F5C260653; Mon, 24 Aug 2015 10:49:18 +0200 (CEST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by alsa0.perex.cz (Postfix) with ESMTP id 1F0B326063A for ; Mon, 24 Aug 2015 10:49:11 +0200 (CEST) Received: by padfa11 with SMTP id fa11so4883957pad.3 for ; Mon, 24 Aug 2015 01:49:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=1XahWsqfqYOb96M+EohlRSkbE+edHdfHnr6sWOP3uX8=; b=geiHkLSqB05JAiIVzrnQyKHvHMd1ZK/mcJE9KAsylWvsvzamNwZ5oHXxZt0pKPaAl1 26ybRUNqp99jjE57D6u8IsSyWBoxir50/HJ3YP5o1i5veb3lLlFV2WRcr3tUNuMUa2Rz nMLu0RxMXcLEDQRn2scUt+qQWBYObAorJWfxleyNnB7k8JHr5NhcD/L8N1JjAqVE25/G hbKCmNwImfPqngqsyS9T9l8z88J6k/S9wmv0Os1CxxOXpcnLnKhauaR91UVek6ewf1YA zbYYAcviGLtEe+fJCCN2pLKbQmdu4VqklwtPI5MEDIcwLVz3+6OsSmqT670F+XgLI/Xz 9IVg== X-Gm-Message-State: ALoCoQkvUp8ScFbKegWE9h4OdepI9Zs1N2F3G+M5Gi1HVqebN/8GDeic8WIcRoyhALPPasQi72HD X-Received: by 10.67.6.164 with SMTP id cv4mr1591855pad.59.1440406150083; Mon, 24 Aug 2015 01:49:10 -0700 (PDT) Received: from phoenix (118-167-22-34.dynamic.hinet.net. [118.167.22.34]) by smtp.gmail.com with ESMTPSA id dh9sm2418069pdb.67.2015.08.24.01.49.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 01:49:09 -0700 (PDT) Message-ID: <1440406145.27868.2.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Mon, 24 Aug 2015 16:49:05 +0800 In-Reply-To: <1440406056.27868.0.camel@ingics.com> References: <1440406056.27868.0.camel@ingics.com> X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: Vipin Kumar , alsa-devel@alsa-project.org, Liam Girdwood , Jyri Sarha , Peter Ujfalusi , Thomas =?ISO-8859-1?Q?Niederpr=FCm?= Subject: [alsa-devel] [PATCH 2/3] ASoC: omap-mcbsp: Convert to use devm_ioremap_resource X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_ioremap_resource() instead of open code. Signed-off-by: Axel Lin Acked-by: Peter Ujfalusi --- sound/soc/omap/mcbsp.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index 68a1252..c7563e2 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -965,25 +965,15 @@ int omap_mcbsp_init(struct platform_device *pdev) mcbsp->free = true; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); - if (!res) { + if (!res) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(mcbsp->dev, "invalid memory resource\n"); - return -ENOMEM; - } - } - if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res), - dev_name(&pdev->dev))) { - dev_err(mcbsp->dev, "memory region already claimed\n"); - return -ENODEV; - } + + mcbsp->io_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(mcbsp->io_base)) + return PTR_ERR(mcbsp->io_base); mcbsp->phys_base = res->start; mcbsp->reg_cache_size = resource_size(res); - mcbsp->io_base = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!mcbsp->io_base) - return -ENOMEM; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); if (!res)