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: 5585001 Return-Path: X-Original-To: patchwork-linux-wireless@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 1BE17BF6C3 for ; Wed, 7 Jan 2015 15:04:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 032222026F for ; Wed, 7 Jan 2015 15:04:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CB4B20103 for ; Wed, 7 Jan 2015 15:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752425AbbAGPEQ (ORCPT ); Wed, 7 Jan 2015 10:04:16 -0500 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:38321 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbbAGPEQ (ORCPT ); Wed, 7 Jan 2015 10:04:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1420643055; x=1452179055; h=subject:to:from:cc:date:message-id:mime-version: content-transfer-encoding; bh=a21SDdLWgLglKiBdXyhTCsxPi94i+THxcwn9tqzUlS8=; b=Ah4W6leRwKLZv8ohc2oZQa+L/RRKDeuVzITgW4QvQp+Iutm/1xPcNhyS L7HZJ8IC534MzFT7UlWcDGUUoFQNfZRVWkctEXypDr1sNORp0utfsJQfC Hnn9aJLPmsNRzQAf1jZ87/R5bN617RUX6pt6LjV0kw3LVkjOH2uJp3S40 U=; X-IronPort-AV: E=McAfee;i="5600,1067,7673"; a="81891923" Received: from ironmsg03-lv.qualcomm.com ([10.47.202.181]) by sabertooth02.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 CC: 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) 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 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(+) -- 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 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);