Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29584434rwd; Wed, 5 Jul 2023 14:15:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlEdk7DjrVtk5L+wAVEnKDPEoqL9gEoAF/N2BnVrGoOFS3HA05gC+MuPb4VGF2HRn+oDVLRy X-Received: by 2002:a05:6358:2905:b0:134:ec26:b53 with SMTP id y5-20020a056358290500b00134ec260b53mr54500rwb.16.1688591734275; Wed, 05 Jul 2023 14:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688591734; cv=none; d=google.com; s=arc-20160816; b=m0+BsHR0ce/maq/lhqNNbRZuKKTAwd3ZUPK+1BHUoIAAhG0tnotNkIgfhljF5zXiBS vMvTT6KdTJu3CXihgRXz1kgbDMLyVgjMltSXn2Bqi2/y+jpBBS+pF1btorErwDri1TOA omRdBZK0F9fYLBi5LmeO35IX/94squRkLppjZ3nwahvBLk+geeFFMfWDu6jzijx9PJU2 9PCPG6RVifYabXmKgwqyMgt5qWQlbuA/la3EFuWeWDOs9Y5Uxfd5Yu8AJ4rC5lYJVdV6 N+fSDFPja/RfKpdGAYp7Xb6yrohY+ngj76DMNbFxl2fKxazeLRnej7U9c8llloqhxbZX ctdA== 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=TdHoXj7LTtKTlBRs+Qe41S8bC2nxi1BGxlIB7qFYX9w=; fh=yuIjkQRv98wIH5LZHrEhDUcxeTb1r+QIxVn2neg/Ep4=; b=HGU8mJn8s6LkaPzXSmch9uoYfO+3tUsFTxvfDhDfQ+EY/pnVfa3B17MOqYaF5t2VL1 oqSbROUEyHsALgtXOCR1BOvU3Ue/NGZrFPJYypbx4V9ySdDnQSBrA7L4brWQCZ4J3t+Y NJgrCArlTWT9F7khb+wpTyX+l5Ao2MNuP75khljUN1f3ArQAA02q5QXTkW1Ep2fXZNdH xP7dlJO2x2bI/dEH33rZ+/W+zdqfBdM5bTGHQ3viiOAuccsVJXx8VrcTrcgBNE4P2iY3 Old0olcwLN3GoDK3JP12A5YwXaGMQaIF/FM9AhMPKS9gW5FlgBU1VQUgh5LhF1H0V0hr Kfxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=vP1jjktM; 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 g130-20020a636b88000000b00553c2f85095si22928603pgc.832.2023.07.05.14.15.19; Wed, 05 Jul 2023 14:15:34 -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=vP1jjktM; 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 S234029AbjGEUrF (ORCPT + 99 others); Wed, 5 Jul 2023 16:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbjGEUq6 (ORCPT ); Wed, 5 Jul 2023 16:46:58 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D681BDD; Wed, 5 Jul 2023 13:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589826; 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=TdHoXj7LTtKTlBRs+Qe41S8bC2nxi1BGxlIB7qFYX9w=; b=vP1jjktMDkBjUHWSYGsrjpRWCKmsEHpS2aMTIIcNJNGe6JTO196qZRBWDzdmYBcjVol7Uu yFmupHehMchlsLFmOfZff0MdvmZFdukemhU6NaiO2De/YgQZTiGIFqVfTRpensvBeWollP K/OTRACOMOfN/C1Tui1ZPppF5jmY16k= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Qii Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 13/23] i2c: mt65xx: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:43:04 +0200 Message-Id: <20230705204314.89800-14-paul@crapouillou.net> In-Reply-To: <20230705204314.89800-1-paul@crapouillou.net> References: <20230705204314.89800-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 --- Cc: Qii Wang Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org --- drivers/i2c/busses/i2c-mt65xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 7ca3f2221ba6..21cc39e35cf6 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1514,7 +1514,6 @@ static void mtk_i2c_remove(struct platform_device *pdev) clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks); } -#ifdef CONFIG_PM_SLEEP static int mtk_i2c_suspend_noirq(struct device *dev) { struct mtk_i2c *i2c = dev_get_drvdata(dev); @@ -1544,11 +1543,10 @@ static int mtk_i2c_resume_noirq(struct device *dev) return 0; } -#endif static const struct dev_pm_ops mtk_i2c_pm = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq, - mtk_i2c_resume_noirq) + NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq, + mtk_i2c_resume_noirq) }; static struct platform_driver mtk_i2c_driver = { @@ -1556,7 +1554,7 @@ static struct platform_driver mtk_i2c_driver = { .remove_new = mtk_i2c_remove, .driver = { .name = I2C_DRV_NAME, - .pm = &mtk_i2c_pm, + .pm = pm_sleep_ptr(&mtk_i2c_pm), .of_match_table = mtk_i2c_of_match, }, }; -- 2.40.1