From patchwork Fri Feb 2 16:36:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13543158 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2079.outbound.protection.outlook.com [40.107.22.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B8D77C6E9 for ; Fri, 2 Feb 2024 16:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891931; cv=fail; b=EkXPlMjtSeT1HgLObTUXKulafZNWf5wLsdsqV1fjT0Ncs+ng9XxGDb3XmoyI4//LgwSqYvr0fjO5lJ8MNEzTlDm9Wl88qmLIRzBji/ZuoL8sc26HJ6riDzVBP1FJquCocvuY84xqqAhEm1FPURlSq2PNBvl0EV+kSEMomPIAYtY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891931; c=relaxed/simple; bh=8w4L5iRUwy9daFHuKz/kbsHfPNUdUlpcMdTeH01/NNk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EyBlMKz/hlbHeV1UDzgq+a5MMzy51waoNutqQii6Rc9uYnFat72vhcNri3FiEKUNFjVyAwt1plqcuvFiQyoSWjDK6geR4qLQ7lI7H7pMeAFrTjLSTggfpTRqZcp5ck1hbcSYAaKPQSB4hQUTqMxdlHFC9nx8MyQVEOGipfvIt+8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=DaxKlj5B; arc=fail smtp.client-ip=40.107.22.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DaxKlj5B" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y22Diez8dgvyzLABGV/O3rjKNQISc9fMWQWpg1J8kKKt1cv5ZWdq6k/S5gpWqmL9LnOSsZSzbdYf03WQ6b1My9yT0Ks/hLlCIjgk/FPdcGjadmSmy/b/ROD5staZaQV0g5XYiVUqoY33z3Ts4v09v38bqDMcfdRWlMqAyxbhRSXKw5QO0JMcLw/p4NeEG/jEwphhhkrjOiYbzZxLSzEQ73TLOQA9dep81NaKnckWxAPwR+kqi9ijAtYaVBsxUc1bs0OHFJ3pMINsfvAnxm9jUPELOCsidYK/n+A7KLaYAGViAWtCWRWa6k7D32TdR51HjpVN7dW5D7SxDXHAWlRbpA== 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=AtDBDFi8u+XxQA+VOclNg3nBYwnvpdBo08Vq4t2QZT4=; b=czYWgbYqaNMbdDbH1KKDvemKvyPn0kIAITLA0LfvLVA5PIMeKZuu1XPNVueDJFGbIdL24P+88OfvXpDef654mZULUfXqT7EG6xBS+kRdVkVs/MIDnBULHk6/xeLRlRLNkA0yoanp/ZFHbW2nxtqbdOocatxevHYVJwasOo5tPbDx5X7xYQRTyEuZQe4unFzEa9woHdsbb783pEHNxp6MKYNXbgnKbHyGYpaVU74+AcBWENA3KaksUbPjoNRI4S08c5UapwP5/TwrKnPGHOLHX0yUhnakUIwETUc4Eum6SHEbGQy+HKBH5OuaHRH3TDMCFRtfODH9BupBwqJ5aUsJyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AtDBDFi8u+XxQA+VOclNg3nBYwnvpdBo08Vq4t2QZT4=; b=DaxKlj5BDuUpy6SqMgQRwSlwGORoRCgVU3HWOnFEpmbFQS+NI0NC60EOY4NrAEQdSd4NhjcILZAvD794Vp087RFdBUs2fgw5/kaZjt2oTSgKHvkrIl+aqnGhtpTnEFmGEbYS9KISRuAfmrCQZVYa+6i1bvxIjAyETbe0Vgt0GXM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) by GVXPR04MB9974.eurprd04.prod.outlook.com (2603:10a6:150:11a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Fri, 2 Feb 2024 16:38:46 +0000 Received: from VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::62cb:e6bf:a1ad:ba34]) by VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::62cb:e6bf:a1ad:ba34%7]) with mapi id 15.20.7249.027; Fri, 2 Feb 2024 16:38:46 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Florian Fainelli , =?utf-8?q?Alvin_=C5=A0ipraga?= , Christian Marangi , Luiz Angelo Daros de Luca Subject: [PATCH net-next 1/2] net: dsa: qca8k: put MDIO controller OF node if unavailable Date: Fri, 2 Feb 2024 18:36:25 +0200 Message-Id: <20240202163626.2375079-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202163626.2375079-1-vladimir.oltean@nxp.com> References: <20240202163626.2375079-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0102CA0094.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::35) To VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB7374:EE_|GVXPR04MB9974:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c0fcb37-1b3c-44c8-1da0-08dc240d6c81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xof4HboFt+pyCNM21zjdRKVwUrAOHBV5vjXwPeamLfBLp44GwrebJiE3AUoS3rA6Zw5Aho21ZQ9xajdnG3jD77Fpw+rcclG3VKPV6IqsZZKA4sP1ltg3Arzo1x+Tav6nhk/LhgEuSLDYUqIRRp5wHIjR1vP43b7BYXVSYgnle1ejzmcRzXRpqudmhSJUIqgpymOKkEdI+Mg6P8e7TTQFYvTOitj8OfwVlHBroGm99lN/n93b9Bm/84nzkmk26m0NHFw+i6mnnUDZVejVDSfs042iyJ09zI9Bx7DXdEnpUsL+Zugm2yKo4+oQFdiQVLeIhfprpm+iIb6RHqOFsVmiWSVd5N6OfLNI6QdgSqngGy6QVaOqaW19CPtq9QnZBpWBplZwoc/kIQdg/jKqrDfn8iVz1tYyqb/HOnve31b+zJpYR3bzw1aM+SyF1O2uvNjUay8xJtfhmF6GVEZ/Tju2Wtcv/EbtU94jiFLUnTfplcFbygFa0ujGaGpWEIDMa7md9WavpcjzBL+Pa7AyLT2Gh+t+ARouveqZEIl7/YTbQBUO4+UwfEDH2Xwg8lJ8A5W0jQz6VzfpC2h03BTeBpFH6zBNrTxpIEZla9YuriaAu05ZGw/vijf4rLRudYiTjDTC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB7374.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(376002)(396003)(366004)(136003)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(83380400001)(41300700001)(2616005)(6512007)(38100700002)(4326008)(26005)(8936002)(2906002)(1076003)(5660300002)(7416002)(6916009)(966005)(66556008)(6506007)(66476007)(66946007)(44832011)(54906003)(478600001)(6666004)(52116002)(6486002)(8676002)(316002)(38350700005)(36756003)(86362001)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N+C29rRUjXwSsK4pJSSUT7o1VuUIFZsypCDOt/okna3o2TQpzECEuEhsNWC6WBsIQcokD7K/qHNTQEKE5qY7dr2dlKpcb55PRfD8lJTkMQMozV5JiAWmI3KWJggNtMBz+x5bRnFx0SS7vkSPSaIjBgi9aw3pVvOaZAIkozTdfJRr83TYlX3Nzw+xs8BBRiwTJaska/tmWaxfXnh8YvyriRrR1mbHZdj+TsCG2PrNCUcvtjhlkH01jdW+SKOaxYBGETURrcUNR0fmRirCMCzh7I/gE5ZNuCs/xfMOm9jxAkQsoB9oeNhjfDpAZ/B+gObTmu4RZ8lqEXjxIIRWtTm5YCVD/H7f8K9zuTd7gfQzwjfeG86VJ2sSgIhz2QhFsf/RJAx+T9K9dHUzMz5poOZd9AdD9Utwb6M4uQwPmUI/4O6BWG9P7ETMzQ+WM1dYC7qDFD41BJJM9yKn7SaEaLHqNlzHZ1wNadUocjR9wAuHeY7LLe7GP2Hzb/osgTMQzdfdHrMjIukiy6zhy8xhjXcC9/LtyRx1tyUn1JYEUHH+AMU+KVtp1zkyPGwmzy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MS-Exchange-CrossTenant-Network-Message-Id: 7c0fcb37-1b3c-44c8-1da0-08dc240d6c81 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB7374.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 16:38:45.4457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: adVF1TEP4weGEQSN9WmjAX/k1bC/r5uvyJ+/GCAD4cpotHSpzoC2eycqsyTjMGTJwe8VWwPuu3zJcUItrWhROw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9974 X-Patchwork-Delegate: kuba@kernel.org It was pointed out during the review [1] of commit e66bf63a7f67 ("net: dsa: qca8k: skip MDIO bus creation if its OF node has status = "disabled"") that we now leak a reference to the "mdio" OF node if it is disabled. This is only a concern when using dynamic OF as far as I can tell (like probing on an overlay), since OF nodes are never freed in the regular case. Additionally, I'm unaware of any actual device trees (in production or elsewhere) which have status = "disabled" for the MDIO OF node. So handling this as a simple enhancement. [1] https://lore.kernel.org/netdev/CAJq09z4--Ug+3FAmp=EimQ8HTQYOWOuVon-PUMGB5a1N=RPv4g@mail.gmail.com/ Suggested-by: Luiz Angelo Daros de Luca Signed-off-by: Vladimir Oltean --- drivers/net/dsa/qca/qca8k-8xxx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 7a864329cb72..95d78b3181d1 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -954,7 +954,7 @@ qca8k_mdio_register(struct qca8k_priv *priv) mdio = of_get_child_by_name(dev->of_node, "mdio"); if (mdio && !of_device_is_available(mdio)) - goto out; + goto out_put_node; bus = devm_mdiobus_alloc(dev); if (!bus) { @@ -988,7 +988,6 @@ qca8k_mdio_register(struct qca8k_priv *priv) out_put_node: of_node_put(mdio); -out: return err; } From patchwork Fri Feb 2 16:36:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13543160 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2079.outbound.protection.outlook.com [40.107.22.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAC4A1487D2 for ; Fri, 2 Feb 2024 16:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891939; cv=fail; b=GPy0K+23+O8vqWi/nuctUz+4lyar7gHVA0WEtLKp5xgwLsmBZ6P3zuJt8WhTl91z+/0ItKip0U6rEGAsNb2cSOXUjIk/JJc5iSyLwBQS1wkl1NQRm2Tt7pg5IKY/CJUpTkYATJESWpJvCi5RE0ZCtXR+a8g2QAA22wEsdjixilQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891939; c=relaxed/simple; bh=+LmrV9F43P33v2xP3Hj8OTB8AkLAXVj5XYA05ONuFNo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Wq4UeLL9sTJZXBnFDmoX+TkD23VuUdIwGfJQ0pzRVWVMA8vIR8l0n6KVHI3wuyQIl9zbIhaB78JzRroP3yIOvAyQy6vkHwW51ZUGAfKfOf7VXwwYewDyooRJu7moKcPHp2PRZt4k70Wlco/a4Xr/42fAYbLII4LasQPOq0nZJGI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=JmqtD+jD; arc=fail smtp.client-ip=40.107.22.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="JmqtD+jD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c0WKdtmVKF3Hh1X/lethxPLpK9fok5mFsxQjiiFpj+5Px4dkN8qhzdRP2Kp4go7HPBlDdnA94AUmWQ+AOmgQmf0mrNTuqYkKrs9nk/y9rts+7PJPJto2JcNVrsWCr2zPWjESndXC2asBvMNFQjTzGgkeburS9T5Wc2XrfLjTTZw3FLqD4VBk9HNQHkiKCh4ieF4cD/ik7lSPGU8OzJBfBIU5+QK/pRfzSSDqFN47CGrr0DowT5ymqsvwQ90RHGPUM0yznpUcXOPNfjZ86Za+8HIs+Ez+ng/1ep9AqNWgIcycQQyNIM+Uw6IEdXHbAYKZrXGgKtmGVlpYyOac4sNMiA== 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=QaQwmwJYiwpIEf3JkN3YWg2Hazw1wKYZJjttZpyqsAw=; b=ftjmtN6Zngh0nIyKnzFSqrX7iMUSSP44LfSiYOwwrGukiOwe7+zMCeuKvnpSCGUc0x3oFmyGURHvqMG8KjrJ5j11h/fdxV0+w3+PQDvn6aY0Qb1QLQW3qI1DQX24ukrhoYbVVfFt5KLJlzopJMsEfEgZQqjIIfOjoLwJNd37P2DeijWy1y/XWEgoOiwit1aYAMGdrkw+2zfeX6gO4dClcoihEj8uFqupsS9aEcdX3u0IfTs/6hfiMVmRvgEOa1VqpmTevSBPGt7GXV86OTSJG34DwaTkI0173yZyIhenTHjLrDysdS5Fg6LfXapZOw0t5e2zuZ/8qKCb53CochRETQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QaQwmwJYiwpIEf3JkN3YWg2Hazw1wKYZJjttZpyqsAw=; b=JmqtD+jDqE6vs7mr2MWR5TCqF2N7o9JMY7cZxjK7Sp8isqeqcBvtok7ptxp/haMxqO83I7ck64XfXQPBcJO/9YMYjjQIAPWDbGSgA6X8IVQiHnBi2ruRTn4rwjCcYBcHptm2im2rjA5ExERE2WDejqzl3euwXhmqK3XlL6AekLA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) by GVXPR04MB9974.eurprd04.prod.outlook.com (2603:10a6:150:11a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Fri, 2 Feb 2024 16:38:46 +0000 Received: from VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::62cb:e6bf:a1ad:ba34]) by VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::62cb:e6bf:a1ad:ba34%7]) with mapi id 15.20.7249.027; Fri, 2 Feb 2024 16:38:46 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Florian Fainelli , =?utf-8?q?Alvin_=C5=A0ipraga?= , Christian Marangi Subject: [PATCH net-next 2/2] net: dsa: qca8k: consistently use "ret" rather than "err" for error codes Date: Fri, 2 Feb 2024 18:36:26 +0200 Message-Id: <20240202163626.2375079-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202163626.2375079-1-vladimir.oltean@nxp.com> References: <20240202163626.2375079-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0102CA0094.eurprd01.prod.exchangelabs.com (2603:10a6:803:15::35) To VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB7374:EE_|GVXPR04MB9974:EE_ X-MS-Office365-Filtering-Correlation-Id: a433538e-cf57-478e-73ba-08dc240d6cd1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bEn7T3GjxHPDQiqlOnGNDbFIzq0+q+fspo1FeDwu/gvnHIG4RXWKZAbhrh2WMgd09ex/GW1PlDKmMO6g5Abx1UWxOCHTLMER8H+P8jS3877BkOBHKo2xFOtR5ekCMWGtFpvv6kZkGT33Xwk3JVggpTWz0s3gCgWMzXf9C8BRSZj9xlkDihtPKC7CoYnFbW8p8U5aqJmCuA0iXElVwK73KE01aHNm/lvZNNQrCKIYVURfzvN60LEofRNFeIh8kjz9JYiAeADgRwriRuAJSB6wxWkiAaP2TmOllTU928RTyAeMNl3unZKtvvQiLfvqVU1iXLPrjHwNx8AlWyKjFtNki5SUzwSV2u7XJaY8QOiWfx7M69Vs0hV6rWq7MlNFXUdxB9E4duKz25q3X4jYq2amCe2o83Degw08l0WlLGX6mild6IYBpdvtkSq065SsVlnEj3bFbhU3e9eOhDrUbRnmKBoOMJpXZvqH6VJqocHs0gNYO2m/GTKAaNyosOVjBkRW1Y43n3RhN0AwKTattGwuYgCk+nq+27j4iLZYvyaTD54sGwtXCiQ4kZWow/pQa+x8js1ld88pHmVnpQKDbvRzR3YkcoYTZ9lAN46Cu9xlGFHFY68Q+fnCw73nzGNgyzTrqs+L3fAyQOMTUuTXM2cQTTDJQyRz0CjIw5aZ87RujLg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB7374.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(376002)(396003)(366004)(136003)(230922051799003)(230173577357003)(230273577357003)(1800799012)(451199024)(186009)(64100799003)(83380400001)(41300700001)(2616005)(6512007)(38100700002)(4326008)(26005)(66574015)(8936002)(2906002)(1076003)(5660300002)(6916009)(966005)(66556008)(6506007)(66476007)(66946007)(44832011)(54906003)(478600001)(6666004)(52116002)(6486002)(8676002)(316002)(38350700005)(36756003)(86362001)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8ZFHr8WdrdBPBDbp85b+LsYzjvrb?= =?utf-8?q?p1uCdpN/rtynqlHfULaYmgsQ/7cUz3Ind7iQcs+VBeuxWkkOExlmYRPrUB/5vd3uU?= =?utf-8?q?3CZYHygwLQrozVYgdZ77RsUMD55qy9D65JoOFeVcBEcZudha6+6C/bGjDfJJmyPUg?= =?utf-8?q?LDqyp46RMvUw2KQVOKZtfV0ruEandnueoVQbITYnT5GKr/ydiV74RmCDXf5QEXRm3?= =?utf-8?q?+URNZqCpA7J0N9+zhmGLLFHRDlniaPUpIijO9OwzkPkrBr4wnUyZy3BQ7WCSeLUK2?= =?utf-8?q?QXO17pDQ0DI6CO5MSK9FtHU1T5YsvCHLVtnI4S8S04i7kD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rzb2OwVkQS?= =?utf-8?q?V/TzzU3cQJuFOiGiHFEnAS5iGQELS0M8ifV3+X5LlfKZFU72D/hBrX0RKwxsQ+6K6?= =?utf-8?q?yckEz+Nbno2SqFeuPiYHi/GLDU4vy3Mlo79N8MJEGFSh3TJh8126rn367VKAh0CBB?= =?utf-8?q?RRsZpNDt9oKBsUOZO630WyMfW5MbKDpUQmKoCyTYipdDexF6e9m7gC5R0CYfsBsvW?= =?utf-8?q?RgsG1waCatDBSeJwRigNQVhDvQL/0Lus7npphTHkfpYuzckYThmM25XDmrWxZ969H?= =?utf-8?q?tu45AHw+uHuNGi44hn2vgnZ5/S07PdFhRNKCCFuDSBImE3CEJt8PHLmpbqG2KuCHk?= =?utf-8?q?rE9FE1dBt2nkXvlRjw4syEUHCQYfuhr2lQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a433538e-cf57-478e-73ba-08dc240d6cd1 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB7374.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 16:38:45.9733 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mm7uUZBxAaqJboT/dbKOpoqJ9db3SYDSE9GYWTvhdwE+8SmUTYzx+QTmu2Z8Ll4NqNj5bekpye6fmnTMQ9M2Iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9974 X-Patchwork-Delegate: kuba@kernel.org It was pointed out during the review [1] of commit 68e1010cda79 ("net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure") that the rest of the qca8k driver uses "int ret" rather than "int err". Make everything consistent in that regard, not only qca8k_mdio_register(), but also qca8k_setup_mdio_bus(). [1] https://lore.kernel.org/netdev/qyl2w3ownx5q7363kqxib52j5htar4y6pkn7gen27rj45xr4on@pvy5agi6o2te/ Suggested-by: Alvin Šipraga Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Christian Marangi --- drivers/net/dsa/qca/qca8k-8xxx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 95d78b3181d1..dab66c0c6f64 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -950,7 +950,7 @@ qca8k_mdio_register(struct qca8k_priv *priv) struct device *dev = ds->dev; struct device_node *mdio; struct mii_bus *bus; - int err = 0; + int ret = 0; mdio = of_get_child_by_name(dev->of_node, "mdio"); if (mdio && !of_device_is_available(mdio)) @@ -958,7 +958,7 @@ qca8k_mdio_register(struct qca8k_priv *priv) bus = devm_mdiobus_alloc(dev); if (!bus) { - err = -ENOMEM; + ret = -ENOMEM; goto out_put_node; } @@ -984,11 +984,11 @@ qca8k_mdio_register(struct qca8k_priv *priv) bus->write = qca8k_legacy_mdio_write; } - err = devm_of_mdiobus_register(dev, bus, mdio); + ret = devm_of_mdiobus_register(dev, bus, mdio); out_put_node: of_node_put(mdio); - return err; + return ret; } static int @@ -997,7 +997,7 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) u32 internal_mdio_mask = 0, external_mdio_mask = 0, reg; struct device_node *ports, *port; phy_interface_t mode; - int err; + int ret; ports = of_get_child_by_name(priv->dev->of_node, "ports"); if (!ports) @@ -1007,11 +1007,11 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv) return -EINVAL; for_each_available_child_of_node(ports, port) { - err = of_property_read_u32(port, "reg", ®); - if (err) { + ret = of_property_read_u32(port, "reg", ®); + if (ret) { of_node_put(port); of_node_put(ports); - return err; + return ret; } if (!dsa_is_user_port(priv->ds, reg))