netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	richardcochran@gmail.com, o.rempel@pengutronix.de,
	alok.a.tiwari@oracle.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 1/3] net: phy: micrel: Introduce lanphy_modify_page_reg
Date: Wed, 13 Aug 2025 08:31:52 +0100	[thread overview]
Message-ID: <aJw_aMhqa4M9Jy1j@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250813063044.421661-2-horatiu.vultur@microchip.com>

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.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2025-08-13  7:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  6:30 [PATCH net-next v3 0/3] net: phy: micrel: Add support for lan8842 Horatiu Vultur
2025-08-13  6:30 ` [PATCH net-next v3 1/3] net: phy: micrel: Introduce lanphy_modify_page_reg Horatiu Vultur
2025-08-13  7:31   ` Russell King (Oracle) [this message]
2025-08-14  8:04     ` Horatiu Vultur
2025-08-13  6:30 ` [PATCH net-next v3 2/3] net: phy: micrel: Replace hardcoded pages with defines Horatiu Vultur
2025-08-13  6:30 ` [PATCH net-next v3 3/3] net: phy: micrel: Add support for lan8842 Horatiu Vultur
2025-08-13 10:13 ` [PATCH net-next v3 0/3] " Horatiu Vultur

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=aJw_aMhqa4M9Jy1j@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@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;
as well as URLs for NNTP newsgroup(s).