Skip to content

Commit b8fb640

Browse files
nathanchancedavem330
authored andcommitted
net: mdio-octeon: Fix Kconfig warnings and build errors
After commit 171a9ba ("staging/octeon: Allow test build on !MIPS"), the following combination of configs cause a few Kconfig warnings and build errors (distilled from arm allyesconfig and Randy's randconfig builds): CONFIG_NETDEVICES=y CONFIG_STAGING=y CONFIG_COMPILE_TEST=y and CONFIG_OCTEON_ETHERNET as either a module or built-in. WARNING: unmet direct dependencies detected for MDIO_OCTEON Depends on [n]: NETDEVICES [=y] && MDIO_DEVICE [=y] && MDIO_BUS [=y] && 64BIT [=n] && HAS_IOMEM [=y] && OF_MDIO [=n] Selected by [y]: - OCTEON_ETHERNET [=y] && STAGING [=y] && (CAVIUM_OCTEON_SOC || COMPILE_TEST [=y]) && NETDEVICES [=y] In file included from ../drivers/net/phy/mdio-octeon.c:14: ../drivers/net/phy/mdio-cavium.h:111:36: error: implicit declaration of function ‘writeq’; did you mean ‘writel’? [-Werror=implicit-function-declaration] 111 | #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr) | ^~~~~~ CONFIG_64BIT is not strictly necessary if the proper readq/writeq definitions are included from io-64-nonatomic-lo-hi.h. CONFIG_OF_MDIO is not needed when CONFIG_COMPILE_TEST is enabled because of commit f9dc9ac ("of/mdio: Add dummy functions in of_mdio.h."). Fixes: 171a9ba ("staging/octeon: Allow test build on !MIPS") Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Mark Brown <broonie@kernel.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 48e2331 commit b8fb640

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/net/phy/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ config MDIO_MSCC_MIIM
172172

173173
config MDIO_OCTEON
174174
tristate "Octeon and some ThunderX SOCs MDIO buses"
175-
depends on 64BIT
176-
depends on HAS_IOMEM && OF_MDIO
175+
depends on (64BIT && OF_MDIO) || COMPILE_TEST
176+
depends on HAS_IOMEM
177177
select MDIO_CAVIUM
178178
help
179179
This module provides a driver for the Octeon and ThunderX MDIO

drivers/net/phy/mdio-cavium.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ static inline u64 oct_mdio_readq(u64 addr)
108108
return cvmx_read_csr(addr);
109109
}
110110
#else
111+
#include <linux/io-64-nonatomic-lo-hi.h>
112+
111113
#define oct_mdio_writeq(val, addr) writeq(val, (void *)addr)
112114
#define oct_mdio_readq(addr) readq((void *)addr)
113115
#endif

0 commit comments

Comments
 (0)