On 9/3/24 10:38, Jerome Forissier wrote:
> dtsec_init_phy() is defined only with MII so add the proper conditional
> in the caller code.
> 
> Signed-off-by: Jerome Forissier <jerome.foriss...@linaro.org>
> Reviewed-by: Peter Robinson <pbrobin...@gmail.com>
> ---
>  drivers/net/fm/eth.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
> index 19f3f0fef07..22025b6a273 100644
> --- a/drivers/net/fm/eth.c
> +++ b/drivers/net/fm/eth.c
> @@ -26,7 +26,8 @@
>  
>  #include "fm.h"
>  
> -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) && !defined(BITBANGMII)
> +#if ((defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) && \
> +     !defined(CONFIG_BITBANGMII))
>  
>  #define TBIANA_SETTINGS (TBIANA_ASYMMETRIC_PAUSE | TBIANA_SYMMETRIC_PAUSE | \
>                        TBIANA_FULL_DUPLEX)
> @@ -701,8 +702,11 @@ static int init_phy(struct fm_eth *fm_eth)
>               supported |= SUPPORTED_2500baseX_Full;
>  #endif
>  
> -     if (fm_eth->type == FM_ETH_1G_E)
> -             dtsec_init_phy(fm_eth);
> +     if ((IS_ENABLED(CONFIG_MII) || IS_ENABLED(CONFIG_CMD_MII)) &&
> +         !IS_ENABLED(CONFIG_BITBANGMII)) {
> +             if (fm_eth->type == FM_ETH_1G_E)
> +                     dtsec_init_phy(fm_eth);
> +     }

That doesn't work:

$ make -s ls1043ardb_tfa_defconfig
$ make -j$(nproc) CROSS_COMPILE="ccache aarch64-linux-gnu-"
[...]
drivers/net/fm/eth.c: In function 'init_phy':
drivers/net/fm/eth.c:708:25: error: implicit declaration of function 
'dtsec_init_phy' [-Werror=implicit-function-declaration]
  708 |                         dtsec_init_phy(fm_eth);
      |                         ^~~~~~~~~~~~~~
[...]

I will use #if CONFIG_IS_ENABLED(XXX) in v4.

Regards,
-- 
Jerome

  
>  #ifdef CONFIG_PHYLIB
>  #ifdef CONFIG_DM_MDIO

Reply via email to