Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29579125rwd; Wed, 5 Jul 2023 14:10:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKoIIymfXwjhSMaeJI9k46zaza5hNLMMSe5IYiQ7hFSbhPZVqPf5qGchEyjmKIl+NWfmN+ X-Received: by 2002:a05:6a00:80a:b0:666:a46b:63c9 with SMTP id m10-20020a056a00080a00b00666a46b63c9mr55019pfk.11.1688591423341; Wed, 05 Jul 2023 14:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688591423; cv=none; d=google.com; s=arc-20160816; b=Pm62Pw1SZPFxGngEH6IAQdp1qKIVwisWvIl/xwwvtXQ256UVHcWDXQdEl1+Zo9Bz3G aLS9/o30bKZ3OxYWkyuZGToJy0zwHqv+M/N8EEEvpZIaF/q8jb8Bex6AQG/0RXOlg0Ha wumL65AZYHHUx/LpBS/zNf/5DJHF1Go03VFwvek+GBIGAmbgGbzbCV5Uk0++ghpa5Wh3 rV8Uzsc3qt5uNrW3PgMq3OQRAML/qf/hjP4b/UiDZBf6C4paIokG5G0M1WzjkeOrBeCt BmPQfhdswhRsmotHqUk9Um67yM2wTUKhoxEQWMUhphJ9OAmC/dLQ40EtE/JNzwmxiZgt 4tjQ== 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=8r/TIahHjeBsDSNg77Nkvu33G5UAPKPXHbZW5/PxSc8=; fh=ThWFTmX7BSD1SUIQ0E9qLJFmlKze6GkRepXaLMFS6KQ=; b=g8ao5zjY318HrjiBLdkjZYyiu3jkcUx2/B8AKvj6fckenNlaWlJnuulNTz4a8bsQM3 /Z009+SCQkr4wZCnB9ptm9lwYdkEwJ+pIuc76i1q2CnkCOxIZlbWz6YP6IiUCk39+5Cv EJ831mX9xmfhjhvcBrOK5tfTqDv16sZsyl4WX8JTBL7tXoPAFOUKvMMZGdvUTAUF/dle b9+gKho1TIdI2INaMx3b0MAKqSDY1auIXeGxwuw6E/OjGFcWMKNZd7VyMg8uQ6drUhOK HrJHSEorclVavJxCF9nPJGw9sKp+SRQFwfoKUmKHoRAd4KSlZGze1N8BRKFMWzOYHhtd OOkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="hbFcV/kI"; 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 b9-20020a63d809000000b0053f8da90675si22939818pgh.598.2023.07.05.14.10.07; Wed, 05 Jul 2023 14:10:23 -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="hbFcV/kI"; 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 S233891AbjGEUo4 (ORCPT + 99 others); Wed, 5 Jul 2023 16:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233865AbjGEUox (ORCPT ); Wed, 5 Jul 2023 16:44:53 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8FEA1FE5; Wed, 5 Jul 2023 13:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589816; 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=8r/TIahHjeBsDSNg77Nkvu33G5UAPKPXHbZW5/PxSc8=; b=hbFcV/kIj81EP94njt/eVSMfq0wyMt58TW8GuSchnqadDz5mxRNrddtgy3qwdz0NbtWrcw bPr9bfen1Yss1FY0REEODW/Oxnwyq7f8UgbJOLaGPPym7xiF3iMN343CCPy1By9xkMsli/ tNKBPEsHgc4woJPmoAACyKey5gqyfb0= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Kamal Dasu , Broadcom internal kernel review list , Florian Fainelli , linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/23] i2c: brcmstb: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:42:55 +0200 Message-Id: <20230705204314.89800-5-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: Kamal Dasu Cc: Broadcom internal kernel review list Cc: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org --- drivers/i2c/busses/i2c-brcmstb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c index cf92cbcb8c86..c778bcca95fe 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -697,7 +697,6 @@ static void brcmstb_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&dev->adapter); } -#ifdef CONFIG_PM_SLEEP static int brcmstb_i2c_suspend(struct device *dev) { struct brcmstb_i2c_dev *i2c_dev = dev_get_drvdata(dev); @@ -715,10 +714,9 @@ static int brcmstb_i2c_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend, - brcmstb_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend, + brcmstb_i2c_resume); static const struct of_device_id brcmstb_i2c_of_match[] = { {.compatible = "brcm,brcmstb-i2c"}, @@ -732,7 +730,7 @@ static struct platform_driver brcmstb_i2c_driver = { .driver = { .name = "brcmstb-i2c", .of_match_table = brcmstb_i2c_of_match, - .pm = &brcmstb_i2c_pm, + .pm = pm_sleep_ptr(&brcmstb_i2c_pm), }, .probe = brcmstb_i2c_probe, .remove_new = brcmstb_i2c_remove, -- 2.40.1