From patchwork Mon Jun 17 09:13:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 17944 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f69.google.com (mail-fa0-f69.google.com [209.85.161.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4BBEF23971 for ; Mon, 17 Jun 2013 09:28:03 +0000 (UTC) Received: by mail-fa0-f69.google.com with SMTP id a11sf2671087fad.8 for ; Mon, 17 Jun 2013 02:28:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=w1PmhtTvfXWYA6BjetEAS90dLaMng15uNqZrSvfSfEg=; b=gGj1lepOV4V6tXSjKRQLkmIrqFvBPLuCI8/Ap1WVoohe8fQ2tF1B48BVtK9seLpGRx +RSYRP15S4AHx7Jw/2ki0x/F5Hfomi6XrUb/1s+FGvSqiP7y4xr+y0knLzkSRVHAcyel lG2BPWOZ46WI7YqmUzk3ANMr/Rv21OPCAfx+C4vM3QOTJFw13ft3k7bAeTltKj8k7gmC y7hX2+RDJMNarhSWZ8MmVEb3fGFdUvQxtjvIJGctMnBT/liZBNrVv3bpi0e/D4SDcr+0 vlIgbqfLMrVXUKICZ8i6hqKN2R9uWaUx6SV66X2DduMv7uqrzCGVS1F+MVzbYOse9xkH bBYQ== X-Received: by 10.180.37.229 with SMTP id b5mr2218117wik.4.1371461282243; Mon, 17 Jun 2013 02:28:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.103.67 with SMTP id fu3ls335140wib.11.canary; Mon, 17 Jun 2013 02:28:02 -0700 (PDT) X-Received: by 10.180.21.209 with SMTP id x17mr4298203wie.47.1371461282046; Mon, 17 Jun 2013 02:28:02 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id ng4si5068187wic.33.2013.06.17.02.28.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 02:28:02 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id da11so1884901veb.20 for ; Mon, 17 Jun 2013 02:28:01 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr4123339vec.37.1371461280940; Mon, 17 Jun 2013 02:28:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp27061veb; Mon, 17 Jun 2013 02:28:00 -0700 (PDT) X-Received: by 10.68.162.1 with SMTP id xw1mr11985980pbb.199.1371461279949; Mon, 17 Jun 2013 02:27:59 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id aj7si454756pad.158.2013.06.17.02.27.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 02:27:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w11so2586317pde.9 for ; Mon, 17 Jun 2013 02:27:59 -0700 (PDT) X-Received: by 10.66.49.104 with SMTP id t8mr11913494pan.65.1371461279327; Mon, 17 Jun 2013 02:27:59 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id pq5sm13192769pbc.7.2013.06.17.02.27.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 02:27:58 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: thierry.reding@gmail.com, patches@linaro.org, sachin.kamat@linaro.org, alsa-devel@alsa-project.org, Liam Girdwood , Mark Brown Subject: [PATCH V2 12/15] ASoC: spear: Convert to use devm_ioremap_resource Date: Mon, 17 Jun 2013 14:43:08 +0530 Message-Id: <1371460388-26177-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370864113-17895-13-git-send-email-tushar.behera@linaro.org> References: <1370864113-17895-13-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQnBQUSrFKep5cSvYiQ/T3ABZQY6UR754+/1ROGCwc24kA6EFdp1uc1MJJGzF/jkNC2H6aar X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). devm_request_mem_region is called in devm_ioremap_resource(). Hence that part can also be removed. Since devm_ioremap_resource prints error message on failure, there is no need to print an explicit warning message. Signed-off-by: Tushar Behera CC: alsa-devel@alsa-project.org CC: Liam Girdwood CC: Mark Brown --- Changes for V2: * Removed redundant print of error message from devm_ioremap_resource exit path * Call to devm_request_mem_region is removed. sound/soc/spear/spdif_out.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 4bde512..64db05a 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -282,28 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev) struct resource *res; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), pdev->name)) { - dev_warn(&pdev->dev, "Failed to get memory resourse\n"); - return -ENOENT; - } - host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); if (!host) { dev_warn(&pdev->dev, "kzalloc fail\n"); return -ENOMEM; } - host->io_base = devm_request_and_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!host->io_base) { - dev_warn(&pdev->dev, "ioremap failed\n"); - return -ENOMEM; - } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + host->io_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(host->io_base)) + return PTR_ERR(host->io_base); host->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk))