From patchwork Sun Nov 19 04:52: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: 10065069 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 3F87D602CB for ; Sun, 19 Nov 2017 05:04:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A99294CB for ; Sun, 19 Nov 2017 05:04:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E8D0294CD; Sun, 19 Nov 2017 05:04:18 +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 B0A01294CB for ; Sun, 19 Nov 2017 05:04:17 +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=uYg8Tx9iy8SJpGqDpQY9wya4FNulhKTjhJoQgLyGIZU=; b=LFZTIijiPptsnxrN6CiOnk5Z6E /0r+0PygV3IXJ+SUtiiSpOCOrs6XdMJ7ld8wZ1K3i2R/hed8IyHCG3yFVYnGEj2Ho8hPZH7MXaHBC Uap8RVxG6CQQWptwwDU/AIXTKYOIWMSEoueC0+DLIr2blwUUVSRz5KJ6P7xrHyVgwbyxWTbSwRGek Mtamo8KBe0CveUaubVcODet7DG/Uv1nIQtLc2TVQfEBh6JR0bT0gZQP7rePWtak5Y7mvz7ql147KW Gyjdxx/kye9H1Mg/Zich8VPa9CeNLKpvKfE0le74N4GbzSC+W+4auQgD2dpTbt0WKob89xCjeYUXu OBNyK6jg==; 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 1eGHmC-0006uZ-Gf; Sun, 19 Nov 2017 05:04:16 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGHbg-0000PY-NI; Sun, 19 Nov 2017 04:53:28 +0000 Received: by mail-pg0-x243.google.com with SMTP id 207so4863980pgc.12; Sat, 18 Nov 2017 20:53:04 -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=bAr7MsmmBEpiqbPLCvrWBSiyp4C27JXgrFgjxXBhqCM=; b=HsTfEYmRo2HOjQ+IR/Iv0VKILrczQAf74b7SzrF9jCRLwoFGtg8Dz4PovK8jWg4hSs tnE4aXsbcqnSOqApq73+FEzIU6C1Bxmln2dDyOTYDogdBWfjPkmONgd24kWj0cLqnwGa ME9KLb9aPVlK0VnORLGT5Xc0YssC9971+3NkcqDdgmH07K4YP7PRlImsDsRNLAKioeJy HmZjMxfGNUnU3Nfa3Lbj9thIQECf0aXtrSs5O0ve94CFfx8d10CD8J2PxIh6s0DXsF3Q /Dos7O+C+SWGS6u4a+dweCXoGN5h2m8POjr1x4kJpODOvAgxAeDRqeiVAWLo88DzA7Sn VWMg== 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=bAr7MsmmBEpiqbPLCvrWBSiyp4C27JXgrFgjxXBhqCM=; b=Ephmb8RN6KsvDo3qme4ZRb7R5Ze3zd24WCx3H/k/GNwT2npd0dHMJgBhmlZLqSeoIk tFNuyMAbOkkzOcXLXRTGRNf+fSSQjMLjiTQSuOQn8M7NPrmr064G45LgoD6d7lsYiHPY xXI2hIqqbuDapnUOs4fX62lXGemNmzuPiaCxLWPLkF9olYVI62AnnFwtpRRiJOeyvmPn twtSpK0CkE58vELCs6oHmS0EyfjwMQkE1GY4XN67JTv/U0ZLMwPqptoJLuTlg8CI2CGP G7IcvRMR63MIzqPiimbveytvbvX6c3dVTp1uYGdsF3hezq6M4fWSpIsX9tDoMW1xT/Pl f6Kw== X-Gm-Message-State: AJaThX66MK+UpHunTE07lQ+iDrPFg2d0DntcFqZ10bpjk9Z84GgaZw3U vf4xxtoqBK3vrPBRMAYfdAc= X-Google-Smtp-Source: AGs4zMZy+uotMHKbkOlZ7TjBRGpxZQJPQfJwS5xuv3rWflF1Y5QRopsAODZx9wOqyb2FzYMYpD3DSQ== X-Received: by 10.99.149.12 with SMTP id p12mr9334982pgd.381.1511067184112; Sat, 18 Nov 2017 20:53:04 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id j79sm2312952pfe.129.2017.11.18.20.52.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:53:03 -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 v3] mmc: s3cmci: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 10:22:44 +0530 Message-Id: <870b1a28108a8c0f3885bd345f3d27dda67621d5.1511066652.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_205325_084365_77C50A8C X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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. changes in v3 : return -EINVAL instead of host->irq. drivers/mmc/host/s3cmci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index f7f157a..36daee1 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1658,7 +1658,7 @@ 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; goto probe_iounmap;