Re: [PATCH] net: lan743x: LAN743X selects FIXED_PHY to resolve a link error
From: Simon Horman
Date: Sun Feb 19 2023 - 13:23:43 EST
On Sun, Feb 19, 2023 at 10:03:21AM -0500, Tom Rix wrote:
> A rand config causes this link error
> drivers/net/ethernet/microchip/lan743x_main.o: In function `lan743x_netdev_open':
> drivers/net/ethernet/microchip/lan743x_main.c:1512: undefined reference to `fixed_phy_register'
>
> lan743x_netdev_open is controlled by LAN743X
> fixed_phy_register is controlled by FIXED_PHY
>
> So LAN743X should also select FIXED_PHY
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
Hi Tom,
I am a little confused by this.
I did manage to cook up a config with LAN743X=m and FIXED_PHY not set.
But I do not see a build failure, and I believe that is because
when FIXED_PHY is not set then a stub version of fixed_phy_register(),
defined as static inline in include/linux/phy_fixed.h, is used.
Ref: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/phy_fixed.h?h=main&id=675f176b4dcc2b75adbcea7ba0e9a649527f53bd#n42
> ---
> drivers/net/ethernet/microchip/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig
> index 24c994baad13..43ba71e82260 100644
> --- a/drivers/net/ethernet/microchip/Kconfig
> +++ b/drivers/net/ethernet/microchip/Kconfig
> @@ -47,6 +47,7 @@ config LAN743X
> depends on PCI
> depends on PTP_1588_CLOCK_OPTIONAL
> select PHYLIB
> + select FIXED_PHY
> select CRC16
> select CRC32
> help
> --
> 2.27.0
>