Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1550828rdb; Mon, 8 Jan 2024 03:00:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQAScS5doyUlRUMCqYN4tXioQ1fSEnKq5jWfHLee4xnBT53SP3Lw3Co9dmqPMVJ1YNPzAo X-Received: by 2002:a37:c40d:0:b0:77f:5e39:c9ea with SMTP id d13-20020a37c40d000000b0077f5e39c9eamr3950545qki.135.1704711618853; Mon, 08 Jan 2024 03:00:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704711618; cv=none; d=google.com; s=arc-20160816; b=ID+L2vNoWmOvUVmAfhKVQCsNtDgi1K4BX6fivK5DGNG/+rfts0K6Pi6MkiNwFywWjW hbQEj575ceULCY6UdbItjoNED9L63S5bKpxb1rOlZoNhDdB1Y6bh5SSASXz4BQ4DtK90 QHFRuWBHxq8xmn97rxo/fOWVkKKMclILS+licWDChmkMl4WL8k8WmcqSe2nX4xK+t0L+ mlgkQt8cbWhyFtP3NtYjnAppI5oobZOPJh070r9SGP6PA2yW5pCz1islsn/PR5eodJUT trY2qNIcP3CaUnypN8I5Pa2s4vVG/nz7J7kzH5T1xcRwrvQlPLJaJuXRxaidFWKHt+AF okmA== 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=kIBng4JuVPQpSbSQKIOiqlRMBF+3n9xAglfgloRNirA=; fh=xrkw9xUKMpP0In+p2vmMkQ4tutKBo490T06eXyLsaKM=; b=rE75OZlRdm/mGPTKLClySgtBQFqgUZr2TVfxP+bVmQQeJ1BhAGqEMTnYsTwzgMIzsP 8OjDchazDpCXjPrIMRMjNNkL4pjeQURZY+MGQQ4LKXHhQSdKdl/TFNzh4xbcp/CdTq7F lj0vCojMypYMZ12t4x5I8Yo7D+WnBC+ieimhaEWzH6qIwr8sqAN0O8+LCrb78pdZR7Mw V49pJCbuqFxZduUGzBViuQ+gA4AKrpXYHWvgVHjO7zyPON1xeS3TamQzDhmk1+1GztSN 0Ys45gzOkf9x2FUnYrQ98skGWhtyHE0Zz0a1KAlenT58DOVYWzopq0eI37FxpEqqBJPa e3hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J8xPtpx3; spf=pass (google.com: domain of linux-kernel+bounces-19364-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19364-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk15-20020a05620a1a0f00b0077f6791999csi4110753qkb.392.2024.01.08.03.00.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 03:00:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19364-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J8xPtpx3; spf=pass (google.com: domain of linux-kernel+bounces-19364-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19364-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 9A49B1C220CA for ; Mon, 8 Jan 2024 11:00:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBD711401D; Mon, 8 Jan 2024 11:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J8xPtpx3" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3B6814011; Mon, 8 Jan 2024 11:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40d8e7a50c1so22163035e9.2; Mon, 08 Jan 2024 03:00:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704711604; x=1705316404; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=kIBng4JuVPQpSbSQKIOiqlRMBF+3n9xAglfgloRNirA=; b=J8xPtpx3Yex3X/nxfPx3P5ScTW24ZXW3qCv63lVuiV9zZ/U9Fk4UE3IHICg9ZgN6yz 1kKFSk7LVgpRjn3u8cHmAwDKxtxYAplsW02YdWuYBSzqVsJRpZbZV86UNrGBw4QyxPXT 9uuHZK9XLjF2S0SsOetOFwJlNAbNFrOLxORsGl53eL0Vhs2WyKRMuQ3sQKc3xW8czOiG 1l+EHe68vZrZ5nJ/41jujQwSL4V7F1Ev8cWL2ie1+eOEKKqHYdoAtutDIGQep+VN7cRQ iSXY5Zw8yDbYheUhubtYhMSn5qZwnv3VRPQ8vcPeA22ITcyFi34oTCqWzM6NJZCLwlLT YxnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704711604; x=1705316404; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kIBng4JuVPQpSbSQKIOiqlRMBF+3n9xAglfgloRNirA=; b=GtJnMKBbJW3B/VRiX+SpQ+875UD7fUSw9w7KXRHY50ecQDubLp/OG7DYpRilfPJXS0 Bm/sXkDhC+lsftTm/A7sEKXaTUsTUtty9b5HQuv3Ogod5C+zwfoq08OUoswVEHAch25P j4+O7wWugzXhFOcf7z9XZdLjYWYCyRAcaLP4bAQv4jbevIOKOhPq1hRKXC/FN9P8iw7x fhC0A4M4m9RUFYqutdtf339GmdjBZjBeRNxi0OKgylrUgCv5yd2Z7bj8QUKPv+3b1m8l YiQ3GdgfzhDACWY2COeXrOXY1xb9LGGfBGvXcjlAHnzHa2GFPg3+BtIylfEZtoKC0xfM +K/g== X-Gm-Message-State: AOJu0YzlH/bcT+hQx/WWzbuiut8k38Fn5/XDfB+EBe3MaKp20P+JHh6S aEe7kJ6Z0siRtN6P+EHMdH0= X-Received: by 2002:a05:600c:4e4b:b0:40e:44ad:2e47 with SMTP id e11-20020a05600c4e4b00b0040e44ad2e47mr874588wmq.185.1704711603527; Mon, 08 Jan 2024 03:00:03 -0800 (PST) Received: from skbuf ([188.25.255.36]) by smtp.gmail.com with ESMTPSA id v10-20020a05600c444a00b0040e486bc0dfsm1924827wmn.27.2024.01.08.03.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 03:00:03 -0800 (PST) Date: Mon, 8 Jan 2024 13:00:00 +0200 From: Vladimir Oltean To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Simon Horman , 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: <20240108110000.aujqhlufehngtkjj@skbuf> References: <20240106122142.235389-1-arinc.unal@arinc9.com> <20240107195241.GB132648@kernel.org> <65274929-fa59-482c-a744-6b9ce162ab46@arinc9.com> 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: <65274929-fa59-482c-a744-6b9ce162ab46@arinc9.com> 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.