Message ID | 20221023094852.8035-19-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 s2csp1565475wrr; Sun, 23 Oct 2022 03:58:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ssiVMHYiseu7K0C9j/ZFoJKhp/uB0Kmgy3e9NNE4qfSQ95jM9AzGme6x3PWSTrlPNoYNx X-Received: by 2002:a63:480e:0:b0:46e:b96c:4f89 with SMTP id v14-20020a63480e000000b0046eb96c4f89mr10193668pga.201.1666522723940; Sun, 23 Oct 2022 03:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522723; cv=none; d=google.com; s=arc-20160816; b=B5GHqNgbRJoXfxGbU/s5ATZNrpkpCaypuC2lutUxpdXoU3wznVaDViUMIlY1n3XuLI 3q1QxR/z+sAXUWiUC3J6V6g82QD1NESR3rplTL0nPf3KQgudHV21GpNTQWpjRAtrgj6r K9/OUA3xUKuPzRFhuH05kvEfvOTDe736Hbk58PEp3NbN1ldutjTevRhi+sHZaf1uodFB 4q47hyqH7NDl+YDGXbILlV/wt6p8F8CNitXYrrLLoVKHiMh/8jKlg+ehh5HkuGuZJZnt 4f0SYtDEnkHlVOU49PU4vETusLPviZo36466Fuot/ahmgufW5mCplzSlVNtSPM0Ukldk kzlw== 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=br301fRK+XR8bCfkYexTo4vtYjSJhFPTzOjfRomSgPs=; b=t/yOhMg0O1jFqa317gOYT5YtVmut3v+CMRi4rxVAoGKXncqVQsX2bksl/76pfpvBz1 amwyKCzKYwJ9eNpBez2AgBCYA6sqtJgkr5RH9O/MWg+52JHsAhbLsVZatrBm40SWOfHf gzm0ftZ7fzhfmBxocONEUGrHGN6hYa08mOGUwLosJG8mJh4g9NC51E5T2pK4UyLzU0TG q/gbFOREzl4whehYOR5Cz+H3n7Swz8zISha2m+aQnMVgfTrN5jEByQcO3LpIw/sCpG51 t/+zm5xMpETv4eyrEjCJVKaK1DS0gmWOnFDTOWf/PQWA5fu6k8lwM8/hV8foH18okIDx e+FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=FN+w4sbg; 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 13-20020a63134d000000b0045cfaf0bad5si8092746pgt.476.2022.10.23.03.58.30; Sun, 23 Oct 2022 03:58:43 -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=FN+w4sbg; 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 S230227AbiJWJxM (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiJWJxL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:53:11 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F314760CD for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518553; 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=br301fRK+XR8bCfkYexTo4vtYjSJhFPTzOjfRomSgPs=; b=FN+w4sbgOYuu4k6UDjmFbxK1q5s3lW9Se3QRdNx20NVbKRBt74smUJFlL4th3zWy1wCQq7 Y0Oiy/9KJpd/1iYuKvKt0f0fXgToVBOLBKF7ZIxLfqzGxaGZFWwxhdRuOvoEwMXK0jW/2C E98fsVmN1iGY64TkrbEMKYvKqJwvqSk= 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 18/28] mfd: t7l66xb: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:42 +0100 Message-Id: <20221023094852.8035-19-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?1747475731742990896?= X-GMAIL-MSGID: =?utf-8?q?1747475731742990896?= |
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/t7l66xb.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index 663ffd4b8570..1d9d1d38d068 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c @@ -257,7 +257,6 @@ static void t7l66xb_detach_irq(struct platform_device *dev) /*--------------------------------------------------------------------------*/ -#ifdef CONFIG_PM static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) { struct t7l66xb *t7l66xb = platform_get_drvdata(dev); @@ -288,10 +287,6 @@ static int t7l66xb_resume(struct platform_device *dev) return 0; } -#else -#define t7l66xb_suspend NULL -#define t7l66xb_resume NULL -#endif /*--------------------------------------------------------------------------*/ @@ -416,8 +411,8 @@ static struct platform_driver t7l66xb_platform_driver = { .driver = { .name = "t7l66xb", }, - .suspend = t7l66xb_suspend, - .resume = t7l66xb_resume, + .suspend = pm_sleep_ptr(t7l66xb_suspend), + .resume = pm_sleep_ptr(t7l66xb_resume), .probe = t7l66xb_probe, .remove = t7l66xb_remove, };