net: aquantia: fix undefined devm_hwmon_device_register_with_info reference
authorKefeng Wang <wangkefeng.wang@huawei.com>
Thu, 9 May 2019 15:32:35 +0000 (23:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 May 2019 16:48:44 +0000 (09:48 -0700)
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 <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c

index f5a92b2a5cd62f60ac6f519b4c157b458703452e..adad6a7acabeacafd9bcd16933ebc5a4bf28bb10 100644 (file)
@@ -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