Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1036438rwo; Sat, 22 Jul 2023 05:29:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGTqSqnniTMRUtGfR25ndLH4nabDUtMFhKlgoPOW8HpjrraW+q8gX5iDxrEHqavfqWT6uNt X-Received: by 2002:a05:6a00:1350:b0:65b:351a:e70a with SMTP id k16-20020a056a00135000b0065b351ae70amr3449929pfu.29.1690028971001; Sat, 22 Jul 2023 05:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690028970; cv=none; d=google.com; s=arc-20160816; b=BvjDcXszIodVX+vb0ETuI0bDm2lgFeDvP8v4eYskRSd761DGh1fIzwk9W94Fj9Bom/ GZdVxfKZJ3A67ZI6msk/D5cdC33NKt7oeaaBd2OJ9gZAoDLDQiN2WtOAU4WtXJWdogFw fG48lAl31pSjzQN9GzKWlUq7LT2GVbLyNsFgWdEpUiPG3AOipfgKE6NN74ix7TSRteDI RziESXsInArRFCeLCnyQKPsKY+iKHNxOWgh4cwGeanQusyENISRRW89Zz946Q6Abntd1 wPXybO+eMHy2ywmJYqf6shiYgQtxW0Waf4qyQB8AzJlYelxood0War9ohTFLx2tZxXqI 8YEQ== 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=JHKs86BNZHwjM0fLtaImuR1Go0Sxd0WB39LYet2MtUQ=; fh=H6UdC8WH2nDSyT+Xd0ABpk5qItFfeqWRzWrRZMvCPjI=; b=ciX3ZfwM0zLw+ueKYAM9QMc6d2m+8rPQijjl4+vltHRuVdKFKtbKqG9im8Jzh4m6Io pSTS6iMyPQTVkeH9AKK4sRRDGEdjWmuOVnRuUzCOq8DwUt7Rifgm0UZj2vyqpUtIE/J0 Ek+KBlccZcv77JpHrOdkcPYaJuMHXH4B/2yY40rBnkF27/23cdoUEOjSTgWt19dOl64a fXMMXmx4XPzeRVhfyFZmXiSpkkrd8mjYvPJWe3nQ7EtPIG2mYwKGBTILUSAJ+k0gwZ47 2y60VTRV3yoPuPKbPRH4KTc4GOQjnaqa6S2m89dnAPlt7Qj+72DgLRq6B4qaNkol1YZS YBOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=LxML2Oin; 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 z4-20020a056a00240400b0065300b42889si5021936pfh.363.2023.07.22.05.29.19; Sat, 22 Jul 2023 05:29:30 -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=LxML2Oin; 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 S229666AbjGVL7S (ORCPT + 99 others); Sat, 22 Jul 2023 07:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjGVL7Q (ORCPT ); Sat, 22 Jul 2023 07:59:16 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0360335B8; Sat, 22 Jul 2023 04:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026802; 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=JHKs86BNZHwjM0fLtaImuR1Go0Sxd0WB39LYet2MtUQ=; b=LxML2OinuNhbIbfD2R5tlk6ZMZmjzmg4dIGLgwhivd220MMVazucbw89aPc22WNvF0xMIR USEnRH5F/TDPYlhbh5O/OwEXkV9GswT5RFR8PBZF57lENs3JI+ogHgA3bsJaOitKvgZvsd J7wkwNtpO+n2K8eBltyQlQq/rUUDQCI= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 19/22] i2c: s3c2410: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:53:07 +0200 Message-Id: <20230722115310.27681-3-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-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 --- Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org --- drivers/i2c/busses/i2c-s3c2410.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 28f0e5c64f32..d23a9e7fcb48 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -1125,7 +1125,6 @@ static void s3c24xx_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&i2c->adap); } -#ifdef CONFIG_PM_SLEEP static int s3c24xx_i2c_suspend_noirq(struct device *dev) { struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); @@ -1155,26 +1154,19 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev) return 0; } -#endif -#ifdef CONFIG_PM static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(s3c24xx_i2c_suspend_noirq, - s3c24xx_i2c_resume_noirq) + NOIRQ_SYSTEM_SLEEP_PM_OPS(s3c24xx_i2c_suspend_noirq, + s3c24xx_i2c_resume_noirq) }; -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops) -#else -#define S3C24XX_DEV_PM_OPS NULL -#endif - static struct platform_driver s3c24xx_i2c_driver = { .probe = s3c24xx_i2c_probe, .remove_new = s3c24xx_i2c_remove, .id_table = s3c24xx_driver_ids, .driver = { .name = "s3c-i2c", - .pm = S3C24XX_DEV_PM_OPS, + .pm = pm_sleep_ptr(&s3c24xx_i2c_dev_pm_ops), .of_match_table = of_match_ptr(s3c24xx_i2c_match), }, }; -- 2.40.1