From patchwork Wed Dec 24 11:24:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 5538821 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 14ADC9F1CD for ; Wed, 24 Dec 2014 11:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18AE4201D3 for ; Wed, 24 Dec 2014 11:30:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 382D6201CD for ; Wed, 24 Dec 2014 11:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751563AbaLXLYX (ORCPT ); Wed, 24 Dec 2014 06:24:23 -0500 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:28428 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbaLXLYW (ORCPT ); Wed, 24 Dec 2014 06:24:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1419420262; x=1450956262; h=from:to:cc:subject:date:message-id:mime-version; bh=3Y5Can3dFG64qrFm+As81a7Tk14+6sbYA0HFO4LMW4c=; b=P8JuxNZ9ruWuUKjzh2wwg1EhcGcpCRkB/hO6QQnVgU+ICNYA+geuqaRC 1W9VQSZrbqSg7cGqdfZHftcl/V1PkTp4GFzQhNUTFsWjp02dvzzNgpRfo AMe5w3yTU0PFqEhSqDyCfA+IFzG6bBMueSoBE46toQkHrMr1fn0bb4SQu U=; X-IronPort-AV: E=McAfee;i="5600,1067,7661"; a="81305498" Received: from ironmsg01-lv.qualcomm.com ([10.47.202.180]) by sabertooth02.qualcomm.com with ESMTP; 24 Dec 2014 03:24:20 -0800 X-IronPort-AV: E=Sophos;i="5.07,637,1413270000"; d="scan'208";a="32017109" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Dec 2014 03:24:20 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.222.112.203) by nasanexhc07.na.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 24 Dec 2014 03:24:16 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.222.112.203) with Microsoft SMTP Server (TLS) id 15.0.995.29; Wed, 24 Dec 2014 03:24:08 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 24 Dec 2014 16:54:01 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH] ath10k: fix build error when hwmon is off Date: Wed, 24 Dec 2014 16:54:00 +0530 Message-ID: <1419420240-11208-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.2.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01H.na.qualcomm.com (10.85.0.34) To aphydexm01b.ap.qualcomm.com (10.222.112.203) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Place hwmon APIs inside CONFIG_HWMON switch to fix undefined errors when hwmon is not enabled. ERROR: "devm_hwmon_device_register_with_groups" [drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined! Reported-by: Kalle Valo Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/thermal.c | 8 ++++++++ drivers/net/wireless/ath/ath10k/thermal.h | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c index d939135..7e982e4 100644 --- a/drivers/net/wireless/ath/ath10k/thermal.c +++ b/drivers/net/wireless/ath/ath10k/thermal.c @@ -121,6 +121,7 @@ static struct thermal_cooling_device_ops ath10k_thermal_ops = { .set_cur_state = ath10k_thermal_set_cur_dutycycle, }; +#ifdef CONFIG_HWMON static ssize_t ath10k_thermal_show_temp(struct device *dev, struct device_attribute *attr, char *buf) @@ -182,11 +183,14 @@ static struct attribute *ath10k_hwmon_attrs[] = { NULL, }; ATTRIBUTE_GROUPS(ath10k_hwmon); +#endif int ath10k_thermal_register(struct ath10k *ar) { struct thermal_cooling_device *cdev; +#ifdef CONFIG_HWMON struct device *hwmon_dev; +#endif int ret; cdev = thermal_cooling_device_register("ath10k_thermal", ar, @@ -207,6 +211,7 @@ int ath10k_thermal_register(struct ath10k *ar) ar->thermal.cdev = cdev; +#ifdef CONFIG_HWMON /* Do not register hwmon device when temperature reading is not * supported by firmware */ @@ -222,10 +227,13 @@ int ath10k_thermal_register(struct ath10k *ar) ret = -EINVAL; goto err_remove_link; } +#endif return 0; +#ifdef CONFIG_HWMON err_remove_link: sysfs_remove_link(&ar->dev->kobj, "thermal_sensor"); +#endif err_cooling_destroy: thermal_cooling_device_unregister(cdev); return ret; diff --git a/drivers/net/wireless/ath/ath10k/thermal.h b/drivers/net/wireless/ath/ath10k/thermal.h index bccc17a..9607e1a 100644 --- a/drivers/net/wireless/ath/ath10k/thermal.h +++ b/drivers/net/wireless/ath/ath10k/thermal.h @@ -38,7 +38,6 @@ struct ath10k_thermal { #ifdef CONFIG_THERMAL int ath10k_thermal_register(struct ath10k *ar); void ath10k_thermal_unregister(struct ath10k *ar); -void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); #else static inline int ath10k_thermal_register(struct ath10k *ar) { @@ -49,10 +48,14 @@ static inline void ath10k_thermal_unregister(struct ath10k *ar) { } +#endif /* CONFIG_THERMAL */ +#ifdef CONFIG_HWMON +void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); +#else static inline void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature) { } -#endif +#endif /* CONFIG_HWMON */ #endif /* _THERMAL_ */