[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yi4DMGnpiOswNiXp@lunn.ch>
Date: Sun, 13 Mar 2022 15:44:00 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Michael Walle <michael@...le.cc>
Cc: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 3/3] et: mdio: mscc-miim: add lan966x internal
phy reset support
> /* When high resolution timers aren't built-in: we can't use usleep_range() as
> @@ -157,27 +166,29 @@ static int mscc_miim_write(struct mii_bus *bus, int mii_id,
> static int mscc_miim_reset(struct mii_bus *bus)
> {
> struct mscc_miim_dev *miim = bus->priv;
> - int offset = miim->phy_reset_offset;
> - int mask = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET |
> - PHY_CFG_PHY_RESET;
> + unsigned int offset, mask;
> int ret;
>
> - if (miim->phy_regs) {
> - ret = regmap_write(miim->phy_regs, offset, 0);
> - if (ret < 0) {
> - WARN_ONCE(1, "mscc reset set error %d\n", ret);
> - return ret;
> - }
> + if (!miim->phy_regs || !miim->info)
> + return 0;
I would put the check for miim->info in the probe. Not checking the
return value from *_get_match_data() is one of the things the bots
reports and we receive patches for. You have the check, but it is
hidden away, and i doubt the bot nor the bot handlers are clever
enough to find it.
Andrew
Powered by blists - more mailing lists