From patchwork Tue Jan 4 13:53:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 12703497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 805B6C433F5 for ; Tue, 4 Jan 2022 13:54:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231428AbiADNyG (ORCPT ); Tue, 4 Jan 2022 08:54:06 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:17325 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233881AbiADNyF (ORCPT ); Tue, 4 Jan 2022 08:54:05 -0500 Received: from canpemm500007.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JSvFn6Trrz9rwF; Tue, 4 Jan 2022 21:53:01 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 4 Jan 2022 21:54:03 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH -next] hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n Date: Tue, 4 Jan 2022 21:53:28 +0800 Message-ID: <20220104135328.604-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org drivers/hwmon/nzxt-smart2.c:707:12: error: 'nzxt_smart2_hid_reset_resume' defined but not used [-Werror=unused-function] 707 | static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Move it into #ifdef block to fix this. Fixes: 0e43f31ee52f ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.") Signed-off-by: YueHaibing --- drivers/hwmon/nzxt-smart2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c index 534d39b8908e..4963d630394a 100644 --- a/drivers/hwmon/nzxt-smart2.c +++ b/drivers/hwmon/nzxt-smart2.c @@ -704,6 +704,7 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev, return 0; } +#ifdef CONFIG_PM static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev) { struct drvdata *drvdata = hid_get_drvdata(hdev); @@ -720,6 +721,7 @@ static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev) return init_device(drvdata, drvdata->update_interval); } +#endif static int nzxt_smart2_hid_probe(struct hid_device *hdev, const struct hid_device_id *id)