Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1558597rdb; Mon, 8 Jan 2024 03:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOsHZkyuxBkW172aEtr4yu1NTbVzwHam52mcux3PiSKoDkBSXcuaGGgRGKmokW7MMoGmrQ X-Received: by 2002:a05:620a:4113:b0:783:1f5c:5e46 with SMTP id j19-20020a05620a411300b007831f5c5e46mr2438048qko.96.1704712519859; Mon, 08 Jan 2024 03:15:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704712519; cv=none; d=google.com; s=arc-20160816; b=qFLW9l83kehLKyXDmRYkBbHq4J1OwusL/9HqwsdA4Rvx/GSs0QA2veGK6KGXWggO++ 5geOaq2VE15rApuO9lcD0AdprPsirITATOJaf4SC8a+c3KntMTpD1sFwlC/Qvkw/F7U3 HY8sfR9uuQB2Y2Si5iJBhxGEDVhTOzNqwBVmhAN2jEKOaeBJSNzfPxyIa5+mj68VwyOr 8uOKwZqgQSld7hVhDQcNU+5pFyRHoSh9yrv/r1gJCXt5XGPUzQxRLkhBGKJwF72Sun5f UMT63S5XoryqevXqygnzrXN++EBBZuSwQ/ptfX4pHDAGxe43lBEMxCnVAgsoc3iNzp/d 1S4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ew2VrmHzGPvgqw37nixkUQHyViLcTKktlnYft8UoXmk=; fh=9Ag+6pvc2vIO7ZMQMRvDYc+/St03FiC998VXXA0O8FQ=; b=uT/c0efTIH9ACcFWZjefLOaWrT/MJUFj22mBM+BpAeiA4u0CnV+20QLJEqxrcDhQVF 5DdbHcBnZbwlHKZhpA0kZFGzZzoImFTdIq1wMmpFYhgAuHhfU+0t/cnyyIhATHZsJEaf hvVJGgms8aY8/ZrpK3b68NA8oZb6Gx8LQH5Q583r96xf8WDs55sDFyVE1sqUJtkwcaGy YqJmRv2b5JrRO/g2AcUvf1KFxwR3OVkQAAGBguTRavYEV/MgAiz/TND6rjZw2hLCh05w sin9mt8OOPrCoDT5byx7oW0K22O96f5L9pQNq9VifhE5yzcgqY8BWx+ZdWWd1k27si9c kkMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SrAC5YaC; spf=pass (google.com: domain of linux-kernel+bounces-19396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bm10-20020a05620a198a00b007831aa09c61si3374865qkb.742.2024.01.08.03.15.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 03:15:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SrAC5YaC; spf=pass (google.com: domain of linux-kernel+bounces-19396-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9BDEB1C22154 for ; Mon, 8 Jan 2024 11:15:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 630D114284; Mon, 8 Jan 2024 11:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SrAC5YaC" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 928A71426B; Mon, 8 Jan 2024 11:15:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE990C433C7; Mon, 8 Jan 2024 11:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704712510; bh=3onyJACON7UN+r62nN4g7w7HHbRgM+h21qgM1D0k0r8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SrAC5YaC8C/78giFGYGDmAO9hHqI3cDeSUnGDufaz+cC39G+F4UziFgYogb6u2b7m s0/BFGaX7LSMtEXbDTbVufZhX0s+xPtXJB2ylD9Dl5a/sGc4EmcrjerEGAwqbZfH2p k3cb0Z0ZJBWANO3X35IRgq9ozi7qLcGxzPXx2QlQjZqy/6rwnsbk/iqjUFuPvO6GN1 0wtZBFUZggsU8UHeHWMqg19y5k8b2j1NqHV8Jstg3VFNmsPg7MJJRaImu/vqxolo2M yOQ3bimzkhEhBk37koV4IwJ7P3++y9xTMUOG8/YNEUGEMX5KjGVSG+cWSXDlbx2zCD 2PD+Mjyl74ZAg== Date: Mon, 8 Jan 2024 11:15:03 +0000 From: Simon Horman To: Vladimir Oltean Cc: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , David Bauer , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Luiz Angelo Daros de Luca , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next] net: dsa: mt7530: support OF-based registration of switch MDIO bus Message-ID: <20240108111503.GI132648@kernel.org> References: <20240106122142.235389-1-arinc.unal@arinc9.com> <20240107195241.GB132648@kernel.org> <65274929-fa59-482c-a744-6b9ce162ab46@arinc9.com> <20240108110000.aujqhlufehngtkjj@skbuf> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240108110000.aujqhlufehngtkjj@skbuf> On Mon, Jan 08, 2024 at 01:00:00PM +0200, Vladimir Oltean wrote: > On Mon, Jan 08, 2024 at 01:22:18PM +0300, Arınç ÜNAL wrote: > > > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > > > > index 391c4dbdff42..39d7e7ad7154 100644 > > > > --- a/drivers/net/dsa/mt7530.c > > > > +++ b/drivers/net/dsa/mt7530.c > > > > @@ -2153,17 +2153,25 @@ mt7530_free_irq(struct mt7530_priv *priv) > > > > static int > > > > mt7530_setup_mdio(struct mt7530_priv *priv) > > > > { > > > > + struct device_node *mnp, *np = priv->dev->of_node; > > > > struct dsa_switch *ds = priv->ds; > > > > struct device *dev = priv->dev; > > > > struct mii_bus *bus; > > > > static int idx; > > > > - int ret; > > > > + int ret = 0; > > > > + > > > > + mnp = of_get_child_by_name(np, "mdio"); > > > > + > > > > + if (mnp && !of_device_is_available(mnp)) > > > > + goto out; > > > > > > nit: I think it would easier on the eyes to simply > > > > > > return 0; > > Actually "return 0" leaks "mnp". An of_node_put() is needed. Yes, sorry for not noticing that.