Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1325517rwl; Thu, 10 Aug 2023 09:29:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAZA+/ZG++9romSjXfcKOf9GjV5Iio3ttuQSMvWgYSFqVU1f6A90OqZ2jKYfWynUr7JFrt X-Received: by 2002:a05:6a00:2d95:b0:687:5bd6:b6d1 with SMTP id fb21-20020a056a002d9500b006875bd6b6d1mr3457746pfb.3.1691684953023; Thu, 10 Aug 2023 09:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691684953; cv=none; d=google.com; s=arc-20160816; b=I2rxNxWz5aU25fjqEQemCSvJ6RHXJZPiE0u4zCZfFgWctrfi+7OG5IXGCuLkqGYRBy wMHI8A9SpUI1az7/rl/4gD6SnKCJunmoAxYhy7BooMTrLrjC1RS1fsfUjr04G3WItLET SaPQgqdmVipONCji5ftMK2MSaC5xVdczLQPIpD27iliZL2l98aDg6zponnSjSvNVwPy0 tq83j+4g2yffG4WYsbrfsPWnKVw1UlvdgFdS4/BUkarM+EctIz4K3aXB2p3TQVB+DprR qyVNGKcMJeqx+N2va/K1v7iM6Hq4cd+tlj8Lw/ZeheWkIknug555PgYnz5OLFeFt3kjb zUFw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:dkim-signature; bh=8r0MrIgHThZwqqpV3b2m9bLyvubn7HrfmWuasmphbiM=; fh=69k8mczRvPpk5mw610cC4QrBRTVFt0ZvJoK7sgg0LMc=; b=Vq0cNVqsrzC3M0LguqmSSVfl/KpeTh0QhhIJO/GAugouXyMmot+p/hPB31mpq3vOPP ZbiUGN54ViX9SSBaA8LgIfUfk62oeU9fPpUVi8GlnCLC+U5YDzEQob5l4Okx5L6xh5v2 1n/S1d+w3D+Vur+maz37C8U6TsgvRtB2Ce7uHZQacnt/WGKH2wsqcMQgJQCGx5AxRiQB Oa8mMCO1JTEkt/PvdaHGbnx1CeMQ9Jno8eodNxBj/vf54dhiFLueQ7vwhvJW6lT4TQ6x Z6w+zQb5hpEVFES19GhSUpIQ0qzUvm2xBRp7Lm5qxUrcK4hr5j5jdqvZ4kq0kdh06Fw6 9MlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MTIoZIpj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e32-20020a630f20000000b00563deb65f93si1702919pgl.200.2023.08.10.09.29.00; Thu, 10 Aug 2023 09:29:12 -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=@suse.de header.s=susede2_rsa header.b=MTIoZIpj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235342AbjHJPZT (ORCPT + 99 others); Thu, 10 Aug 2023 11:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235994AbjHJPZS (ORCPT ); Thu, 10 Aug 2023 11:25:18 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED9F26B6; Thu, 10 Aug 2023 08:25:17 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 22B8121835; Thu, 10 Aug 2023 15:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691681116; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8r0MrIgHThZwqqpV3b2m9bLyvubn7HrfmWuasmphbiM=; b=MTIoZIpjjGwnJVDh86TNXkVPejTGcbKjrKPkhbmvqU1zXSmOC7MmDHzXR1eUg5ykcMeg33 s8h72m6hGlVxJ0ekf/nXIqQPLP2btkr63atueSlcyRZPiVNPVyCo6QLAu2N+t/R0B07Ib+ O9nDMJfzzdNueB7zx7Hv81l0vTfWVl4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691681116; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8r0MrIgHThZwqqpV3b2m9bLyvubn7HrfmWuasmphbiM=; b=CEHF4dpN5/RHVw+1Liym9a9Xq8jICf6me+Zha5Te+LQK26UPRnV5/VjaFlANaImgBd1ebF WXUai0JmyhlMV0Ag== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E5B61138E2; Thu, 10 Aug 2023 15:25:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qO1sNlsB1WQPHwAAMHmgww (envelope-from ); Thu, 10 Aug 2023 15:25:15 +0000 Date: Thu, 10 Aug 2023 17:25:14 +0200 From: Jean Delvare To: Paul Cercueil Cc: Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron Subject: Re: [PATCH v2 08/22] i2c: i801: Remove #ifdef guards for PM related functions Message-ID: <20230810172514.47c45be7@endymion.delvare> In-Reply-To: <20230722115046.27323-9-paul@crapouillou.net> References: <20230722115046.27323-1-paul@crapouillou.net> <20230722115046.27323-9-paul@crapouillou.net> Organization: SUSE Linux X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.34; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Hi Paul, On Sat, 22 Jul 2023 13:50:32 +0200, Paul Cercueil wrote: > 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, > }, > }; As far as I can see, this is the same as: https://lore.kernel.org/linux-i2c/20230628091522.3e58dfb2@endymion.delvare/T/#mbd96bc42299e23f43ff1ebd56e61656882994afc submitted by Heiner Kallweit back in March, review by myself in June, but not applied yet. So: Reviewed-by: Jean Delvare -- Jean Delvare SUSE L3 Support