[PATCH v1 2/2] net: phy: gmii2rgmii: Add support for phy ethernet id configuration

Michal Simek michal.simek at amd.com
Tue Jan 21 14:11:04 CET 2025



On 1/16/25 06:43, Tapio Reijonen wrote:
> When Kconfig PHY_ETHERNET_ID is set, create external PHY using via
> ethernet-phy-id driver to support using starpping resistors

typo.

> of the external PHY.
> 
> Fixes: commit a744a284e354  ("net: phy: Add support for ethernet-phy-id with gpio reset")

Not correct format.

Please look at
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n145



> Signed-off-by: Tapio Reijonen <tapio.reijonen at vaisala.com>
> ---
> 
>   drivers/net/phy/xilinx_gmii2rgmii.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> index e44b7b75bd5..1d6d204b228 100644
> --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> @@ -18,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR;
>   static int xilinxgmiitorgmii_config(struct phy_device *phydev)
>   {
>   	ofnode node = phy_get_ofnode(phydev);
> -	struct phy_device *ext_phydev;
> +	struct phy_device *ext_phydev = NULL;
>   	struct ofnode_phandle_args phandle;
>   	int ext_phyaddr = -1;
>   	int ret;
> @@ -40,8 +40,13 @@ static int xilinxgmiitorgmii_config(struct phy_device *phydev)
>   		return ret;
>   
>   	ext_phyaddr = ofnode_read_u32_default(phandle.node, "reg", -1);
> -	ext_phydev = phy_find_by_mask(phydev->bus,
> -				      1 << ext_phyaddr);
> +
> +	if (IS_ENABLED(CONFIG_PHY_ETHERNET_ID))
> +		ext_phydev = phy_connect_phy_id(phydev->bus, phydev->dev, ext_phyaddr);

Can you please stay inside 80 chars per line?

> +
> +	if (!ext_phydev)
> +		ext_phydev = phy_find_by_mask(phydev->bus,
> +					      1 << ext_phyaddr);
>   	if (!ext_phydev) {
>   		printf("%s, No external phy device found\n", __func__);
>   		return -EINVAL;

The rest looks good to me.

Thanks,
Michal


More information about the U-Boot mailing list