linux-stable/drivers/nvmem
Arnd Bergmann 2a37ce25d9 nvmem: disallow modular CONFIG_NVMEM
The new of_get_nvmem_mac_address() helper function causes a link error
with CONFIG_NVMEM=m:

drivers/of/of_net.o: In function `of_get_nvmem_mac_address':
of_net.c:(.text+0x168): undefined reference to `of_nvmem_cell_get'
of_net.c:(.text+0x19c): undefined reference to `nvmem_cell_read'
of_net.c:(.text+0x1a8): undefined reference to `nvmem_cell_put'

I could not come up with a good solution for this, as the code is always
built-in. Using an #if IS_REACHABLE() check around it would solve the
link time issue but then stop it from working in that configuration.
Making of_nvmem_cell_get() an inline function could also solve that, but
seems a bit ugly since it's somewhat larger than most inline functions,
and it would just bring that problem into the callers.  Splitting the
function into a separate file might be an alternative.

This uses the big hammer by making CONFIG_NVMEM itself a 'bool' symbol,
which avoids the problem entirely but makes the vmlinux larger for anyone
that might use NVMEM support but doesn't need it built-in otherwise.

Fixes: 9217e566bd ("of_net: Implement of_get_nvmem_mac_address helper")
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mike Looijmans
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-04 11:47:50 -04:00
..
bcm-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
core.c nvmem: core: switch to device_property_present for reading property "read-only" 2017-12-19 10:39:33 +01:00
imx-iim.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
imx-ocotp.c nvmem: imx-ocotp: Update module description 2017-11-08 14:19:06 +01:00
Kconfig nvmem: disallow modular CONFIG_NVMEM 2018-04-04 11:47:50 -04:00
lpc18xx_eeprom.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
lpc18xx_otp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
Makefile Char/Misc patches for 4.15-rc1 2017-11-16 09:10:59 -08:00
meson-efuse.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
meson-mx-efuse.c nvmem: meson-mx-efuse: fix reading from an offset other than 0 2017-12-23 16:46:23 +01:00
mtk-efuse.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
mxs-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
qfprom.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00
rockchip-efuse.c nvmem: rockchip-efuse: add support for rk3328-efuse 2017-12-19 10:39:33 +01:00
snvs_lpgpr.c nvmem: add snvs_lpgpr driver 2017-10-04 10:30:53 +02:00
sunxi_sid.c nvmem: sunxi-sid: add support for A64/H5's SID controller 2017-11-08 14:19:06 +01:00
uniphier-efuse.c nvmem: uniphier: change access unit from 32bit to 8bit 2017-12-19 10:39:33 +01:00
vf610-ocotp.c nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset 2017-11-08 13:54:17 +01:00