Message ID | 20221023094852.8035-28-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 s2csp1558239wrr; Sun, 23 Oct 2022 03:29:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4V+mbLtlnR1hwK3iTqkj/l9gkjyUa4JzeODDxBogxOSXP6siKFoGYYOQn5ld1WNk+9Hk9L X-Received: by 2002:a17:906:eec7:b0:733:189f:b07a with SMTP id wu7-20020a170906eec700b00733189fb07amr23396327ejb.230.1666520971176; Sun, 23 Oct 2022 03:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666520971; cv=none; d=google.com; s=arc-20160816; b=mzWuDXZNdLfJQwz0osAfl2OD1wvTeMxMARbpd6qnY0eOJnMWT+ZoHaovoFsWI7ipdv 4G65dF68AGwrjAPzKTJlA1FDlGMibex/bhTTnEuprXHAncBEgRNnsnN9lADQehTIK2B1 Iqmql5amNVnsDfEP0TB2S1UqKbYdvf/8M3+f+qOqZNB2keRmtwPie7IrX5F6Y5/Ms4Pg XRt6lGD/YHn8SWoVGGJH3Re/fLpGFAATyB1IyfoxlRyLUYzQasTfcj91vvG9Ax7q7r5q mAtuyeW5E9OAOvy1TxeTPY3ipOVBpkX5Ga0780AxXDoapJKqSPuNC0kGHGFYkBhNhw/u Ku4w== 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=FKwp4R0sM21Ivi8navoOTJy75R51wyGPAcCybh3hh04=; b=CwX+fgzGiFAP7kmWEx3+wijRWByuPlG/nI4WrsHjMEHWJk1gWBfEwcJTTfTX7yGW7I 3WMWspEJrfVs5htrolsf0ex2ITu5/hFn743DkWMhyot3+t1bUo37D7h3oSwTHTkvyD/b H3MxYW94rQie26GvRAXA3F2ONnIvqGhqFEoFZC2eKE6+Jca24l0LErx6Ecohs0lfwQBq Gxz6qVYfhf/U88mfIQeZqWL5XtA7IGHqXPiFFX3hnh9qYsjkePFLZvfwjUp8O4c27/BJ mycxNz6e4h+5qfaufc2KdFX937SfK+lxG56hBLMvpDUqZ71GWFdg2mFfH8AhJnWWxZrh 9aEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=lqSw4wxf; 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 n8-20020a05640205c800b004585e0f44fesi29149184edx.60.2022.10.23.03.29.06; Sun, 23 Oct 2022 03:29:31 -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=lqSw4wxf; 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 S230317AbiJWJzm (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbiJWJzI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:55:08 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7863931EFF for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518559; 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=FKwp4R0sM21Ivi8navoOTJy75R51wyGPAcCybh3hh04=; b=lqSw4wxfbDVH/WSNC7MHZ2lbxkvreN4X8JVR+2SW39jHRtx3syR+/ZfcjjgpzZViqWyNrV LYVRYIqXS3oRKf7OdAxD8dI3q7L1kXI1SDAtFzQB/y/Q5PdQ1mnMa1BSFfMwRo1QHPd8z7 Et6ahhV6CTUWuhmbDXKLANHKt6DlQ/s= 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 27/28] mfd: tc6393xb: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:51 +0100 Message-Id: <20221023094852.8035-28-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?1747473893928713200?= X-GMAIL-MSGID: =?utf-8?q?1747473893928713200?= |
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/tc6393xb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index aa903a31dd43..997bb8b5881d 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c @@ -813,7 +813,6 @@ static int tc6393xb_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) { struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); @@ -876,16 +875,12 @@ static int tc6393xb_resume(struct platform_device *dev) return 0; } -#else -#define tc6393xb_suspend NULL -#define tc6393xb_resume NULL -#endif static struct platform_driver tc6393xb_driver = { .probe = tc6393xb_probe, .remove = tc6393xb_remove, - .suspend = tc6393xb_suspend, - .resume = tc6393xb_resume, + .suspend = pm_sleep_ptr(tc6393xb_suspend), + .resume = pm_sleep_ptr(tc6393xb_resume), .driver = { .name = "tc6393xb",