[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250814080426.7xl53jzcey6rycby@DEN-DL-M31836.microchip.com>
Date: Thu, 14 Aug 2025 10:04:26 +0200
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: <andrew@...n.ch>, <hkallweit1@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<richardcochran@...il.com>, <o.rempel@...gutronix.de>,
<alok.a.tiwari@...cle.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v3 1/3] net: phy: micrel: Introduce
lanphy_modify_page_reg
The 08/13/2025 08:31, Russell King (Oracle) wrote:
Hi Russell,
>
> On Wed, Aug 13, 2025 at 08:30:42AM +0200, Horatiu Vultur wrote:
> > +static int lanphy_modify_page_reg(struct phy_device *phydev, int page, u16 addr,
> > + u16 mask, u16 set)
> > +{
> > + int ret;
> > +
> > + phy_lock_mdio_bus(phydev);
> > + __phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL, page);
> > + __phy_write(phydev, LAN_EXT_PAGE_ACCESS_ADDRESS_DATA, addr);
> > + __phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL,
> > + (page | LAN_EXT_PAGE_ACCESS_CTRL_EP_FUNC));
> > + ret = __phy_modify_changed(phydev, LAN_EXT_PAGE_ACCESS_ADDRESS_DATA,
> > + mask, set);
> > + if (ret < 0)
> > + phydev_err(phydev, "Error: __phy_modify_changed has returned error %d\n",
> > + ret);
>
> Error: is not necessary, we have log levels.
>
> What would be useful is to print the readable version of the error, and
> it probably makes sense to do it outside of the bus lock.
>
> > +
> > + phy_unlock_mdio_bus(phydev);
>
> if (ret < 0)
> phydev_err(phydev, "__phy_modify_changed() failed: %pe\n",
> ERR_PTR(ret));
Thanks for suggestion. I will update this in the next version.
>
> Thanks.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
--
/Horatiu
Powered by blists - more mailing lists