[PATCH u-boot v2019.04-aspeed-openbmc 2/4] phy: Only create NCSI PHY when it's present

Cédric Le Goater clg at kaod.org
Fri Jun 10 18:37:12 AEST 2022


On 6/10/22 10:00, Joel Stanley wrote:
> phy_connect would unconditionally create a NCSI PHY device if the driver
> was configured.
> 
> By detecting what the phy type is at runtime we can support NCSI and
> non-NCSI system with the same defconfig,
> 
> Signed-off-by: Joel Stanley <joel at jms.id.au>

Reviewed-by: Cédric Le Goater <clg at kaod.org>


Thanks,

C.


> ---
>   drivers/net/phy/phy.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index a0f7b7964464..8e70746a1e76 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -932,7 +932,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
>   #endif
>   
>   #ifdef CONFIG_PHY_NCSI
> -	phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface);
> +	if (interface == PHY_INTERFACE_MODE_NCSI)
> +		phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface);
>   #endif
>   
>   	if (!phydev)



More information about the openbmc mailing list