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: 5538811 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 878B2BEEA8 for ; Wed, 24 Dec 2014 11:25:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 673AD201D3 for ; Wed, 24 Dec 2014 11:24:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69A7F201CD for ; Wed, 24 Dec 2014 11:24:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y3k3a-0002kp-A4; Wed, 24 Dec 2014 11:24:46 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y3k3Y-0002k3-Cb for ath10k@lists.infradead.org; Wed, 24 Dec 2014 11:24:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1419420284; x=1450956284; h=from:to:cc:subject:date:message-id:mime-version; bh=3Y5Can3dFG64qrFm+As81a7Tk14+6sbYA0HFO4LMW4c=; b=cVQHwoipk+FkYaJP74coHEgbUa46cgsY5kkDoseY939EloGTq58g8W9N RFvwoHOKXBwunP1cLYY/ycLFPVeyWDKSNAEQNOl9JcT8Dk1LrRr+Qp7Ek 8sJnETyC6cpAcMkGdpORjCjfaPJqBsZEBJg5BQwzvhldFVk3Rn2CNpZdW 4=; X-IronPort-AV: E=McAfee;i="5600,1067,7661"; a="80556846" Received: from ironmsg01-lv.qualcomm.com ([10.47.202.180]) by sabertooth01.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: 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141224_032444_492051_BCD1DD02 X-CRM114-Status: GOOD ( 10.39 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, Rajkumar Manoharan X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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_ */