| Message ID | 20260803101452.2993721-2-andre.przywara@arm.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-24941-sunxi=pue.re@lists.linux.dev> X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id C23111C0164 for <noreply@patchwork.local>; Mon, 3 Aug 2026 12:21:51 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=arm.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-24941-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-24941-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 6C6A630B2944 for <noreply@patchwork.local>; Mon, 3 Aug 2026 10:15:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6D2437AA77; Mon, 3 Aug 2026 10:15:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="c2Fm56IH" X-Original-To: linux-sunxi@lists.linux.dev Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3967C377ABE for <linux-sunxi@lists.linux.dev>; Mon, 3 Aug 2026 10:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785752108; cv=none; b=rRcGKCq96ERxmc+EcdWlCevLBZ86gi4BpOoTzJ5x5mRv6NrTd28QIb+oqUWDf336vD39eMLHhoSA0RjHhkLbjhqPp4oUzsyaetGp2R7GwV5RIAYuISpEDdyXdmc8a+EmVmApivdtSFRzW1X6q1aevb28RB1XCwJQgh3tavjxmD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785752108; c=relaxed/simple; bh=VDCFDjjzMueT3uC3KTWgxQYVR++dcRtmQp4VgUJgJnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rXJKRelZw7ch5TKuw75E0NOHjHVdGeeryuVRuzZnHc6P2p5nZqNQ9XGPEeOfT043NLnjjyz6Wvoqo6EbImhuMzZ5VXrPcKauQqigc6zJOV0T4XcYN6i5CQ2hy1ND2yA1CWMpP1OpvBKTAhb6yTGa1myNW6MLk+kKdwRH8hvZSaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=c2Fm56IH; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EDB81476; Mon, 3 Aug 2026 03:15:02 -0700 (PDT) Received: from e142021.fritz.box (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22A633F632; Mon, 3 Aug 2026 03:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785752106; bh=VDCFDjjzMueT3uC3KTWgxQYVR++dcRtmQp4VgUJgJnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2Fm56IHDW776AjxEwkEjJlr6yeoqh9t4NrATKRW0HPew47HNVW+d3aVw98NGOVSG mUWTWK8ohP0FGpaP7JYvEbrlDMHHnklUwdo5zhxg5TJ2PrG4dSad8a+uWCoyl2y1ut kwYPVOw2g7KwHReAshZZfGQ8CoL73f9K218Enoq0= From: Andre Przywara <andre.przywara@arm.com> To: Andrew Lunn <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk> Cc: Liu Changjie <liucj1228@outlook.com>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/6] net: phy: maxio: prepare for more DT properties Date: Mon, 3 Aug 2026 12:14:47 +0200 Message-ID: <20260803101452.2993721-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260803101452.2993721-1-andre.przywara@arm.com> References: <20260803101452.2993721-1-andre.przywara@arm.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: <linux-sunxi.lists.linux.dev> List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev> List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
| Series |
sunxi: net: add Ethernet support for X96QPro+
|
|
Commit Message
Andre Przywara
Aug. 3, 2026, 10:14 a.m. UTC
The probe routine for the Maxio PHY returns early if the optional
maxio,clk-out-frequency-hz property is not found. That prevents looking
for other properties.
Refactor the routine to handle the property in an if-clause, to allow
more actions in the probe routine later.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/net/phy/maxio.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
Comments
On Mon, Aug 03, 2026 at 12:14:47PM +0200, Andre Przywara wrote: > The probe routine for the Maxio PHY returns early if the optional > maxio,clk-out-frequency-hz property is not found. That prevents looking > for other properties. > > Refactor the routine to handle the property in an if-clause, to allow > more actions in the probe routine later. > > Signed-off-by: Andre Przywara <andre.przywara@arm.com> > --- > drivers/net/phy/maxio.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/phy/maxio.c b/drivers/net/phy/maxio.c > index d2cb23895646..95a2169f25df 100644 > --- a/drivers/net/phy/maxio.c > +++ b/drivers/net/phy/maxio.c > @@ -43,18 +43,18 @@ static int maxio_mae0621a_probe(struct phy_device *phydev) > > ret = device_property_read_u32(dev, "maxio,clk-out-frequency-hz", > &frequency); > - if (ret == -EINVAL) > - return 0; > - if (ret) > + if (!ret) { > + if (frequency != 125000000) { > + phydev_err(phydev, "invalid CLKOUT frequency %u\n", > + frequency); > + return -EINVAL; > + } > + > + priv->clk_out_125m = true; > + } else if (ret != -EINVAL) { > return ret; The normal pattern is to check for errors and return them. So i would do this test first. ret = device_property_read_u32(dev, "maxio,clk-out-frequency-hz", &frequency); if (ret) { if (ret != -EINVAL) return ret; } else { if (frequency != 125000000) { phydev_err(phydev, "invalid CLKOUT frequency %u\n", frequency); return -EINVAL; } priv->clk_out_125m = true; } Andrew
diff --git a/drivers/net/phy/maxio.c b/drivers/net/phy/maxio.c index d2cb23895646..95a2169f25df 100644 --- a/drivers/net/phy/maxio.c +++ b/drivers/net/phy/maxio.c @@ -43,18 +43,18 @@ static int maxio_mae0621a_probe(struct phy_device *phydev) ret = device_property_read_u32(dev, "maxio,clk-out-frequency-hz", &frequency); - if (ret == -EINVAL) - return 0; - if (ret) + if (!ret) { + if (frequency != 125000000) { + phydev_err(phydev, "invalid CLKOUT frequency %u\n", + frequency); + return -EINVAL; + } + + priv->clk_out_125m = true; + } else if (ret != -EINVAL) { return ret; - - if (frequency != 125000000) { - phydev_err(phydev, "invalid CLKOUT frequency %u\n", frequency); - return -EINVAL; } - priv->clk_out_125m = true; - return 0; }