From mboxrd@z Thu Jan 1 00:00:00 1970 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 80A85288D6; Sat, 13 Sep 2025 13:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757768504; cv=none; b=acX0DgjZ2yI07X2v/n0mDAvxNseRA55U8/z7FyqZOregeKJyZFh+okc+dzevMdPdj/Uh7064HhkXYDhAsHwMyuKPrjwuNhJRJD5UBZu4/rT+/nyDOocx/NuL9iT201T30jlwIBOTSsRHlUI/8NpFmVsxPefv2DLisVCZe9N7zWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757768504; c=relaxed/simple; bh=AomHbXjj2ZCUcLKxzCjlmTkzRv3ch6j47Nsf97s7m28=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I9qXYCiqCkefO/bHZrmXlwxeEZy4HjgeqkoGGpOg+lRb1F4AhVLDqTlHyWieLaRtxJCks1UOWvuO30vbKjAY7w/oUW82dGkfVNH7UmGB/R8F8J23s2mXgXhWYg5WoLAKvlPDB/oaayNV/zWg1IfSyJ7FB1ld4uBG3nW6Nm7WxPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b+Nnwqsd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b+Nnwqsd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1000C4CEEB; Sat, 13 Sep 2025 13:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757768504; bh=AomHbXjj2ZCUcLKxzCjlmTkzRv3ch6j47Nsf97s7m28=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b+NnwqsdjYqUUU5iDKDNJ1RiHTJ41S+3Q5XcrXwOvxElRasNhNUyyKz0q22WSbK24 Iv9gkT9b9xl9pVbotzkof4Al5C1TtWA/zJrlymNERSHnY447cR/VRfac1D31t/WBCw lkpDKFRO4rZuYPCIK+IwL5DSMBBgvRSaEhd2tjDlXb2Eu1QTM1LbcNOMxi6n2ISqCi 9KEA4/V+KEHgPDpRaU/FAhFE7YMpYwJ8mVKeqt0yjjadCUEguXponQbyqPn99Kqbla MeTXIG6jKyUr+OtDEB3CQ4jdTOXrWDRYPTr4tajuv7QT78p/rTgjVv7fhvHHI/VCYq X9j/XgJIxBfFg== Date: Sat, 13 Sep 2025 14:01:37 +0100 From: Simon Horman To: Christian Marangi Cc: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Heiner Kallweit , Russell King , "Chester A. Unal" , Daniel Golle , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH v17 6/8] mfd: an8855: Add support for Airoha AN8855 Switch MFD Message-ID: <20250913130137.GL224143@horms.kernel.org> References: <20250911133929.30874-1-ansuelsmth@gmail.com> <20250911133929.30874-7-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250911133929.30874-7-ansuelsmth@gmail.com> On Thu, Sep 11, 2025 at 03:39:21PM +0200, Christian Marangi wrote: > Add support for Airoha AN8855 Switch MFD that provide support for a DSA > switch and a NVMEM provider. > > Also make use of the mdio-regmap driver and register a regmap for each > internal PHY of the switch. > This is needed to handle the double usage of the PHYs as both PHY and > Switch accessor. > > Signed-off-by: Christian Marangi ... > diff --git a/drivers/mfd/airoha-an8855.c b/drivers/mfd/airoha-an8855.c ... > +static int an855_mdio_register(struct device *dev, struct an8855_core_priv *priv) > +{ > + struct device_node *mdio_np; > + int ret; > + > + mdio_np = of_get_child_by_name(dev->of_node, "mdio"); > + if (!mdio_np) > + return -ENODEV; > + > + for_each_available_child_of_node_scoped(mdio_np, phy_np) { > + ret = an8855_phy_register(dev, priv, phy_np); > + if (ret) > + break; > + } Hi Christian, Maybe it cannot happen, but if the loop above iterates zero times, then ret will be used uninitialised below. Flagged by Smatch. > + > + of_node_put(mdio_np); > + return ret; > +} ...