Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29581657rwd; Wed, 5 Jul 2023 14:12:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEIZg7NJOKwH7Xua0Z1cLRttCdIcrsB/cdK9Z5ewZnoXDEYjAAhaHjecRdAQ32yBn/AzeMU X-Received: by 2002:a05:6a20:8e14:b0:11d:1b15:4d28 with SMTP id y20-20020a056a208e1400b0011d1b154d28mr448164pzj.4.1688591571882; Wed, 05 Jul 2023 14:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688591571; cv=none; d=google.com; s=arc-20160816; b=Jz07ZuhQOjhXlSXjegIAUYNqv1Li8iG9DXLBtQMOMErThLkEoWgZqIcVOL2QY4LvJW YO8cf3jTDoxLOpM0NOoLevZyMaOtwYrSRisVImAH6hNs8+SQqLLZ16J5FY4AbdBDS1Bo 2r9TXQbFlOeEbJ+DIzxYC3JPWXGT4+jwjXM7JS30SJCX1hNzFMefExatVVKmqangOToF PkmDB7IXqT5KGq3P3RA3xqADIJW0LJlDFPDPw3y1fhoU8rXUVMNXxQbI6w0f1SoEV5bT nUoOH76RzHcNSOBOmVvBQmP41TG9OusWP0e1xL/STsohFLBnDsTIKD132jwMsWyJARih tP6Q== 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=8c7jTkEU88lEi6fv0iM1MMw6JdY9CeSY5L29Egt6b1A=; fh=fR5/VcV2ao3Owhxob1GcTDl3VhD8MzLmMkWwK6kQjyw=; b=QoyEyyCU8HvMnMofKOHyG/lWN+VasJpuven4wO1DhqM+ujIw290/dQLD8okyW9fiq7 zveYrSnJ3cn5Bsz3wO2i0vyjAOUmn8bEdG8/o2j8spTQtqDc3fQm2EEaQqbxH/1KfSN4 O75YB7N1m47w7BtDb0RLWgB1ffI85JSyXPAQ+Gt5FsdYIKszk2y2cHI09t+bbfH+1neO enWAI21xgOq0DsLoiuBSTk3ZkiuCx10ynpwm+EVpjg04zSh4JjSqiVIzWkDDntyPQRBC DHlQwhiEMae7NJx6BYh2CizjXpXOtuiocBh4n09aIc4XFPOs5D3HNCvZhkAZGJsK3BdT 2TMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=L+0FajBG; 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 o133-20020a62cd8b000000b006686d07f4b6si22090326pfg.327.2023.07.05.14.12.36; Wed, 05 Jul 2023 14:12:51 -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=L+0FajBG; 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 S233917AbjGEUpz (ORCPT + 99 others); Wed, 5 Jul 2023 16:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233961AbjGEUpr (ORCPT ); Wed, 5 Jul 2023 16:45:47 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2665119AA; Wed, 5 Jul 2023 13:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589821; 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=8c7jTkEU88lEi6fv0iM1MMw6JdY9CeSY5L29Egt6b1A=; b=L+0FajBG1zP9IyIZnPhZNyeEF2VvieClOQI9AVyx04NPX+M3U2R22bkmPJ8/1R20jIZwVa KRImFiJGY5YN+q/XDOpuP0ij+CgVqvJvc8NhtdvDGm4Mkafni7TGAUNjuvZFRxGz3fEkGp Dfr44XfIsUuoVJO1/dQ0XKLv/N8icFs= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 08/23] i2c: hix5hd2: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:42:59 +0200 Message-Id: <20230705204314.89800-9-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-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 this driver should probably use the DEFINE_RUNTIME_DEV_PM_OPS() macro, which would allow the devices to be runtime-suspended on system suspend. Signed-off-by: Paul Cercueil --- drivers/i2c/busses/i2c-hix5hd2.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c index 784a5f56eb76..8e75515c3ca4 100644 --- a/drivers/i2c/busses/i2c-hix5hd2.c +++ b/drivers/i2c/busses/i2c-hix5hd2.c @@ -475,7 +475,6 @@ static void hix5hd2_i2c_remove(struct platform_device *pdev) pm_runtime_set_suspended(priv->dev); } -#ifdef CONFIG_PM static int hix5hd2_i2c_runtime_suspend(struct device *dev) { struct hix5hd2_i2c_priv *priv = dev_get_drvdata(dev); @@ -494,12 +493,11 @@ static int hix5hd2_i2c_runtime_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops hix5hd2_i2c_pm_ops = { - SET_RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, - hix5hd2_i2c_runtime_resume, - NULL) + RUNTIME_PM_OPS(hix5hd2_i2c_runtime_suspend, + hix5hd2_i2c_runtime_resume, + NULL) }; static const struct of_device_id hix5hd2_i2c_match[] = { @@ -513,7 +511,7 @@ static struct platform_driver hix5hd2_i2c_driver = { .remove_new = hix5hd2_i2c_remove, .driver = { .name = "hix5hd2-i2c", - .pm = &hix5hd2_i2c_pm_ops, + .pm = pm_ptr(&hix5hd2_i2c_pm_ops), .of_match_table = hix5hd2_i2c_match, }, }; -- 2.40.1