diff mbox

[v2] ath10k: fix build error when hwmon is off

Message ID 20150107150410.17433.49263.stgit@potku.adurom.net (mailing list archive)
State Not Applicable
Headers show

Commit Message

Kalle Valo Jan. 7, 2015, 3:04 p.m. UTC
kbuild reported a linking error:

ERROR: "devm_hwmon_device_register_with_groups"
[drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined!

Fix it by returning early and letting the compiler to optimise out the function
call.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/thermal.c |    5 +++++
 1 file changed, 5 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Kalle Valo Jan. 9, 2015, 4:13 p.m. UTC | #1
Kalle Valo <kvalo@qca.qualcomm.com> writes:

> kbuild reported a linking error:
>
> ERROR: "devm_hwmon_device_register_with_groups"
> [drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined!
>
> Fix it by returning early and letting the compiler to optimise out the function
> call.
>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

Applied to ath.git.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index d93913538d18..b14ae8d135f6 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -213,6 +213,11 @@  int ath10k_thermal_register(struct ath10k *ar)
 	if (ar->wmi.op_version != ATH10K_FW_WMI_OP_VERSION_10_2_4)
 		return 0;
 
+	/* Avoid linking error on devm_hwmon_device_register_with_groups, I
+	 * guess linux/hwmon.h is missing proper stubs. */
+	if (!config_enabled(HWMON))
+		return 0;
+
 	hwmon_dev = devm_hwmon_device_register_with_groups(ar->dev,
 							   "ath10k_hwmon", ar,
 							   ath10k_hwmon_groups);