[PATCH 05/13] net: fm: call dtsec_init_phy() only when it is defined

Simon Glass sjg at chromium.org
Thu Aug 29 16:04:54 CEST 2024


Hi Jerome,

On Wed, 28 Aug 2024 at 06:11, Jerome Forissier
<jerome.forissier at linaro.org> wrote:
>
> dtsec_init_phy() is defined only with MII so add the proper conditional
> in the caller code.
>
> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
> ---
>  drivers/net/fm/eth.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
> index 19f3f0fef0..e4ec769693 100644
> --- a/drivers/net/fm/eth.c
> +++ b/drivers/net/fm/eth.c
> @@ -701,8 +701,10 @@ static int init_phy(struct fm_eth *fm_eth)
>                 supported |= SUPPORTED_2500baseX_Full;
>  #endif
>
> +#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) && !defined(BITBANGMII)
>         if (fm_eth->type == FM_ETH_1G_E)
>                 dtsec_init_phy(fm_eth);
> +#endif

We really want to avoid #ifdefs in the code as they create different
build paths. Can you use if (IS_ENABLED) ? Also BITBANGMII seems liike
it needs a CONFIG_ prefix.

>
>  #ifdef CONFIG_PHYLIB
>  #ifdef CONFIG_DM_MDIO
> --
> 2.40.1
>

Regards,
Simon


More information about the U-Boot mailing list