From patchwork Wed Jan 7 15:04:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 5585041 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27BE8BF6C3 for ; Wed, 7 Jan 2015 15:04:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62F8720219 for ; Wed, 7 Jan 2015 15:04:55 +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 76B1220103 for ; Wed, 7 Jan 2015 15:04:54 +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 1Y8sA2-0000E2-7E; Wed, 07 Jan 2015 15:04:38 +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 1Y8sA0-00006C-I1 for ath10k@lists.infradead.org; Wed, 07 Jan 2015 15:04:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1420643076; x=1452179076; h=subject:to:from:cc:date:message-id:mime-version: content-transfer-encoding; bh=a21SDdLWgLglKiBdXyhTCsxPi94i+THxcwn9tqzUlS8=; b=ayqBvAk7MIRSkXNyhWILO7a5GWTjngYlgLnKSagSWESAWm4W59pcDPO+ BCwmpCBPt6BRW6jiEtgjcmg+1mn/Lkmu2h7oBcH47VkaCo6LlHTVZ8qLg nDhLNI+PHkCzisx78/xgXxB16TRZX35IHg7TnzhK0Kpy7KgB9lYhyy8Wx w=; X-IronPort-AV: E=McAfee;i="5600,1067,7673"; a="81131314" Received: from ironmsg03-lv.qualcomm.com ([10.47.202.181]) by sabertooth01.qualcomm.com with ESMTP; 07 Jan 2015 07:04:15 -0800 X-IronPort-AV: E=Sophos;i="5.07,714,1413270000"; d="scan'208";a="25657363" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg03-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 07 Jan 2015 07:04:15 -0800 Received: from potku.adurom.net (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.995.29; Wed, 7 Jan 2015 07:04:13 -0800 Subject: [PATCH v2] ath10k: fix build error when hwmon is off To: From: Kalle Valo Date: Wed, 7 Jan 2015 17:04:10 +0200 Message-ID: <20150107150410.17433.49263.stgit@potku.adurom.net> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01D.na.qualcomm.com (10.85.0.84) To NALASEXR01G.na.qualcomm.com (10.49.56.53) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150107_070436_692271_74E90E00 X-CRM114-Status: UNSURE ( 8.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org 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 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 --- drivers/net/wireless/ath/ath10k/thermal.c | 5 +++++ 1 file changed, 5 insertions(+) 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);