Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1043950rwo; Sat, 22 Jul 2023 05:36:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlEiIrYtS+NASgK8ykHopP9wp7BQo9rP5v0FZLURruAb6WqJXfaxmij7OYMZWeao4JHGMzpB X-Received: by 2002:a17:902:cec3:b0:1b8:59f0:c748 with SMTP id d3-20020a170902cec300b001b859f0c748mr4594714plg.2.1690029414848; Sat, 22 Jul 2023 05:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029414; cv=none; d=google.com; s=arc-20160816; b=XTWzzOzSA+tHdzpUN7h7ub3h3biVhzb4Jan3chQ1hgjpMIlhqSUrKL/xTMz3pFi/bk +vU6ErUZfKLTpJ19WXfeC3ZJpxQVB4ujrKvgS5zRLhXynODLgTE/2b8nLxa64MTTQn+/ OTe6E5Op5iDeFi2sRFAQVOoduOZlwZG1gCc/avy7jkcVbfTijWGSqOZi3uUctucnONSM xPLnNmfoB4NM8TwtfPVzTpWZiZM6VcEf5Dkh/akndxSyBHTvHj0XApQqKhlMUuSW3mHu by8GD1cxsPMQSMiZSJQKaDNagB/N5Tvbkbdn1Czp1s/Jj58JUtu4wafYBv61ee9Ny+NK RD1Q== 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=K1kXVJYmeYFGDk1jOMEZ/tC/buoxy4+qLy2zmLpTzDA=; fh=bjkJn10HtVIDLBN8x3sMTe0vOVBmH5MlozdGCD/oD/s=; b=gsLSWeKaU1GXubA5illtXT5W4UsNlTx+BZWCA1XfsknHu9dReNU+xE74D9XBOP9g48 dN66+1eLgYLpgj9B7bX0PiEuvU8nDAzNhF33gmuoubqjVFcfrwf01FL5BvOgTJWoMwgi zsKAjNoE4gVJBQDc9oqav37nx1zwATi7PtcIoj/rnGk+asKxuKiPpuC+QjljKEOEw2Xp qGvZF0lsFzw9gxURC/PqEHFrfbBJBkhAXmEJ19MZ+HurbdHhC/WrPR5MuxzQWaxX6Kfr HFqSjnA14iUalapH4NBg3gf2Z6In0MuyU4ViGxhq1oudY2wYAD/Rw3uQ7lpOU7mKB3/L JU4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="i1/AC2mE"; 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 l9-20020a170903120900b001b5589848absi5239020plh.234.2023.07.22.05.36.41; Sat, 22 Jul 2023 05:36:54 -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="i1/AC2mE"; 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 S230162AbjGVL6J (ORCPT + 99 others); Sat, 22 Jul 2023 07:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbjGVL6H (ORCPT ); Sat, 22 Jul 2023 07:58:07 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0CB185; Sat, 22 Jul 2023 04:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026686; 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=K1kXVJYmeYFGDk1jOMEZ/tC/buoxy4+qLy2zmLpTzDA=; b=i1/AC2mEsJ/+3v8VXsJj7b5qxQCSPhPpXMsSkM1WKYcx/atu7FEWHrwJbkbJNaNLmwr4Fn wOoS3UGuAPu5rJgo+8dp6VZuOXjy9xKcryvGL6RT2QaTe5DYNE4zHDdOUTERRhqGerOTfA EqLGbBpljEoTA9PVM7+7rzf1WRXJ5RU= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron Subject: [PATCH v2 16/22] i2c: pxa: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:40 +0200 Message-Id: <20230722115046.27323-17-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. Note that the behaviour is slightly different than before; the original code wrapped the suspend/resume with #ifdef CONFIG_PM guards, which resulted in these functions being compiled in but never used when CONFIG_PM_SLEEP was disabled. Now, those functions are only compiled in when CONFIG_PM_SLEEP is enabled. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron --- drivers/i2c/busses/i2c-pxa.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 937f7eebe906..65a18d73be5c 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -1491,7 +1491,6 @@ static void i2c_pxa_remove(struct platform_device *dev) clk_disable_unprepare(i2c->clk); } -#ifdef CONFIG_PM static int i2c_pxa_suspend_noirq(struct device *dev) { struct pxa_i2c *i2c = dev_get_drvdata(dev); @@ -1516,17 +1515,12 @@ static const struct dev_pm_ops i2c_pxa_dev_pm_ops = { .resume_noirq = i2c_pxa_resume_noirq, }; -#define I2C_PXA_DEV_PM_OPS (&i2c_pxa_dev_pm_ops) -#else -#define I2C_PXA_DEV_PM_OPS NULL -#endif - static struct platform_driver i2c_pxa_driver = { .probe = i2c_pxa_probe, .remove_new = i2c_pxa_remove, .driver = { .name = "pxa2xx-i2c", - .pm = I2C_PXA_DEV_PM_OPS, + .pm = pm_sleep_ptr(&i2c_pxa_dev_pm_ops), .of_match_table = i2c_pxa_dt_ids, }, .id_table = i2c_pxa_id_table, -- 2.40.1