Message ID | 20230705204521.90050-3-paul@crapouillou.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2137385vqx; Wed, 5 Jul 2023 14:08:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGimtqK9f6AcBoWyGZFGfKrC1OYWVDeAtrsQ8Pwc4HTZR/PU3jhP1IlkmmseylLk/1HebRt X-Received: by 2002:a05:6a00:13a0:b0:67a:39c4:5bb5 with SMTP id t32-20020a056a0013a000b0067a39c45bb5mr57972pfg.6.1688591308103; Wed, 05 Jul 2023 14:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688591308; cv=none; d=google.com; s=arc-20160816; b=nJ7CqOOW83YJYLpBuJ328d4pzb7QpGMQlj3a5KSLp/aETz9dc4rsUSIhqfbqr4DwMc wepyuLGwUr8iFjYSTzqfMsTQdzCvDmzZayexF1VQ1eHzZqzjV/gwqtmbh4CIpbBrUEy8 1Om93oX53Ek9RyLBBeIFbVZHztfEsXXK9Uyq6eBPhkRsnppfpieBV5pU6NhBh6F3jjIi vagBKoocp6iKboAw7rkbBWClQM9JQnLtbYOuAcH63miKFSFl38DHwuyLw/FBy8UiV3Qr T5q3yjt45KhgJ8ag6JFF+KSvGLEhZAeqLEJd2DHinuvfdCySPsQ65OravHzePFJslYen 8Q9w== 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=RMl1CB7KdyEhHlpEHafgokzS+QMO3/fE/82QsValVgI=; fh=64ZjH2kZpB/hdCAgfNtZX3C5fs0RNRan1kRR8jKZkT0=; b=Ma2Q4f2JfJVhUolY5/cYNL3HhcqR5T2VymgIsby027mkBLXTfqU1PUdSOxaJj6d7bH C92Iut7GrCjs1JFJPtjf5kuoKZnKHa0lo9W70qmxE6+1Rv4tJ9Sxp4g+DAgWXIES7m5j c8U0bfjwVvuqcBYW9VXOIgVrUMNQsMMNlVGU5VudzjTkhH8gQDxpFwElikEsJPqiz6K3 0ljc4FMOOLr+pLlFbOSP/OsewHTv1dBSMf/vKUX8fpcOr1DQApZ9FWQJ8BbmobQuvjDD hHlg1unbuCMRYM00fk0IFWI+NEn0B6TFNVp7snOszXr9KEwvMcFcYFaeL1Uaj0vKw+eX dhAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=AF24zq2r; 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 z4-20020aa79584000000b006825e062715si12376308pfj.228.2023.07.05.14.08.10; Wed, 05 Jul 2023 14:08:28 -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=AF24zq2r; 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 S232395AbjGEUtN (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 16:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbjGEUtG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 16:49:06 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31A21BCC; Wed, 5 Jul 2023 13:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RMl1CB7KdyEhHlpEHafgokzS+QMO3/fE/82QsValVgI=; b=AF24zq2riPX6NCM1Kzapnb8KDCFgwaBgEYyWkKQAcPVGP8AQxMDYmwdDIyMB/NyBK6gaSv 6SzKs94K1iPDXWYg7DQV6svk/IikfIClckRuE03RTit9Gdr0CoKC/xJMpyVFaT+GDKB9A8 tm9dlVfqAnxv6zJQmYRJdug8zl5ZvfE= From: Paul Cercueil <paul@crapouillou.net> To: Wolfram Sang <wsa@kernel.org> Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net>, Wolfram Sang <wsa+renesas@sang-engineering.com>, linux-renesas-soc@vger.kernel.org Subject: [PATCH 21/23] i2c: sh-mobile: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:45:19 +0200 Message-Id: <20230705204521.90050-3-paul@crapouillou.net> In-Reply-To: <20230705204521.90050-1-paul@crapouillou.net> References: <20230705204314.89800-1-paul@crapouillou.net> <20230705204521.90050-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes 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, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1770616319537374332?= X-GMAIL-MSGID: =?utf-8?q?1770616319537374332?= |
Series |
i2c: Use new PM macros
|
|
Commit Message
Paul Cercueil
July 5, 2023, 8:45 p.m. UTC
Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are 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>
---
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org
---
drivers/i2c/busses/i2c-sh_mobile.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
Comments
On Wed, 5 Jul 2023 22:45:19 +0200 Paul Cercueil <paul@crapouillou.net> wrote: > Use the new PM macros for the suspend and resume functions to be > automatically dropped by the compiler when CONFIG_PM or > CONFIG_PM_SLEEP are 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> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
On Wed, Jul 5, 2023 at 10:49 PM Paul Cercueil <paul@crapouillou.net> wrote: > Use the new PM macros for the suspend and resume functions to be > automatically dropped by the compiler when CONFIG_PM or > CONFIG_PM_SLEEP are 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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 21717b943a9e..324407196a10 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -965,7 +965,6 @@ static void sh_mobile_i2c_remove(struct platform_device *dev) pm_runtime_disable(&dev->dev); } -#ifdef CONFIG_PM_SLEEP static int sh_mobile_i2c_suspend(struct device *dev) { struct sh_mobile_i2c_data *pd = dev_get_drvdata(dev); @@ -983,20 +982,15 @@ static int sh_mobile_i2c_resume(struct device *dev) } static const struct dev_pm_ops sh_mobile_i2c_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_mobile_i2c_suspend, - sh_mobile_i2c_resume) + NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_mobile_i2c_suspend, + sh_mobile_i2c_resume) }; -#define DEV_PM_OPS (&sh_mobile_i2c_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ - static struct platform_driver sh_mobile_i2c_driver = { .driver = { .name = "i2c-sh_mobile", .of_match_table = sh_mobile_i2c_dt_ids, - .pm = DEV_PM_OPS, + .pm = pm_sleep_ptr(&sh_mobile_i2c_pm_ops), }, .probe = sh_mobile_i2c_probe, .remove_new = sh_mobile_i2c_remove,