From patchwork Fri Mar 14 17:33:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3834261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD1A1BF540 for ; Fri, 14 Mar 2014 17:34:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C959820138 for ; Fri, 14 Mar 2014 17:34:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 790B82012F for ; Fri, 14 Mar 2014 17:34:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOVzZ-0004cS-Ti; Fri, 14 Mar 2014 17:33:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOVzX-0003B4-Kt; Fri, 14 Mar 2014 17:33:55 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOVzT-00039k-Uv for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 17:33:53 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2F00CU5SRSDJ50@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 15 Mar 2014 02:33:28 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-57-53233d68e184 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 34.20.28157.86D33235; Sat, 15 Mar 2014 02:33:28 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2F00616SRRSW80@mmp2.samsung.com>; Sat, 15 Mar 2014 02:33:28 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH] ata: pata_imx: fix devm_ioremap_resource() return value checking Date: Fri, 14 Mar 2014 18:33:13 +0100 Message-id: <2050303.yEm1sTq1hQ@amdc1032> User-Agent: KMail/4.8.4 (Linux/3.2.0-54-generic-pae; KDE/4.8.5; i686; ; ) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsVy+t9jQd0MW+Vgg5+rJC1WTd3JYrHp8TVW i2M7HjFZXN41h83i6bolzBa/lh9ldGDz2LSqk83jzrU9bB6bl9R79P818Pi8SS6ANYrLJiU1 J7MstUjfLoErY+qVQywF09grvjR1MTUwdrB1MXJySAiYSMy4+58dwhaTuHBvPVCci0NIYDqj xNepi5ggnBYmid7GKUwgVWwCVhIT21cxgtgiArISV6Y9ZAQpYhZYyyix5cUB1i5GDg5hgWCJ 2e3eIDUsAqoSH5p7wbbxCmhK7L2+GGybqICnxI7tK6HighI/Jt9jAbGZBeQl9u2fygpha0ms 33mcaQIj3ywkZbOQlM1CUraAkXkVo2hqQXJBcVJ6rpFecWJucWleul5yfu4mRnCgPpPewbiq weIQowAHoxIP7wUl5WAh1sSy4srcQ4wSHMxKIrz7jYFCvCmJlVWpRfnxRaU5qcWHGKU5WJTE eQ+2WgcKCaQnlqRmp6YWpBbBZJk4OKUaGBerlTZznjrDYNA9xaR9kvn7OecvvhDazC5QzJwu y52nd/usZxvH1ZWzb7Xc76sIfqWjFXNu819Tq78WKvrPs1R9Zium/Dgyc3rQKbGpx7YqfuBl V+ja37Zrd77LiijDX40eNzKX3V/y3yr079NyTn+br3WLxB5uMYvNMw07XPCiI+/kkcio5Uos xRmJhlrMRcWJAJbG2cVQAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_133352_229238_B7794177 X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: linux-ide@vger.kernel.org, Shawn Guo , linux-arm-kernel@lists.infradead.org, Sascha Hauer , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP devm_ioremap_resource() returns a pointer to the remapped memory or an ERR_PTR() encoded error code on failure. Fix the check inside pata_imx_probe() accordingly. Signed-off-by: Bartlomiej Zolnierkiewicz --- Compile tested only. drivers/ata/pata_imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: b/drivers/ata/pata_imx.c =================================================================== --- a/drivers/ata/pata_imx.c 2014-03-14 16:45:04.260724378 +0100 +++ b/drivers/ata/pata_imx.c 2014-03-14 18:23:38.664623530 +0100 @@ -133,8 +133,8 @@ static int pata_imx_probe(struct platfor io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->host_regs = devm_ioremap_resource(&pdev->dev, io_res); - if (!priv->host_regs) { - ret = -EBUSY; + if (IS_ERR(priv->host_regs)) { + ret = PTR_ERR(priv->host_regs); goto err; }