Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1027323rwo; Sat, 22 Jul 2023 05:19:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmZpjLOAiwrAOih8gImofXTtRLBYLwBognUpo1b23OlUWf3y8sIttxKVHJ5XulV94EDH9W X-Received: by 2002:a05:6a20:6a03:b0:135:110c:c6e1 with SMTP id p3-20020a056a206a0300b00135110cc6e1mr5006464pzk.7.1690028372783; Sat, 22 Jul 2023 05:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690028372; cv=none; d=google.com; s=arc-20160816; b=Bx/53XMphjqSpIBh3pGI42Mcc5m0JM+nVBWDb83acmB2Ups8WpWloAXFThRB+wdzZy AcMQPLnGO+8b3apzc0NHlT9sfY9TVfpv/ZwmQIE70LBtGzYy9xG4oY/ogg4TW4jgwW7M ktXKGfm0LVx0zUwRaBVM3MDcep4SgQpBQplbMM4tJyC32itDoucBA4SOsMPzu9MBfLNE iVRN3+AApNuTrywhDUSiFOH3W2t4JmmVNhbL89x1oUtnT4tlbjebTyoxpxfjb4THU8D2 qI98uAvP7ePko+O1MTThsoHspeFVyHlupbrOl5/D05hPjmRHOdnWHOEbBremqsq2XhIh 2zOw== 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=+9XeaaVEC1cyXYS0d4SiTdkAi+xUIOZ+0BhG2UNmgjM=; fh=iSUGPKZD1H97yTIxm6nxD1JBGK+lUv3CEW15VwHwpGA=; b=OFHVSLVbmxeQczCneuyzYQ4z/UpqlRxoiJVpTfh/6B/jryJDhHFzMw/d+OIv5WIIyv 8WokBJDO/Gb0BkW7KZcPG2HlwzekhnXv9VXnglVpuYBRAKE93uOsd5NfZjwtdg8lNJGt nBGghkeQUipHHHRr1ntvZ3G/X3jKYK5+lAs9L1MoIhdE2zdviP6zB+b3dvLpht/DrRC0 RewCGrfuLiWc5FQ9ru5NfgIimegWhozGShEYvHqpRKqUwrujksOZGGjJcfBlwpoYLuRz B8Worf8ErqXIqylCmERUdanHG/WUmz8SNh8xewTEmbPzdI6c3/LRNZDmvcvkTTM7621+ DRfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=jqO8fQ87; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b0055c71f20a30si5078285pgd.753.2023.07.22.05.19.19; Sat, 22 Jul 2023 05:19:32 -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=jqO8fQ87; 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 S230233AbjGVL6u (ORCPT + 99 others); Sat, 22 Jul 2023 07:58:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbjGVL6s (ORCPT ); Sat, 22 Jul 2023 07:58:48 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E92410CB; Sat, 22 Jul 2023 04:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026800; 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=+9XeaaVEC1cyXYS0d4SiTdkAi+xUIOZ+0BhG2UNmgjM=; b=jqO8fQ87PyqM3vV4/dRoPdNrxIFNeker/7VKTRXsQ3G5WyjKD0U37ZDceK96pj8rmfsMsM J8Oe7CygRjq9jo2kPWS2i3IufEhlEUkPTADw1Z1zTPP6gA3Cjxz99DKzyPFKAfLjKjdtab 8g/Esl/uyzyosFNLCKbl/HUMRpHFi7w= 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 18/22] i2c: rcar: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:53:06 +0200 Message-Id: <20230722115310.27681-2-paul@crapouillou.net> In-Reply-To: <20230722115046.27323-1-paul@crapouillou.net> References: <20230722115046.27323-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: X-Mailing-List: linux-kernel@vger.kernel.org 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-rcar.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 2d9c37410ebd..6b7f0f27d0c3 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -1169,7 +1169,6 @@ static void rcar_i2c_remove(struct platform_device *pdev) pm_runtime_disable(dev); } -#ifdef CONFIG_PM_SLEEP static int rcar_i2c_suspend(struct device *dev) { struct rcar_i2c_priv *priv = dev_get_drvdata(dev); @@ -1187,19 +1186,14 @@ static int rcar_i2c_resume(struct device *dev) } static const struct dev_pm_ops rcar_i2c_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume) + NOIRQ_SYSTEM_SLEEP_PM_OPS(rcar_i2c_suspend, rcar_i2c_resume) }; -#define DEV_PM_OPS (&rcar_i2c_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ - static struct platform_driver rcar_i2c_driver = { .driver = { .name = "i2c-rcar", .of_match_table = rcar_i2c_dt_ids, - .pm = DEV_PM_OPS, + .pm = pm_sleep_ptr(&rcar_i2c_pm_ops), }, .probe = rcar_i2c_probe, .remove_new = rcar_i2c_remove, -- 2.40.1