From patchwork Mon Aug 15 22:34:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9282265 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 B4C5460839 for ; Mon, 15 Aug 2016 22:36:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A482128E64 for ; Mon, 15 Aug 2016 22:36:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 991D528E97; Mon, 15 Aug 2016 22:36:57 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 58A1F28E64 for ; Mon, 15 Aug 2016 22:36:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZQTk-0004xe-Jp; Mon, 15 Aug 2016 22:35:32 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZQTg-00041C-5a for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2016 22:35:28 +0000 Received: by mail-pf0-x243.google.com with SMTP id y134so4354722pfg.3 for ; Mon, 15 Aug 2016 15:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jBZnpX269LUVULHzDRUk44gIgqKdVKngnkIu30lovwY=; b=qaD9OCSxyIhbGA/FE8Zl+qtXjBCrF7oMNFIA0shJVvwhD2YfweIY+vq3ZQRBGWsBVI 3kwGbGBTFGBgbYDiU9hxdHZnspZXuwwPcFmq0k5BTlm22Lp95pQgA58VuhZDZpkeqKBV wryJi9AIJFVEGJNwKi+ZcSFOEdUcQF16mygq8q3t9CMCDFlsEjaIqmhm41Bxo0CvxZnT K/lFjjta9ruL08fxAuzDaVBztH3vZHQGNn+03PTSbcTtyM95ACREeqQ9VYRktvge9d3V AUCUsr4v45hnJH0CGyFr8e3F+Th8+uKQaw/w++UDxXqHyLqTvZdhM6GX39FhVHu9NXXk aMzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jBZnpX269LUVULHzDRUk44gIgqKdVKngnkIu30lovwY=; b=JjRHPHWIw5L0i9bHwW6M1o0ffrzInYHaGt/bQxeuTPgeflA3WWJgP+qdMx21iY0YLG 1xOuzvimjTxqdDxQBiEX67SqlBRicctM3ooW7e9LeJe5GkA52JhaAyhFis+4W6iVdCHK hu0DLKp1csXFTxj3aNLOTzhZn8JuFbLvksgiOMHuRWedEaKjPbHAzu825UU7sBfMbh0u 9x2HKms3+QAalPiFgj/LPCsnq8CtnF4h9OqPhhKoYA/GBauIgDGwgDQSXAka1fQJre9i GkdDxsWSW0Y7EmldG9QncUMGHwHj59B8exq1tq6l8mlabKi6AFRkAhzyOzKsfum9TcCa yC9A== X-Gm-Message-State: AEkooutd+kIcouXluRygu4K5o3tLHShns4sQrkCkC6shkPJwb7P1XZ/Rc/RiYgB3xypGaw== X-Received: by 10.98.84.65 with SMTP id i62mr57695943pfb.72.1471300506501; Mon, 15 Aug 2016 15:35:06 -0700 (PDT) Received: from bogon.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id ao6sm33972037pac.8.2016.08.15.15.35.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 15:35:05 -0700 (PDT) From: Wei Yongjun To: f.fainelli@gmail.com, michal.simek@xilinx.com, soren.brinkmann@xilinx.com, appana.durga.rao@xilinx.com Subject: [PATCH -next] net: phy: Fix return value check in xgmiitorgmii_probe() Date: Mon, 15 Aug 2016 22:34:57 +0000 Message-Id: <1471300497-15066-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160815_153528_289488_88AB3630 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Wei Yongjun , linux-arm-kernel@lists.infradead.org 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 In case of error, the function of_parse_phandle() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/net/phy/xilinx_gmii2rgmii.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 8e980ad..cad6e19 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -67,7 +67,7 @@ int xgmiitorgmii_probe(struct mdio_device *mdiodev) return -ENOMEM; phy_node = of_parse_phandle(np, "phy-handle", 0); - if (IS_ERR(phy_node)) { + if (!phy_node) { dev_err(dev, "Couldn't parse phy-handle\n"); return -ENODEV; }