]> git.baikalelectronics.ru Git - kernel.git/commit
be2net: make hwmon interface optional
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 May 2015 21:06:45 +0000 (23:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 May 2015 20:40:04 +0000 (16:40 -0400)
commitc2cba6afcb8fc1cb5ad9d76b96b5d5f0b4d95240
treeebf24564cb144c9a60a340a20e22c05b8a83840d
parent1881cc8186a7a72f081b15cea274921e5a512825
be2net: make hwmon interface optional

The hwmon interface in the be2net driver causes a link error when
be2net is built-in while the hwmon subsystem is a loadable module:

drivers/built-in.o: In function `be_probe':
drivers/net/ethernet/emulex/benet/be_main.c:5761: undefined reference to `devm_hwmon_device_register_with_groups'

This adds a new Kconfig symbol, following the example of multiple
other drivers that have the same problem. The new CONFIG_BE2NET_HWMON
will not be available when (BE2NET=y && HWMON=m) to avoid this
problem.

We have to also mark be_hwmon_show_temp as 'static' to ensure the
compiler can optimize out all the unused code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: c1e25da666 ("be2net: Export board temperature using hwmon-sysfs interface.")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/Kconfig
drivers/net/ethernet/emulex/benet/be_main.c