* [PATCH] net: aquantia: fix undefined devm_hwmon_device_register_with_info reference
@ 2019-05-09 15:32 Kefeng Wang
2019-05-09 16:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2019-05-09 15:32 UTC (permalink / raw)
To: Yana Esina, David S. Miller, netdev, linux-kernel; +Cc: Kefeng Wang, Hulk Robot
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>
---
drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
index f5a92b2a5cd6..adad6a7acabe 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c
@@ -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
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: aquantia: fix undefined devm_hwmon_device_register_with_info reference
2019-05-09 15:32 [PATCH] net: aquantia: fix undefined devm_hwmon_device_register_with_info reference Kefeng Wang
@ 2019-05-09 16:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-05-09 16:50 UTC (permalink / raw)
To: wangkefeng.wang; +Cc: yana.esina, netdev, linux-kernel, hulkci
From: Kefeng Wang <wangkefeng.wang@huawei.com>
Date: Thu, 9 May 2019 23:32:35 +0800
> 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>
Applied.
It's a shame there isn't a dummy inline of this helper defined when HWMON is unset.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-09 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 15:32 [PATCH] net: aquantia: fix undefined devm_hwmon_device_register_with_info reference Kefeng Wang
2019-05-09 16:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®