From patchwork Fri Mar 14 17:22:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3834171 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 41BC6BF540 for ; Fri, 14 Mar 2014 17:23:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 515A6202A7 for ; Fri, 14 Mar 2014 17:23:03 +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 3EF7C2028D for ; Fri, 14 Mar 2014 17:23:02 +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 1WOVow-0001eO-Nt; Fri, 14 Mar 2014 17:22: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 1WOVou-0002r6-4h; Fri, 14 Mar 2014 17:22:56 +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 1WOVop-0002pD-Ra for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 17:22:54 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2F00BCVS9D3R60@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 15 Mar 2014 02:22:25 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-cf-53233ad15d1a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 06.90.29263.1DA33235; Sat, 15 Mar 2014 02:22:25 +0900 (KST) Received: from amdc1032.localnet ([106.116.147.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2F0031WS9BS310@mmp1.samsung.com>; Sat, 15 Mar 2014 02:22:25 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH] ata: ahci_platform: fix devm_ioremap_resource() return value checking Date: Fri, 14 Mar 2014 18:22:09 +0100 Message-id: <2139783.QvectlX5nq@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+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jAd2LVsrBBqv+qlm8OT6dyWLT42us Fsd2PGKyuLxrDpvFr+VHGR1YPTat6mTz2Lyk3uP9vqtsHp83yQWwRHHZpKTmZJalFunbJXBl /N3eylzwnqvi+JNLbA2MEzm7GDk5JARMJDb072KBsMUkLtxbz9bFyMUhJLCIUWLT/IvMEE4L k8Sl+TsYQarYBKwkJravArNFBGQlrkx7yAhSxCzQwSjRPb+THSQhLBAh8evnX7CxLAKqEsuW bgdr4BXQlJh0eCsbiC0q4CmxY/tKNoi4oMSPyffA6pkF5CX27Z/KCmFrSazfeZxpAiPfLCRl s5CUzUJStoCReRWjaGpBckFxUnquoV5xYm5xaV66XnJ+7iZGcGA+k9rBuLLB4hCjAAejEg/v BSXlYCHWxLLiytxDjBIczEoivPuNgUK8KYmVValF+fFFpTmpxYcYpTlYlMR5D7RaBwoJpCeW pGanphakFsFkmTg4pRoYrapqeKUSkjq3K4f/m/KVT/89m/jNkhpxlV3GpzTuxtsn7ZAN7SoW /709/Ou9Dfc09iu0mesfa/wobdL7TfyA78Ns1/2rHrM47/974XJZ4PIo10Y13y9s0zccU3n+ 5+ctlsbFKtozVS5O+P32yTSrdwu6z216ZlRQ4rddUf7Kh7Wbr0yq4M0zUmIpzkg01GIuKk4E AOQbcNxIAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_132252_115907_2C3B81C8 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: Hans de Goede , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@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 ahci_platform_get_resources() accordingly. Also while at it remove a needless line break. Signed-off-by: Bartlomiej Zolnierkiewicz --- Compile tested only. drivers/ata/ahci_platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: b/drivers/ata/ahci_platform.c =================================================================== --- a/drivers/ata/ahci_platform.c 2014-03-14 16:45:04.056724383 +0100 +++ b/drivers/ata/ahci_platform.c 2014-03-14 17:54:12.504653647 +0100 @@ -199,8 +199,7 @@ static void ahci_platform_put_resources( * RETURNS: * The allocated ahci_host_priv on success, otherwise an ERR_PTR value */ -struct ahci_host_priv *ahci_platform_get_resources( - struct platform_device *pdev) +struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; @@ -219,8 +218,9 @@ struct ahci_host_priv *ahci_platform_get hpriv->mmio = devm_ioremap_resource(dev, platform_get_resource(pdev, IORESOURCE_MEM, 0)); - if (!hpriv->mmio) { + if (IS_ERR(hpriv->mmio)) { dev_err(dev, "no mmio space\n"); + rc = PTR_ERR(hpriv->mmio); goto err_out; }