Message ID | 20221023094852.8035-14-paul@crapouillou.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1554832wrr; Sun, 23 Oct 2022 03:17:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rGY70Gk8tqbzROs96/6HKMIWfO5zAakVzLyB/nIz2mmyvFUUQjg4aoOHgtzXrK2EtBdbC X-Received: by 2002:a05:6402:51a:b0:461:970e:2adc with SMTP id m26-20020a056402051a00b00461970e2adcmr3748359edv.44.1666520276413; Sun, 23 Oct 2022 03:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666520276; cv=none; d=google.com; s=arc-20160816; b=LZ8ogvu8u9IvKnHHDStdqLHv6YTbaha94Zw4fv74EG+U8MFSNNm/PSrPPGS/qsF98U 20/RcQHmOylio0xywPyphRItr+o6CATAmsNHPz4K9HO8PNmtLdjaQX88XGw3ChwcvJgv xAVoOj+C1De7sLQei++r8RQGOmPUQQiy73tqVpIOn157nOR3FwmGV/peDGG2vXazg88b PMsQc66oGy8VDP/bG3rpsXmqf71iBlTKk1RzZcj29gXi7Gq0v4zLUQ5OUxob2k8riGQu lWXrHn4CtA15PytuIqGFLJeodO6rQv7Kc8b19MoxE/IWWVa2t4bCx8iIq8frByi7qiKm cA5A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6nRVOy34FSWnz35RTkSCNiLoYnujLTUllYE1MRb8dnM=; b=QWQm3+YxhUPP1aAl6ZmW2ZUJ2gCylzyQKU2IWp18lpN8VYKKiREoaAH9d6QrdtaLkx k7Y2xmW/7CBeuHLgia6C75yAq0+ASXpES4wtjKJGeE7Tc83LS7jb5xaItJN3sHc5axuR La+sgFmAO1+kpb5nh5tqNjuAgOzsOFaIZ1v+g/7srNeIBfH0l6wjxUoO/IkuisdWsgRK PPdfVE4IjzCVpQKV02nwK2sI8+1eLFoUPiWm3cFdo5WLvSfAb3XtwGWIpTgnXL+g4Uic ZJoKD81DCs1iiwlAJ0UIqQs1VXhA4Kn1vLHURSekTURMdLdYF3ae7FbexmlvNh7If1fq Z5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=SmcZDH4K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a17090635c300b0078d4b2754b5si21807565ejb.332.2022.10.23.03.17.30; Sun, 23 Oct 2022 03:17:56 -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; dkim=pass header.i=@crapouillou.net header.s=mail header.b=SmcZDH4K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiJWJvr (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbiJWJva (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:51:30 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8626753A8 for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518550; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6nRVOy34FSWnz35RTkSCNiLoYnujLTUllYE1MRb8dnM=; b=SmcZDH4KIEEkbU/WdZKwwliQkfoxLuLba9mgknhsRQuEXpgJuvPLWt5anmkAZLG/s6HigV XvzOSTPJJTDjMOeSzW5FKq4Fl9Kd+14MFKQqiDHDClnJUSfh1plgXtw2y3p/RIWrveNnwx fwAXvG6XWJ9FvOIhaf4n407CblusWCU= From: Paul Cercueil <paul@crapouillou.net> To: Lee Jones <lee@kernel.org> Cc: linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net> Subject: [PATCH v3 13/28] mfd: sm501: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:37 +0100 Message-Id: <20221023094852.8035-14-paul@crapouillou.net> In-Reply-To: <20221023094852.8035-1-paul@crapouillou.net> References: <20221023094852.8035-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747473164942675914?= X-GMAIL-MSGID: =?utf-8?q?1747473164942675914?= |
Series |
mfd: Remove #ifdef guards for PM functions
|
|
Commit Message
Paul Cercueil
Oct. 23, 2022, 9:48 a.m. UTC
Use the new pm_sleep_ptr() macro to handle the .suspend/.resume
callbacks.
This macro allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/mfd/sm501.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 3ac4508a6742..28027982cf69 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1432,8 +1432,6 @@ static int sm501_plat_probe(struct platform_device *dev) } -#ifdef CONFIG_PM - /* power management support */ static void sm501_set_power(struct sm501_devdata *sm, int on) @@ -1509,10 +1507,6 @@ static int sm501_plat_resume(struct platform_device *pdev) return 0; } -#else -#define sm501_plat_suspend NULL -#define sm501_plat_resume NULL -#endif /* Initialisation data for PCI devices */ @@ -1714,8 +1708,8 @@ static struct platform_driver sm501_plat_driver = { }, .probe = sm501_plat_probe, .remove = sm501_plat_remove, - .suspend = sm501_plat_suspend, - .resume = sm501_plat_resume, + .suspend = pm_sleep_ptr(sm501_plat_suspend), + .resume = pm_sleep_ptr(sm501_plat_resume), }; static int __init sm501_base_init(void)