Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1046634rwo; Sat, 22 Jul 2023 05:40:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlE9aGDbxbSvVikwvdWI5pzCGs63nOL5Arfu5pvCI4c5M7QsCLLdphcediValj2fas0U7EL+ X-Received: by 2002:a05:6a00:b52:b0:66c:6678:3776 with SMTP id p18-20020a056a000b5200b0066c66783776mr4504399pfo.7.1690029614894; Sat, 22 Jul 2023 05:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029614; cv=none; d=google.com; s=arc-20160816; b=zmTxsVG4WU8QEi0/rZutQ7UjvGAOH5gtNpeQOZ2m7wA8JjjMdLtlfimkr4Jr6nIczH w0NopZ+W4InwwGKZvgGdvFRmO7rVcflaWfKnivxut64W5VPLRe1N9hz89z1nOuFRvq5y V8S6DwioPD7/PLa58XYmMtXCS787PXrcCU55G0mZApl8/gp/Tt9ywEUrMpjcEQ7sA4l0 kJ5GDlPj17xT4WahQRDpvQFETw1SBHDXis/2khpBbCiu9D0VtA8oYaeqsjpOuB+OCqix YAUTmCPMIUINAiFP3r6lPfGEYeAM0c4v19vEgDTStsnhlfWVch9CdGplF1nRwf9DoF4R YH5g== 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=bxYlrsHdr45I+ipn3Yf0ygmvZr0hy5qDRd7Irwb+9mk=; fh=HVzAj1iTtpAN0haxOdrAH/iA+w+zjk6tUIe0bKOxlAQ=; b=EWOz9eBDY/wJc0I8pgxjxzIg4FTejXBN9defyA7jfChAoJQWA28acRea29VTExXMXV DZp0L8iVqWYv0BgI/b8bNjYSRcYU0/SegW+ZRfh846DEYTRQUK3KtG0UNawdsnFcXeJY D3uLcATxy/c9t9ViN9+Zn9np6dRgBplrNcMLFyr+ys4hbKvs3wmp7hIdLnuEHXGcXI3Q 7UCae6rERooNjU5GJQEg5CbW/G4MxzIvvau9bx0aK5/vjHWUq8y26w/OXOlvMNJQr1gF Khzsx9jYK4uz20kPu+NfOU/IP9d5u5PinQBq6h6QFHNprWmAMhi8IVcI0fkFNPtW7klG nuww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=ncB+YlIk; 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 br9-20020a056a00440900b0068658947b24si4973189pfb.8.2023.07.22.05.40.03; Sat, 22 Jul 2023 05:40:14 -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=ncB+YlIk; 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 S229926AbjGVLxf (ORCPT + 99 others); Sat, 22 Jul 2023 07:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjGVLxd (ORCPT ); Sat, 22 Jul 2023 07:53:33 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AA92420C; Sat, 22 Jul 2023 04:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026669; 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=bxYlrsHdr45I+ipn3Yf0ygmvZr0hy5qDRd7Irwb+9mk=; b=ncB+YlIk1ZaNj83pAOIQ9gZ9n9z9/IifaoLmCO1jO8V+lK7HLE6TwY5wnptKyIfIrU1lK4 cOQichSkaIIgYSPEvci2eJFab6DRiColNh/zR6o6nWK0rBpZSO6dYr8nSBCyZDjhUoTG5R QscIK0NbBHrRd2IPvPOqLFEjpM00wl8= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Jean Delvare Subject: [PATCH v2 08/22] i2c: i801: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:32 +0200 Message-Id: <20230722115046.27323-9-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. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron --- Cc: Jean Delvare --- drivers/i2c/busses/i2c-i801.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 943b8e6d026d..73ae06432133 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1808,7 +1808,6 @@ static void i801_shutdown(struct pci_dev *dev) pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg); } -#ifdef CONFIG_PM_SLEEP static int i801_suspend(struct device *dev) { struct i801_priv *priv = dev_get_drvdata(dev); @@ -1827,9 +1826,8 @@ static int i801_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume); static struct pci_driver i801_driver = { .name = DRV_NAME, @@ -1838,7 +1836,7 @@ static struct pci_driver i801_driver = { .remove = i801_remove, .shutdown = i801_shutdown, .driver = { - .pm = &i801_pm_ops, + .pm = pm_sleep_ptr(&i801_pm_ops), .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, }; -- 2.40.1