From patchwork Mon Jun 17 10:40:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 17949 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F39123971 for ; Mon, 17 Jun 2013 10:55:46 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf3592307yhq.9 for ; Mon, 17 Jun 2013 03:55:46 -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=H/ncr0DIBcjvrD0YuwEJHKKnO47bMnT8VXWYIQhqGN8=; b=EOehbifw9PS3BeDOYlLkMIKaopSXrXqNjFafb47WQ2kg0MyDtBQOd99Li1j+1zFgtr K5xLVYizzvLTH/O+0J4j2kK7g+YnnmdNRFh8MT4gVQ6HICxD/B0oqwt4wEZamL5H6RRL EqH+kvMDj8HU1H40/auKAPliBBKMGPOTT90KNlX2YU/QnzBss+X8kxFhL0mlFLOmwYIX WBS1CZS1Z6HZscTMe9rY8o3IyiRf0LhlSTsF3RrYeOinJuDeOjxYpTqzcKuBkRh8k8K0 vtgL/bQDJdCbAoB3uwEGYFHnUw5+5UAvjL4Nm5jjQ9sJL6uHsQt6/2m1vqDIrCHkhYBa N7OA== X-Received: by 10.236.112.226 with SMTP id y62mr8276589yhg.14.1371466546038; Mon, 17 Jun 2013 03:55:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.103.132 with SMTP id fw4ls937836qeb.17.gmail; Mon, 17 Jun 2013 03:55:45 -0700 (PDT) X-Received: by 10.58.215.200 with SMTP id ok8mr4299633vec.21.1371466545886; Mon, 17 Jun 2013 03:55:45 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id xb6si3853083vdb.42.2013.06.17.03.55.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 03:55:45 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::230 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::230; Received: by mail-ve0-f176.google.com with SMTP id c13so1966868vea.35 for ; Mon, 17 Jun 2013 03:55:45 -0700 (PDT) X-Received: by 10.220.110.78 with SMTP id m14mr4302072vcp.53.1371466545530; Mon, 17 Jun 2013 03:55:45 -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 yu8csp29369veb; Mon, 17 Jun 2013 03:55:45 -0700 (PDT) X-Received: by 10.66.179.78 with SMTP id de14mr10687261pac.18.1371466544589; Mon, 17 Jun 2013 03:55:44 -0700 (PDT) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [2607:f8b0:400e:c03::22e]) by mx.google.com with ESMTPS id cy3si6056449pbb.218.2013.06.17.03.55.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 03:55:44 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::22e is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=2607:f8b0:400e:c03::22e; Received: by mail-pa0-f46.google.com with SMTP id fa11so2730335pad.33 for ; Mon, 17 Jun 2013 03:55:44 -0700 (PDT) X-Received: by 10.68.194.8 with SMTP id hs8mr12759226pbc.84.1371466543981; Mon, 17 Jun 2013 03:55:43 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id xu10sm14503743pab.3.2013.06.17.03.55.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 03:55:43 -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 V3 12/15] ASoC: spear: Convert to use devm_ioremap_resource Date: Mon, 17 Jun 2013 16:10:57 +0530 Message-Id: <1371465657-22981-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20130617102000.GB1403@sirena.org.uk> References: <20130617102000.GB1403@sirena.org.uk> X-Gm-Message-State: ALoCoQktnoBeGTiDBO/fDAkGTZJQNkVXXKqQ6Wpw2yZGINYgYfAxqCNY62pjZ9acPS3PiYFZlHl/ X-Original-Sender: tushar.behera@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 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 V3: * Rebased on for-next branch of sound/soc git tree git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 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 | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index a4a8748..2fdf68c 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -282,27 +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); - 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))