From patchwork Sat Nov 18 09:33:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A636560230 for ; Sat, 18 Nov 2017 09:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AF09292B2 for ; Sat, 18 Nov 2017 09:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F5DC2A706; Sat, 18 Nov 2017 09:35:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46BF9292B2 for ; Sat, 18 Nov 2017 09:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZEiieRXJSWp3j1LMSAMwjJ0NIrZlYpUgwR3gM/Axs10=; b=FsP2nGO9lGuFz03TzIe9WF+plQ D1JeGHHbvAFewj/4IAsJ4vaERs/i1EQbDnXhiRBs9d78ye9ZgirSC3Nrkoiej3XqikiQQr6lqRsYr 3z9EPhYBZSQPO69/ZKG5JDeQplwDcZUHeorEvAWgmUjiURRSvRQ+EDqJG/iOT5D+md8Qxrog8sOkb R+jKVUnEb72bvdUsR0E+uuo8lpcXDDCqlwzHFWnN66JbejzlqJVm8GvWLyZrQ1iS045Z6xMML6EvF oAo6sCGdSTzH/R/EeEnMBDhhkj7VEoBYTRrv+O24jsAkeVrgLAdjOeapxirzaBC70ihfJooNQGi+Q PLHyLamw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eFzWe-0008AQ-Sa; Sat, 18 Nov 2017 09:35:00 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzWI-0007gs-8K; Sat, 18 Nov 2017 09:34:45 +0000 Received: by mail-pf0-x243.google.com with SMTP id m88so3728269pfi.9; Sat, 18 Nov 2017 01:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=UgDAr7GgC0b+vZbkcTH8Lo6yPa0N1X9AzuDfrGtxZmI=; b=gHxvqztvpLbL9AVg4tesTdmlIdo/fO6UmDIn4LV+dTfsexlF6NDtqd6aeWZbTZOT38 FNnX+4uHTV1tdCzLLuZi9kMHRaOjCoQ5q/zvBXo1YwPjTA6DaqtLUKqChU6/TfKDAek8 T6KgY7SX2n/V0Nd0m+wQ11bS/x+y6AK29mA72P44tJemgZb7vzPm8+6B/IsIuvIwT/s/ rPOmkNLrARvt012KxtoJMjoPmdSzHX1w7ZTfWcpJB1bDGaxZf7ApmpMicT4bQcmq1CD9 haUa+oZ7R1UA15Yu+D1VqcSfkAoceyhw3+2f4Sw5A2ixPBIIMtMBf3BAse9yFVmH3PtE B2Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=UgDAr7GgC0b+vZbkcTH8Lo6yPa0N1X9AzuDfrGtxZmI=; b=giOSoL5wCngldF3/mBHXljgFL6xI95x3bDpNxvSi98hYeCc5p1I1LcsVsLQZD2L2hN 1QUNEzL0FyFAWORTZ9/2wT+EJPMcyyqCWnxIG93oLYpnqalQW/WgY3CStrDOzfq/MR1+ WFP1/X0Xz5Qqa4LTuOq5/R7kzIJelJooLx47ubysht7y9iZ7rKbv3Mh28rsdlQ8cJo3q 92IwbhrSyo0pzKYPgI4hcyAjVc+Yj1Bds+H5bkGC+EYZvp/83rqIAzJnkANyrtSxacts sbYqMyOYTug6P9ZSQ/k0An1fHaZMQsV3X+JduZmbSSGLju08o3XyD4Ve7u93WOC7GfUE u7mg== X-Gm-Message-State: AJaThX4Ly2AaAWVjMi8PUlmxAXJhuqPEeE9G1TqQzfllnaVMl+Kre/pa nMFAx8uyYz4MQiimIGuPr0c= X-Google-Smtp-Source: AGs4zMZzvMpz+X1L9vHXXraFgeBdO1s+zlbincMb5OkVuiq6bZTORcamupGbPpnhntny16kMj9a9EQ== X-Received: by 10.98.79.152 with SMTP id f24mr4971618pfj.143.1510997655300; Sat, 18 Nov 2017 01:34:15 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id y20sm11057079pgc.52.2017.11.18.01.34.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:34:14 -0800 (PST) From: Arvind Yadav To: ben-linux@fluff.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, vireshk@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, carlo@caione.org, khilman@baylibre.com Subject: [PATCH 2/6 v2] mmc: s3cmci: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 15:03:44 +0530 Message-Id: <7952b7c2d5bb853ac6b09517e634b1838d9729a2.1510997223.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> In-Reply-To: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> References: <130df0c2c60ed6a0f460b68c586cc0a4167aed0b.1510997223.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_013439_086369_C65055C6 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/mmc/host/s3cmci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index f7f157a..cc801bc 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1658,9 +1658,9 @@ static int s3cmci_probe(struct platform_device *pdev) } host->irq = platform_get_irq(pdev, 0); - if (host->irq == 0) { + if (host->irq <= 0) { dev_err(&pdev->dev, "failed to get interrupt resource.\n"); - ret = -EINVAL; + ret = host->irq; goto probe_iounmap; }