From: Andrew Lunn <andrew@lunn.ch>
To: Andre Przywara <andre.przywara@arm.com>
Cc: 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>,
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: Re: [PATCH 1/6] net: phy: maxio: prepare for more DT properties
Date: Tue, 4 Aug 2026 04:42:56 +0200 [thread overview]
Message-ID: <4d855daa-a426-4f46-985c-181e3b0eb7f1@lunn.ch> (raw)
In-Reply-To: <20260803101452.2993721-2-andre.przywara@arm.com>
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
next prev parent reply other threads:[~2026-08-04 2:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 10:14 [PATCH 0/6] sunxi: net: add Ethernet support for X96QPro+ Andre Przywara
2026-08-03 10:14 ` [PATCH 1/6] net: phy: maxio: prepare for more DT properties Andre Przywara
2026-08-04 2:42 ` Andrew Lunn [this message]
2026-08-03 10:14 ` [PATCH 2/6] net: phy: maxio: parse and enable PHY clock from generic DT binding Andre Przywara
2026-08-04 2:43 ` Andrew Lunn
2026-08-03 10:14 ` [PATCH 3/6] dt-bindings: net: Maxio PHY: add PHY-ID for -Q2C variant Andre Przywara
2026-08-03 10:14 ` [PATCH 4/6] net: phy: maxio: extend PHY ID matching Andre Przywara
2026-08-03 14:59 ` Per Larsson
2026-08-04 2:49 ` Andrew Lunn
2026-08-03 10:14 ` [PATCH 5/6] arm64: dts: allwinner: a523: add EPHY 25MHz clock fanout pins Andre Przywara
2026-08-03 10:14 ` [PATCH 6/6] arm64: dts: allwinner: a523: x96qpro+: enable Ethernet support Andre Przywara
2026-08-04 2:53 ` Andrew Lunn
2026-08-04 3:11 ` Chen-Yu Tsai
2026-08-04 14:44 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4d855daa-a426-4f46-985c-181e3b0eb7f1@lunn.ch \
--to=andrew@lunn.ch \
--cc=andre.przywara@arm.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=liucj1228@outlook.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).