From patchwork Sat Jul 22 11:53:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 124308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp782271vqg; Sat, 22 Jul 2023 05:43:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGkIDVlo2okP452kiaBPbG5PtbFJjqJyGxHAWkFbQRnAxYRw8yCyFV9nVD1f6E9NkHU96eb X-Received: by 2002:a05:6a20:4328:b0:137:2f8f:68af with SMTP id h40-20020a056a20432800b001372f8f68afmr4151399pzk.34.1690029800158; Sat, 22 Jul 2023 05:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029800; cv=none; d=google.com; s=arc-20160816; b=ydQdkHVOBrmbLF6vTdfj7QKl+u21/SJ8hPnJYw2zNZZqWM1mlaeci+nHNBOAT2xVyJ U+AdWa7SoMp3A0MoELKm0nX2ggVLe6/vSggXHifKFpyH6FZF+dY6z8spP5qYNosg50kJ 6XrzpOs1ODFzIttz8CNg3RK/oAlgmJVi0xYBdsbMrKD/hgeSv0QqYd2826WTVeHub4mc qfHA9YV443MdnYWCBSOlugKQ8LJJGwTcYW6Tc34YgnL1k8heSQVMTskVciJwiJOok4/f LjiYjAFMXyQDKrnTRRRFOLAxCXPU5gyY6fHZ4BtBaxP1aopIdbBFylmopWbXnPH2sHbi c7IQ== 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=cDKwmBrSHDbvvXF7OyKsUvepLA1ouw+cJYaTFRNC5YE=; fh=iSUGPKZD1H97yTIxm6nxD1JBGK+lUv3CEW15VwHwpGA=; b=x0jgDDMcuy1O26KWEh9EjjjO6w7bEKYpmGYs+dT7axHL6fBTYeNJwY3VqrmgU3Qr6w tvHPWMw+Bs3k8e+4Sl63LWKgPXi5PvVzYOeNMGGEELc8cDnMMta3eMRjanPQPaairtNn qbuCVESxt3+i1YPe/QSsbHGXqVYlhbC1hzXANoCoiQtcGmYL7v/fL+WTqJWmF0FjgLG/ hNLuQKryTbJ6BcY/YQGu8taNVsHn1MYTnIzE1Ww0xwHahY4csyhgE/yKDHGO8XYC2Jl5 PGc9xiG9JcAt+4fDwbmDW9j4569N6ye/XUt91hh31u+fmPUt6lrpFAEx3tlNPkeIXpgg 3DLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="Qj/sCk8t"; 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 s18-20020a63f052000000b0054ffd92af2bsi4882466pgj.506.2023.07.22.05.43.06; Sat, 22 Jul 2023 05:43:20 -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="Qj/sCk8t"; 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 S230324AbjGVL7n (ORCPT + 99 others); Sat, 22 Jul 2023 07:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjGVL7j (ORCPT ); Sat, 22 Jul 2023 07:59:39 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A7435B7; Sat, 22 Jul 2023 04:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026803; 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=cDKwmBrSHDbvvXF7OyKsUvepLA1ouw+cJYaTFRNC5YE=; b=Qj/sCk8tyAcmh0z0+MS8uYnDQoAZWTqbFzZcVoCwBT8rDu3oWELh/AV7Lke5gA0QFl5y83 b60b5HTyzrN6GeRnwi8DjsjwqKMKL4/S9XGR8k76SztJ6SP99KrlwDhVERPspr6PFYaoGf kWDblSSNtW9txOKkzftznIk4kyYyKgg= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Geert Uytterhoeven , Wolfram Sang , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 20/22] i2c: sh-mobile: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:53:08 +0200 Message-Id: <20230722115310.27681-4-paul@crapouillou.net> In-Reply-To: <20230722115046.27323-1-paul@crapouillou.net> References: <20230722115046.27323-1-paul@crapouillou.net> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772124687511423483 X-GMAIL-MSGID: 1772124687511423483 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 Reviewed-by: Jonathan Cameron Reviewed-by: Geert Uytterhoeven --- Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org --- drivers/i2c/busses/i2c-sh_mobile.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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,