From 7f4cf110647145ccec2da21a94401faf8a3442db Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Tue, 5 Dec 2023 15:16:26 +0100 Subject: [PATCH] samv7/sam_emac.c: fix compile error with unknown structure member chip/sam_emac.c:3754:11: error: 'struct sam_emac_s' has no member named 'phytype' 3754 | if (priv->phytype == SAMV7_PHY_KSZ8061) | ^~ make[3]: *** [Makefile:167: sam_emac.o] Error 1 Member phytype is available only if CONFIG_NETDEV_PHY_IOCTL and CONFIG_ARCH_PHY_INTERRUPT is set. Signed-off-by: Michal Lenc --- arch/arm/src/samv7/sam_emac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 00caae8ade1..74ddc64f2d9 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -3751,6 +3751,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) goto errout; } +#if defined(CONFIG_NETDEV_PHY_IOCTL) && defined(CONFIG_ARCH_PHY_INTERRUPT) if (priv->phytype == SAMV7_PHY_KSZ8061) { ret = sam_phywrite(priv, priv->phyaddr, MII_MMDCONTROL, 0x0001); @@ -3781,6 +3782,7 @@ static int sam_autonegotiate(struct sam_emac_s *priv) goto errout; } } +#endif /* Restart Auto_negotiation */