From patchwork Mon Dec 4 17:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10091207 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 2037C6035E for ; Mon, 4 Dec 2017 17:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10E7F28917 for ; Mon, 4 Dec 2017 17:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 042BB28D62; Mon, 4 Dec 2017 17:49:44 +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 8CCE628917 for ; Mon, 4 Dec 2017 17:49:43 +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=h9RbXxr9vcWSeC9nwC857K3bphJTvIGjExCtYc/AgHk=; b=rZmB6unIxkQ4uVemnowbjlOv+x zXZLm0d0mfcnyvpGWs04xQMxsN9MI2Ob2StQcSpEYKpUlJU+F8d2LnCGoqNC9S9GK6+cwO/ECTdc/ 6CSr3kivQZ+5j+s4SlKNS9IRTi9xcGNfwR/Ht32z8XYdjZhdJu/IYMSEqHpBT0yVNZYRen8d0g0LO i9kFOVmPejpZ4O00j4txQDUfHALOY70EZEsZ2uwOZI5sCuqlxOKQwJQ7cVp8CBIh2eec7tpusmmXC F3fBEQcYbk1xuaftAKRJ7yQNYGxP7/zIOgPR3ngGv/tEbmw29fR1KlEQe/wWK66L1umQhrDGwGRUe MfuFzQ6g==; 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 1eLus2-0001V9-Gr; Mon, 04 Dec 2017 17:49:34 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLurc-0000or-4n for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 17:49:11 +0000 Received: by mail-pg0-x242.google.com with SMTP id q20so8704407pgv.2 for ; Mon, 04 Dec 2017 09:48:47 -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; bh=FQ0IJdlFZ/dw/FO2WR2T18XOEAtQnVWMzHfV07ZNNIc=; b=ii0Cn5yr3zSEk3sFmdJbnNIc1Jd08i8obMdxKr4lDWtEvjAaytF+wDloLh1rFXmH15 IQKu9z/lGAE7x2aQWYPztOAlebL0PxJBxslFAcKOBDhwLyCKuKG5vOecGD8B0UVJp/qT ruoUqOuvLAQNOlMtdc3+Dd2wDbK4CzQeFNwPfAhPDjKa2hbfxVYMCwZYrt3TXcroFRdv nFVhHqUwOhD0sVFCCUHdeYHHPwn7vg4nWj6tErL4uJkFzICouuFDcXB5Vne+b7+48GYN bMTPBy/TXOO4hI2HO09+RhBeLd9mvVD4vfKhCOUZhTYThT++C8U05hFoAV11FDudlQPf P3rw== 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; bh=FQ0IJdlFZ/dw/FO2WR2T18XOEAtQnVWMzHfV07ZNNIc=; b=TsXszQqjDNdw7+W/uEtW1l1uo4DaH6S41XH33DyuoHUxubEAxyd/UtXnp7oPqjnWqc GaHSTIi1giPY1H2wOm3KVOLuihDbULkO2p87EveUOi/+YEEYXnieDmR6huwe16CcHkCr u4FbgFpHoKPjv6VJjqa/a5yCGZDklY026g793SkwemeqYm09YBH54NKRk6rFYSHCMed+ 9RyifCpQWg+qJAVUdvd+rGABKAZs9jXfHipo0PD+6n1eGVJQusZLjMus/4IxmOPt+4Qe VPQWPXMbQoSfy+I5Re7eEBYzGoye68Z3mIzd9ITFNhuYHcg7Y33JorcUHH1fMYxYgXn2 4OEA== X-Gm-Message-State: AKGB3mKYZJWDpiItJpHC84yKmQiR4JL9ETaWlWj0uY4cJPMhg+kR+rI+ cy1gA1D9lnmUXfyDyU1OlLI= X-Google-Smtp-Source: AGs4zMbGIVc/UO6peVzmq586RdLKeaRvjSfZTLZdoNlXFGTEXFvIzDm1/RsEI453uWr93jEAlVrYRw== X-Received: by 10.159.244.149 with SMTP id y21mr4261908plr.157.1512409727441; Mon, 04 Dec 2017 09:48:47 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id c79sm26098071pfj.49.2017.12.04.09.48.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 09:48:46 -0800 (PST) From: Arvind Yadav To: wg@grandegger.com, mkl@pengutronix.de, michal.simek@xilinx.com, opendmb@gmail.com, f.fainelli@gmail.com, davem@davemloft.net Subject: [PATCH 2/7 v2] net: ezchip: nps_enet: Fix platform_get_irq's error checking Date: Mon, 4 Dec 2017 23:18:18 +0530 Message-Id: <1512409703-20881-3-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512409703-20881-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1512409703-20881-1-git-send-email-arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_094908_407390_592CBDF5 X-CRM114-Status: GOOD ( 11.59 ) 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: netdev@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 number if an error occurs, Zero if No irq is found and positive number if irq gets successful. platform_get_irq() error checking only for zero is not correct. Signed-off-by: Arvind Yadav --- changes in v2: commit message was not correct. drivers/net/ethernet/ezchip/nps_enet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c index 659f1ad..7d4b628 100644 --- a/drivers/net/ethernet/ezchip/nps_enet.c +++ b/drivers/net/ethernet/ezchip/nps_enet.c @@ -623,9 +623,9 @@ static s32 nps_enet_probe(struct platform_device *pdev) /* Get IRQ number */ priv->irq = platform_get_irq(pdev, 0); - if (!priv->irq) { + if (priv->irq <= 0) { dev_err(dev, "failed to retrieve value from device tree\n"); - err = -ENODEV; + err = priv->irq ? priv->irq : -ENODEV; goto out_netdev; }