From patchwork Mon Apr 8 10:19:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2407561 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id 10205DFB78 for ; Mon, 8 Apr 2013 10:55:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UP9jc-0004GU-OY; Mon, 08 Apr 2013 10:55:36 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1UP9ja-0004GJ-Oo for spi-devel-general@lists.sourceforge.net; Mon, 08 Apr 2013 10:55:34 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1UP9jX-0008FL-Fp for spi-devel-general@lists.sourceforge.net; Mon, 08 Apr 2013 10:55:34 +0000 Received: by mail-pd0-f182.google.com with SMTP id 3so3173693pdj.13 for ; Mon, 08 Apr 2013 03:55:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=MhZf4z/3P9TQQMidTyuc6nWN9uw3D0VNGgEbtlKTQLY=; b=V0jM5zcp0uIIOepmvTnX+bpRQLLvGuaRw2Q0VUrudzdyuj5lw+8XvKl2ZzhL/leo6n TjTZuePxD6USMrUFo4eUBzoh7bSdHCKyfR8btbD4XcOm1vxljwnN9y33baR2Ow2yqJzv Zgmedz6AXkjskD+1GMeBymQ4vEdWC7Kms7ShdEKiZsHTXLvcoL4+OHM6bkiBZw/7yx5k 5UZWvyAbuYjRtT5mElRgs18AG6kMYwM7k0JrPRPlrVMapp5FzoSGp/H1I0jVHONbTTo/ 4oaTZzr69X0/+w2Bd40wK0uZIBuU+7MxlBCweCN+qs70VoAeMjxyMQEh3E4erSNO4hYI KOwQ== X-Received: by 10.66.167.69 with SMTP id zm5mr22253039pab.90.1365417088459; Mon, 08 Apr 2013 03:31:28 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id xl10sm38513538pac.15.2013.04.08.03.31.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 03:31:27 -0700 (PDT) From: Sachin Kamat To: spi-devel-general@lists.sourceforge.net Subject: [PATCH 1/1] spi/pxa2xx: Convert to devm_ioremap_resource() Date: Mon, 8 Apr 2013 15:49:33 +0530 Message-Id: <1365416373-22541-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmSOSx/o9hiHKU9FKS5TE/eoJD7pN+Ez4I1EODoQ14NOBBgpTiKFTxtLzsaQqGKUVJyKJTS X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.182 listed in list.dnswl.org] X-Headers-End: 1UP9jX-0008FL-Fp Cc: sachin.kamat@linaro.org, broonie@opensource.wolfsonmicro.com, eric.y.miao@gmail.com, haojian.zhuang@gmail.com X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Signed-off-by: Sachin Kamat --- drivers/spi/spi-pxa2xx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 1c2208c..f5d84d6 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1088,11 +1089,9 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) ssp = &pdata->ssp; ssp->phys_base = res->start; - ssp->mmio_base = devm_request_and_ioremap(&pdev->dev, res); - if (!ssp->mmio_base) { - dev_err(&pdev->dev, "failed to ioremap mmio_base\n"); - return NULL; - } + ssp->mmio_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(ssp->mmio_base)) + return PTR_ERR(ssp->mmio_base); ssp->clk = devm_clk_get(&pdev->dev, NULL); ssp->irq = platform_get_irq(pdev, 0);