tg3: unconditionally select HWMON support when tg3 is enabled.
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 1 Oct 2012 15:43:49 +0000 (11:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 20:14:20 +0000 (12:14 -0800)
commit596365ec90394f937d52ad85fb674cab3d034ab3
treed2b21b13704cbda06ff8739114334ab4e1a55a9d
parent0c46d72c25ddabd39d02ce5d63fc722f59671c1d
tg3: unconditionally select HWMON support when tg3 is enabled.

commit de0a41484c47d783dd4d442914815076aa2caac2 upstream.

There is the seldom used corner case where HWMON=m at the same
time as TIGON3=y (typically randconfigs) which will cause a link
fail like:

drivers/built-in.o: In function `tg3_close':
tg3.c:(.text+0x16bd86): undefined reference to `hwmon_device_unregister'
drivers/built-in.o: In function `tg3_hwmon_open':
tg3.c:(.text+0x16fc4b): undefined reference to `hwmon_device_register'
make[1]: *** [vmlinux] Error 1

Fix it as suggested by DaveM[1] by having the Kconfig logic simply
select HWMON when TIGON3 is selected.  This gets rid of all the
extra IS_ENABLED ifdeffery in tg3.c as a side benefit.

[1] http://marc.info/?l=linux-netdev&m=134250573718151&w=2

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Chan <mchan@broadcom.com>
Reported-by: Anisse Astier <anisse@astier.eu>
Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/Kconfig
drivers/net/ethernet/broadcom/tg3.c