From nobody Sun May 10 17:11:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93C5AC433F5 for ; Thu, 28 Apr 2022 16:28:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350036AbiD1Qbi (ORCPT ); Thu, 28 Apr 2022 12:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236269AbiD1Qbf (ORCPT ); Thu, 28 Apr 2022 12:31:35 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A427ABF64; Thu, 28 Apr 2022 09:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GtAsWsxLvghSgDqBYs6k2r2Uh0pbj3QxHzvMzbKIr9xc9N/yrB551kwI4gMTNPkUOsCkBSc0VL0fCaKmMksnUD+SeukQnY/C2GJukBWJT6D+pzPcfZHUTeYy1rwXWwA5tIeKDTy52GWwZQJBYhjzON8Ruhrb/I3DApbnvcWzKhHPP5iruJfe6O5D7Xs/4n+P6Gv/b0smW/Kuni3ANNU1zl//zlpOlkCpFp9HorI3e96NnnNTq9GoqvXHQzZE8LCYgwdJJvQBaZ4attxR1UPCCt/VxaDGJKyMdmK8T/2FvXgUWKxvTKzIQndjSJ7Qnux60cH4tugGHl+gBZRymwEQjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KRio9Aqnt9lfwYAJ5VgcwBMIrZIy3/GrpNieuzUald8=; b=IHY2pClgzLtwDJdCjMg+FgkIuU2g4+Hm2si0BdF3xxV6EomR3dG4k1Di/QbPkU2TY/FHJw3HyHQK8rr2mpVIEuSwM6WsceZKBk/LBQxglbg9qyLhv7hGbA839Ck62o0rL4otm24wMRV7Q30MKdl752runTYd2yR477B9y/ZTf/g7US/1r5lJ67ias6EcWve7GEiQfLC4iv7kczc9kSvjpxdFz4AIQ36FIm8Btg1wTfQ1KH/IxYiJzjcHDECFcty3rYnMdQ0TnlGM306z4/u46USxNG3aYYvR78YNP1iauyJh8W5ztKHSCb6gl2KpJXU/GYgtElsm1PqH4gJJH7u+Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=davemloft.net smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KRio9Aqnt9lfwYAJ5VgcwBMIrZIy3/GrpNieuzUald8=; b=DLnFAJCufgNr4hjjT3nDtny5yldWVIoFpaqhVxzz1UyWih1d3hQ8nWmggk7h5knLZvbhEBNGQAih0mmfhGcHT/XVbEe6OCjgBPqhAKJSDtExXdGfpLCxWzkhVdATLv1ynL5QkOaLXKzpY6UvIoRRXk38vODn/ZoF5xKFFOoBdVU= Received: from DM6PR06CA0078.namprd06.prod.outlook.com (2603:10b6:5:336::11) by BYAPR02MB5669.namprd02.prod.outlook.com (2603:10b6:a03:9a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Thu, 28 Apr 2022 16:28:17 +0000 Received: from DM3NAM02FT020.eop-nam02.prod.protection.outlook.com (2603:10b6:5:336:cafe::c2) by DM6PR06CA0078.outlook.office365.com (2603:10b6:5:336::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Thu, 28 Apr 2022 16:28:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT020.mail.protection.outlook.com (10.13.4.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 16:28:16 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 28 Apr 2022 09:28:15 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 28 Apr 2022 09:28:15 -0700 Envelope-to: git@xilinx.com, davem@davemloft.net, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Received: from [172.23.64.6] (port=50304 helo=xhdvnc106.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nk702-000H01-UZ; Thu, 28 Apr 2022 09:28:15 -0700 Received: by xhdvnc106.xilinx.com (Postfix, from userid 13245) id 1CA4960500; Thu, 28 Apr 2022 21:58:01 +0530 (IST) From: Radhey Shyam Pandey To: , , , CC: , , , , Shravya Kumbham , Radhey Shyam Pandey Subject: [PATCH 1/2] net: emaclite: Don't advertise 1000BASE-T and do auto negotiation Date: Thu, 28 Apr 2022 21:57:57 +0530 Message-ID: <1651163278-12701-2-git-send-email-radhey.shyam.pandey@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1651163278-12701-1-git-send-email-radhey.shyam.pandey@xilinx.com> References: <1651163278-12701-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d3df69f-7537-4907-5753-08da2934198a X-MS-TrafficTypeDiagnostic: BYAPR02MB5669:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fMc6CbXFGuh/PWVZ/Co2X4mjlsYIMeo/LMwV1kmvWTwHL8/gtULePNVL8VAcP26tAXqvJg2VS9/uWBr5YgH0sD+souWHP9si1xY0T6atW2L3z/wDMKCWan7gRfjsbC5QJ8NGS/j8I4ND9pCLQcvyVnfJhzajpNqus1ObFFy8JtlyhhF85tXoZ9dVNzwqyBbFBjtjLba0lFdRB0id7aUmcUNO/nqBrU+u2AQrWvx9TAXa0yRN4LkyDmsSKSlejQQBev4EHy4shdbbOfU2AZVY6CEBG7kZzbB5HVgAAP62iGR+cz1xHXy6iACei0rsSMYH/MBVCgGHX4pzjlvSUviURa2InFVos9GfMqrPWK0ZuasZgzu4Vz71FPpdxxE5KeP+tR2DGe0HTTKdyooI6dUSEgMG5KbyrBcP2/0UtOlYIXmP7LpG30m/AygGBBS17RawJP24BEe2dDAcWAv/X7TEi9C+qX8bW18jj9nlKdtCRLgvpHFA+vyEnpIC3uOrWeQOud36tfYhJ7pUOTUsTmlwJsZHMiZA2SmxMBHNMbqxLrX3CK0+XMim6mdSaKDJZmXbEhY7fr9lupDtNveowBWNjzCfiMOnyMZuz51jiwYv72VK6RrQ1s9oecRnAiA7ov0XbNyVmnVXJ4yTdXxNC6NYF+LakYj8Q8Cs5s05QguuBVXNYlD9OtzxNN8dE5hx5rvPNli7DgQI/4la67ipMMkzFA== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(70206006)(70586007)(6666004)(2616005)(186003)(7636003)(107886003)(82310400005)(26005)(42186006)(356005)(47076005)(8676002)(6266002)(36756003)(336012)(6636002)(110136005)(40460700003)(426003)(316002)(8936002)(2906002)(83380400001)(54906003)(5660300002)(4326008)(508600001)(36860700001)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 16:28:16.8787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d3df69f-7537-4907-5753-08da2934198a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT020.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5669 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Shravya Kumbham In xemaclite_open() function we are setting the max speed of emaclite to 100Mb using phy_set_max_speed() function so, there is no need to write the advertising registers to stop giga-bit speed and the phy_start() function starts the auto-negotiation so, there is no need to handle it separately using advertising registers. Remove the phy_read and phy_write of advertising registers in xemaclite_open() function. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 --------------- 1 files changed, 0 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/et= hernet/xilinx/xilinx_emaclite.c index 7a86ae8..f9cf86e 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -907,8 +907,6 @@ static int xemaclite_open(struct net_device *dev) xemaclite_disable_interrupts(lp); =20 if (lp->phy_node) { - u32 bmcr; - lp->phy_dev =3D of_phy_connect(lp->ndev, lp->phy_node, xemaclite_adjust_link, 0, PHY_INTERFACE_MODE_MII); @@ -919,19 +917,6 @@ static int xemaclite_open(struct net_device *dev) =20 /* EmacLite doesn't support giga-bit speeds */ phy_set_max_speed(lp->phy_dev, SPEED_100); - - /* Don't advertise 1000BASE-T Full/Half duplex speeds */ - phy_write(lp->phy_dev, MII_CTRL1000, 0); - - /* Advertise only 10 and 100mbps full/half duplex speeds */ - phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | - ADVERTISE_CSMA); - - /* Restart auto negotiation */ - bmcr =3D phy_read(lp->phy_dev, MII_BMCR); - bmcr |=3D (BMCR_ANENABLE | BMCR_ANRESTART); - phy_write(lp->phy_dev, MII_BMCR, bmcr); - phy_start(lp->phy_dev); } =20 --=20 1.7.1 From nobody Sun May 10 17:11:18 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A93EAC433EF for ; Thu, 28 Apr 2022 16:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350045AbiD1QcI (ORCPT ); Thu, 28 Apr 2022 12:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349411AbiD1QcF (ORCPT ); Thu, 28 Apr 2022 12:32:05 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2041.outbound.protection.outlook.com [40.107.244.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F604ABF42; Thu, 28 Apr 2022 09:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E6MwMJNimY+cbju1LT89lPK4plhXSVDcVQXj4fmD7tENhEbTbBtnvBZ7Xi7NaP/lRpUqGUC3OFwKBMJUnpDDQMA5tG8eemG8Zcg1Q6S7Fdr1+OcAnFuQuhNibkcTTnCwwUlSi3somD0O7Siyumc0qZMu9WlYFEgAUGulKGT1qRY2Q1l0ygv8ALn3P2fcQjhgJG4LxLhEykY0MObTP/m2g6h7nr0r25tiGz56gqigsjfFMfJvX8V7UMNB6HFu2OHvAKXpYeB1kZOPc2LfahnhsBB/mUp8BFFAqMfYDVyoQOr01uy5e8eG4JIq0/Bj2bBkYVWrkmwgsCQ2axyeYsxThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gpk6xWWnC0w56/WGt8wDFjPihVI0LeOVanmVBweZGP8=; b=X22+uoKuY5TBc3/LTR9d5Yfx3maLAFT5oWHeputWieiKBrD4C9/0UccdlWVnq1YvVKYF8G4xgbNjvVw9/KUpydjFKwi2k2UoZat1l9k03HJIuk3W4MKT7j00SUM8wQe/vNDl1fYiSZMDwBsVHVeLiXgQuAnIpp2v4A+2nKNWFvCOU+P3dyGsxeGt7Ij7/6X/26logv+kiQoe818cu4syQC4BaKXH2PA7ZTtO4K++DqR8zW+OAqrAQu12SU+sWKiIoYfBfZc0NNfPOw+4Xkc1Rclp+5Aod+Mf4GZiKhu8+VFgofgwqa5iEkUeeYVEThav3Ou0V+SYOz3VI4uWfbeYGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=davemloft.net smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gpk6xWWnC0w56/WGt8wDFjPihVI0LeOVanmVBweZGP8=; b=E0xPVtUyi5Nyx5GUf6AI2CxZ0mXg0jPYURSE6mkoRMPdSeZFKxlrevQvD30citg0iHLlAepI55n+vF9jmXxS1pOo8JctZf4tKfe8QJJJbJ8MeOFjL5lLDWxTPMNud0qxXUdw2LrmVZvHtAJE3zq53M7IhRUD8SclD3uBKLYdGLQ= Received: from BN8PR15CA0028.namprd15.prod.outlook.com (2603:10b6:408:c0::41) by BY5PR02MB6388.namprd02.prod.outlook.com (2603:10b6:a03:1b4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Thu, 28 Apr 2022 16:28:46 +0000 Received: from BN1NAM02FT036.eop-nam02.prod.protection.outlook.com (2603:10b6:408:c0:cafe::c7) by BN8PR15CA0028.outlook.office365.com (2603:10b6:408:c0::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.23 via Frontend Transport; Thu, 28 Apr 2022 16:28:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT036.mail.protection.outlook.com (10.13.2.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 16:28:45 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 28 Apr 2022 09:28:28 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 28 Apr 2022 09:28:28 -0700 Envelope-to: git@xilinx.com, davem@davemloft.net, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Received: from [172.23.64.6] (port=50305 helo=xhdvnc106.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nk70G-0009gp-1O; Thu, 28 Apr 2022 09:28:28 -0700 Received: by xhdvnc106.xilinx.com (Postfix, from userid 13245) id 222A36052A; Thu, 28 Apr 2022 21:58:01 +0530 (IST) From: Radhey Shyam Pandey To: , , , CC: , , , , Shravya Kumbham , Radhey Shyam Pandey Subject: [PATCH 2/2] net: emaclite: Add error handling for of_address_to_resource() Date: Thu, 28 Apr 2022 21:57:58 +0530 Message-ID: <1651163278-12701-3-git-send-email-radhey.shyam.pandey@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1651163278-12701-1-git-send-email-radhey.shyam.pandey@xilinx.com> References: <1651163278-12701-1-git-send-email-radhey.shyam.pandey@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d8562c3-b0a1-4b78-04d4-08da29342ae1 X-MS-TrafficTypeDiagnostic: BY5PR02MB6388:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9QL+f0qbrnfDj/9YxtlkZlKyn/A/CSKU3fT+sn74fOCmDC6uVSSkJUnN0WmvuigBc/gUTzP09AZDivRvDxKZ+NvAL9Afo5rx4a5zggmg+luliVirJWm3C4j7CwcO77hy1gtHZDcbW6AkyiSi/PuRmfD/tVLRq217Bo5ELJ8rMZ62omu7+vgOXI/OVRpkLySBZcvKuaMSSWA373Ol1dYynN8iTrTwp8Ct46FWzLBZR/wR9IjceknS52CakpTXSVKFzGcK7GnsbJHRVcT/O75ihC/g3trjBG1FVcogqwhnSbR5ogAVYuMZqg3yMgkB0rKaCIh4p/UrK9nhIkQFwW0HvwhZaSUmU6y3+qkZXm6QODnPq1/wT747b/t7vK3NEiWtkR3MAJZ++/SzN2AFYA93OXZjBNXO6l+kymw/7ht3Qa0lzw+ZnjpEY596GB/PTlhM6Vx1LwBXPH8v7vX0JXxIQSKCfPOt89pw4NazLMJGqJPsaQP0w/VJn4vPlE+dSKr2Zxmt0w2oBGI6PKw3lq5Hy2xbuDSj7F7VPqnziWCeGGUjMQwLqX6pocpAY2BlF6LFEDRvAvNfn48RpPpG+OlpPCbLpTr45amjoQUSijV8YFiwx80HU96pxWy2iWMBFuMcWTKhbGmPUSSO/G7KYphr/EZufACS3dGlPk1jOFyWGIJCzLGJ7HOmtOpssJHrngYMpTV6UAgsb3G8Yw6IIY7BSA== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(110136005)(36860700001)(107886003)(54906003)(42186006)(336012)(2616005)(426003)(186003)(47076005)(26005)(356005)(7636003)(40460700003)(83380400001)(6266002)(508600001)(82310400005)(2906002)(5660300002)(6666004)(8936002)(6636002)(316002)(4326008)(70206006)(36756003)(8676002)(70586007)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 16:28:45.9368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d8562c3-b0a1-4b78-04d4-08da29342ae1 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT036.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6388 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Shravya Kumbham check the return value of of_address_to_resource() and also add missing of_node_put() for np and npp nodes. Addresses-Coverity: Event check_return value. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/et= hernet/xilinx/xilinx_emaclite.c index f9cf86e..c281423 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -803,7 +803,7 @@ static int xemaclite_mdio_write(struct mii_bus *bus, in= t phy_id, int reg, static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) { struct mii_bus *bus; - int rc; + int rc, ret; struct resource res; struct device_node *np =3D of_get_parent(lp->phy_node); struct device_node *npp; @@ -816,8 +816,14 @@ static int xemaclite_mdio_setup(struct net_local *lp, = struct device *dev) return -ENODEV; } npp =3D of_get_parent(np); - - of_address_to_resource(npp, 0, &res); + ret =3D of_address_to_resource(npp, 0, &res); + of_node_put(npp); + if (ret) { + dev_err(dev, "%s resource error!\n", + dev->of_node->full_name); + of_node_put(np); + return ret; + } if (lp->ndev->mem_start !=3D res.start) { struct phy_device *phydev; =20 @@ -827,6 +833,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, s= truct device *dev) "MDIO of the phy is not registered yet\n"); else put_device(&phydev->mdio.dev); + of_node_put(np); return 0; } =20 @@ -839,6 +846,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, s= truct device *dev) bus =3D mdiobus_alloc(); if (!bus) { dev_err(dev, "Failed to allocate mdiobus\n"); + of_node_put(np); return -ENOMEM; } =20 @@ -851,6 +859,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, s= truct device *dev) bus->parent =3D dev; =20 rc =3D of_mdiobus_register(bus, np); + of_node_put(np); if (rc) { dev_err(dev, "Failed to register mdio bus.\n"); goto err_register; --=20 1.7.1