net: aquantia: fix undefined devm_hwmon_device_register_with_info reference
Subsystems (3)
PATCH 1/1 net: aquantia: fix undefined devm_hwmon_device_register_with_info reference
drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.o: In function `aq_drvinfo_init':
aq_drvinfo.c:(.text+0xe8): undefined reference to `devm_hwmon_device_register_with_info'
Fix it by using #if IS_REACHABLE(CONFIG_HWMON).
Reported-by Hulk Robot <[email protected]>
Signed-off-by Kefeng Wang <[email protected]>
--- drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c +5 -0
@@ -13,6 +13,7 @@#include "aq_drvinfo.h" +#if IS_REACHABLE (CONFIG_HWMON )static int aq_hwmon_read (struct device *dev,enum hwmon_sensor_types type,u32 attr,int channel,long *value) {
@@ -123,3 +124,7 @@ int aq_drvinfo_init(struct net_device *ndev) return err; } + +#else +int aq_drvinfo_init (struct net_device *ndev) {return 0 ; } +#endif
Signature · 1 line
2.20.1
From: Kefeng Wang <[email protected]>
Date: Thu, 9 May 2019 23:32:35 +0800
Quoted 7 lines
drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.o: In function `aq_drvinfo_init':
aq_drvinfo.c:(.text+0xe8): undefined reference to `devm_hwmon_device_register_with_info'Fix it by using #if
IS_REACHABLE(CONFIG_HWMON).Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>
Applied.
It's a shame there isn't a dummy inline of this helper defined when HWMON is unset.