From patchwork Wed Jul 5 20:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 13302925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3861EB64DA for ; Wed, 5 Jul 2023 20:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qty7nyA9k4swXXHbPB+fSfEhaEk3qqLkKM8k9DqARCY=; b=mw7EfiauTFGjoh +PnA18wmSmhowKJ4uck1QpjdSoBGi8136+FC4LumOcUY+6PpjFLOksTGY2Ay6s2+UzdzOzXd7s+8+ FzoFgQ0ewiH/mZxMqRYLbQ3L8Aj9o4A6kbJyXu/A5ClKqrQkcZxl7GTRiCZs7VEJLw5Epm+35RolL bKN+BEVK696RXae5NTfSHMof4yYKyrwa/zemwXO4ikjUUuhXx6xbUZbQ9aVXJh4q/HW32/Z4eDq+0 yS3R3NNU/ppbVlrjkNFoTNNbQUWrBzQMaHORBFjzd0SAbJ+NGOSieb5pSi94xTuo2CZUdrSJ1xst7 FAyTDZck+6nr5tCyvveg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qH9M5-00H34m-2t; Wed, 05 Jul 2023 20:44:05 +0000 Received: from aposti.net ([89.234.176.197]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qH9M3-00H33Y-36 for linux-arm-kernel@lists.infradead.org; Wed, 05 Jul 2023 20:44:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589820; 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=g6vjt2izK19oSi33JhUJpysHlzW8ZjJUpjtvGXmKD7c=; b=CxMzmr4y+mcbZcS8jZWQWeUlWvAe7HpbDeQrpTiL5r7NjcUDsCS8lBxODFN/Zauhx0M8dt mvqJ2p9RWo/hFNeFGhRNN26W1GdPg2NJ2MNJNxJFc1Vmu9+2uFunS6zjHynj4aA4Duu2+X tjz6gep4rn3uowpN3jPP2QK+qJLqJkI= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 07/23] i2c: exynos5: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:42:58 +0200 Message-Id: <20230705204314.89800-8-paul@crapouillou.net> In-Reply-To: <20230705204314.89800-1-paul@crapouillou.net> References: <20230705204314.89800-1-paul@crapouillou.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230705_134404_149712_55CAC0ED X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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-exynos5.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index f378cd479e55..5b201a326c13 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -892,7 +892,6 @@ static void exynos5_i2c_remove(struct platform_device *pdev) clk_unprepare(i2c->pclk); } -#ifdef CONFIG_PM_SLEEP static int exynos5_i2c_suspend_noirq(struct device *dev) { struct exynos5_i2c *i2c = dev_get_drvdata(dev); @@ -934,11 +933,10 @@ static int exynos5_i2c_resume_noirq(struct device *dev) clk_disable_unprepare(i2c->pclk); return ret; } -#endif static const struct dev_pm_ops exynos5_i2c_dev_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq, - exynos5_i2c_resume_noirq) + NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq, + exynos5_i2c_resume_noirq) }; static struct platform_driver exynos5_i2c_driver = { @@ -946,7 +944,7 @@ static struct platform_driver exynos5_i2c_driver = { .remove_new = exynos5_i2c_remove, .driver = { .name = "exynos5-hsi2c", - .pm = &exynos5_i2c_dev_pm_ops, + .pm = pm_sleep_ptr(&exynos5_i2c_dev_pm_ops), .of_match_table = exynos5_i2c_match, }, };