Message ID | 20221023094852.8035-12-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 s2csp1565783wrr; Sun, 23 Oct 2022 04:00:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44BDVgC59AtnGZi5ZflAZdzMSHriHR9Nf27u2Ly9KXWp6ZMOySinkstUNzU/sMOwOax79p X-Received: by 2002:a17:906:ee8e:b0:730:4a24:f311 with SMTP id wt14-20020a170906ee8e00b007304a24f311mr23700687ejb.420.1666522796539; Sun, 23 Oct 2022 03:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522796; cv=none; d=google.com; s=arc-20160816; b=kqTslTEPCJbsEjPEzHELdZc5AjHT+ZfCl02q2eqGRS+unty+BE2MDPU7m+oA9mffXW /Mxb6gxAKf6vRV6Cf2qKb9ZsEAkIJ/OgKld+0XpvMZVI2VbmkbABfpPt1s0AATtMuga1 qdpFobq9viMKIVkM7qzEc6JwjbF6ZpUUBgG94C9sY6CyQaNb2lFzGiqO3FDyY3YkjIkG BinfTLIdt9KMw6mnvRZW5nY1/9e4UciKldd5uHqYB1gfeCxFYHOAgbZF0LyMMwKQliuW xgG8znTvKj3BZ5uozasAczLxORfZxEn5AUI1ePndgcUkwhn1AmJJE1XN5Rmtq/I9JTkR qAtQ== 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=4kZIVuuKKO+sS/oNnpnJC3ag5t6waBzISKhOioOsnm4=; b=hKYV1xb+o6ByVGOi60hvrE627vai5aes+e/tQyUtLVziaIniF9bHOyNRmhu+6uhXTd 6Zl5RiiM55uyGT4jnKU2/QczlbZm8H0iHarES2gfxeB/HxNXIIR4zjWN/M5zDVuYzEtB iM2juKwxzWXKR4ic1gvv3AheHRqmwyoPQSuI7OStexOxBsl2LCk7p+4OUJmFTi59mnUT DtfwKkZ9WzM4vUw7pCDA4WpOlQd59sx+hRAXKfeYdI9VX2bqCYbwDRZbVKhiDjB/A/tD Pb+SbRe7VrZdRVBClxC5DoIJfPmjtefvgW2CKzTiSRx8qmLzXZAaBro3yzkNyF3laej7 2E7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="F7ZT/58j"; 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 sc11-20020a1709078a0b00b0078c9dd279b6si23547387ejc.345.2022.10.23.03.59.32; Sun, 23 Oct 2022 03:59: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="F7ZT/58j"; 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 S230187AbiJWJvb (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:51:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiJWJvH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:51:07 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 165E0564F9 for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518549; 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=4kZIVuuKKO+sS/oNnpnJC3ag5t6waBzISKhOioOsnm4=; b=F7ZT/58jdkSWGmpsKrL/S1pQ/KE/OC+iTOv51KZIWLYATApCXwIuUB+deozMGhSSoahyip BS7uSBZffafdO6/98lczYrr542NPNbegeyQO2xXtC7tcjds7i6G9qMZYtW4Dl2Is3KfRsT sN9VWAtRaEqEfE4xC1yX6xsRceeUJlE= 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 11/28] mfd: mcp-sa11x0: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:35 +0100 Message-Id: <20221023094852.8035-12-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?1747475807661760274?= X-GMAIL-MSGID: =?utf-8?q?1747475807661760274?= |
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/mcp-sa11x0.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index 4629dff187cd..1c9831b78cf9 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c @@ -255,7 +255,6 @@ static int mcp_sa11x0_remove(struct platform_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP static int mcp_sa11x0_suspend(struct device *dev) { struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev)); @@ -277,17 +276,14 @@ static int mcp_sa11x0_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops mcp_sa11x0_pm_ops = { -#ifdef CONFIG_PM_SLEEP .suspend = mcp_sa11x0_suspend, .freeze = mcp_sa11x0_suspend, .poweroff = mcp_sa11x0_suspend, .resume_noirq = mcp_sa11x0_resume, .thaw_noirq = mcp_sa11x0_resume, .restore_noirq = mcp_sa11x0_resume, -#endif }; static struct platform_driver mcp_sa11x0_driver = { @@ -295,7 +291,7 @@ static struct platform_driver mcp_sa11x0_driver = { .remove = mcp_sa11x0_remove, .driver = { .name = DRIVER_NAME, - .pm = &mcp_sa11x0_pm_ops, + .pm = pm_sleep_ptr(&mcp_sa11x0_pm_ops), }, };