Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp265112rwn; Wed, 14 Sep 2022 20:31:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6DEp8uQEToYi/jG3hmipP6GcIcfc18QGaUkw9+cOmgXJFW8/EdY+gD4Y2a4O11Wp0KKf// X-Received: by 2002:a17:907:1dd7:b0:771:7257:2a06 with SMTP id og23-20020a1709071dd700b0077172572a06mr25544046ejc.319.1663212687969; Wed, 14 Sep 2022 20:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663212687; cv=none; d=google.com; s=arc-20160816; b=OUradGqA1qePN64VV0qbYjIc5vmbb0K0zQ+uFNUF1QJPoCRi8F+bOwpkdFDjKWO9hX EcC2VFVXoMlMCe0Z9DIjKi3+l2QxKkAXusb7UQ5amwetMhAvcnTMf7WYT7GaAEyurEr/ msUl5NUhBNt4Bl/jRJ0lMm/0jb/FWIqYS53vRg3kuzXuph79BanAqIDgSzrxjGneu4Qd jK8YPv7aBDhaZLJr1GlA2J83Dm05h45/h56hB57+cRetM5kylYnCtFlClzysuyRairSS ZUz1egvuoqH3dLOvHIGrcRNBlypbHwb9daiEarEx8DaGjf3iDSUc4klq072yI+F8p6b1 9leQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1YMMHd/QISdB1pgXCgYzfCsiRLGOvuAcZZFqGsq+u5w=; b=05QmxAcFtFPDlLx5Fa1m7ep9thNTGAdk3Jk3d7eRjeRRjVYyFOFSkCdh28R11u6fAU nR9XFHMRNGdVRcWGr1oZKu3fhRJLqveFiJ9TgoOnSyA/1o6eg6dm7bAJkeJ2cI3v/uDJ R/6O821eJWUE1lhCKLVtithnyd3g7HsPp+jMBVxwuUkyt7mUuI6Kv7CvQr/s+oM+4lZJ fUPvNlLBQQk8eaRTTS+DBqdp0WCikQKGNf2u3I+WHzXvsYP/eg0khsZHgtwM/hzZD9wj XQSGCxPeg36MwjrPEthOd8ZxUHDS7dtYk9mtoSW3/X1RBdHWtaeXikUr8l9fD5xUp/ap 9aZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17-20020a170906975100b007709d264a08si2405844ejy.738.2022.09.14.20.30.48; Wed, 14 Sep 2022 20:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbiIODTm (ORCPT + 99 others); Wed, 14 Sep 2022 23:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiIODTj (ORCPT ); Wed, 14 Sep 2022 23:19:39 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86D76E0E1; Wed, 14 Sep 2022 20:19:37 -0700 (PDT) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MSj544vdqz14Qb9; Thu, 15 Sep 2022 11:15:36 +0800 (CST) Received: from dggpeml500008.china.huawei.com (7.185.36.147) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 15 Sep 2022 11:19:35 +0800 Received: from huawei.com (10.67.175.34) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 15 Sep 2022 11:19:34 +0800 From: Ren Zhijie To: , , CC: , , Ren Zhijie Subject: [PATCH -next] misc: microchip: pci1xxxx: Fix build error unused-function Date: Thu, 15 Sep 2022 11:16:05 +0800 Message-ID: <20220915031605.86214-1-renzhijie2@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.175.34] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_PM_SLEEP is not set, make ARCH=x86_64, will be failed, like this: drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:311:12: error: ‘pci1xxxx_gpio_resume’ defined but not used [-Werror=unused-function] static int pci1xxxx_gpio_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~ drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:295:12: error: ‘pci1xxxx_gpio_suspend’ defined but not used [-Werror=unused-function] static int pci1xxxx_gpio_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones"), add new marco DEFINE_SIMPLE_DEV_PM_OPS to fix this unused-function problem. Fixes: 4ec7ac90ff39 ("misc: microchip: pci1xxxx: Add power management functions - suspend & resume handlers.") Signed-off-by: Ren Zhijie --- drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c index 9cc771c604ed..4cd541166b0c 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c @@ -405,7 +405,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device *aux_dev, return devm_gpiochip_add_data(&aux_dev->dev, &priv->gpio, priv); } -static SIMPLE_DEV_PM_OPS(pci1xxxx_gpio_pm_ops, pci1xxxx_gpio_suspend, pci1xxxx_gpio_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pci1xxxx_gpio_pm_ops, pci1xxxx_gpio_suspend, pci1xxxx_gpio_resume); static const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = { {.name = "mchp_pci1xxxx_gp.gp_gpio"}, -- 2.17.1