From: Hans-Frieder Vogt <hfdevel@gmx.net>
To: daniel@makrotopia.org
Cc: andrew@lunn.ch, ansuelsmth@gmail.com,
bartosz.golaszewski@linaro.org, davem@davemloft.net,
edumazet@google.com, hkallweit1@gmail.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, linux@armlinux.org.uk,
netdev@vger.kernel.org, pabeni@redhat.com,
quic_abchauha@quicinc.com, robimarko@gmail.com
Subject: Re: [PATCH net-next] net: phy: aquantia: fix return value check in aqr107_config_mdi()
Date: Sun, 13 Oct 2024 15:03:34 +0200 [thread overview]
Message-ID: <2ba308ae-4aba-46ff-8187-ba9a69a26e4c@gmx.net> (raw)
In-Reply-To: <3c469f3b62fe458f19dc28e005968d73392f9fa3.1728682260.git.daniel@makrotopia.org>
On Fri, 11 Oct 2024 22:33:52 +0100, Daniel Golle wrote:
> of_property_read_u32() returns -EINVAL in case the property cannot be
> found rather than -ENOENT. Fix the check to not abort probing in case
> of the property being missing.
there is another failure case, which is not properly covered:
if the system is non-device-tree, the function of_property_read_u32 returns -ENOSYS.
While you are correcting the return value, you may also correct this case.
>
> Fixes: a2e1ba275eae ("net: phy: aquantia: allow forcing order of MDI pairs")
> Reported-by: Jon Hunter <jonathanh@nvidia.com>
> Closes: https://lore.kernel.org/all/114b4c03-5d16-42ed-945d-cf78eabea12b@nvidia.com/
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/net/phy/aquantia/aquantia_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c
> index 4fe757cd7dc7..49fd21d1b3c9 100644
> --- a/drivers/net/phy/aquantia/aquantia_main.c
> +++ b/drivers/net/phy/aquantia/aquantia_main.c
> @@ -513,7 +513,7 @@ static int aqr107_config_mdi(struct phy_device *phydev)
> ret = of_property_read_u32(np, "marvell,mdi-cfg-order", &mdi_conf);
>
> /* Do nothing in case property "marvell,mdi-cfg-order" is not present */
> - if (ret == -ENOENT)
> + if (ret == -EINVAL)
the non-device-tree case could be simply covered by this:
if (ret == -EINVAL || ret == -ENOSYS)
> return 0;
>
> if (ret)
prev parent reply other threads:[~2024-10-13 13:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 21:33 Daniel Golle
2024-10-12 17:19 ` Andrew Lunn
2024-10-13 13:03 ` Hans-Frieder Vogt [this message]
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=2ba308ae-4aba-46ff-8187-ba9a69a26e4c@gmx.net \
--to=hfdevel@gmx.net \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=robimarko@gmail.com \
/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
all inboxes | Powered by JetHome®