From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 325F5EB64D9 for ; Wed, 14 Jun 2023 22:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237096AbjFNWhR (ORCPT ); Wed, 14 Jun 2023 18:37:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjFNWhQ (ORCPT ); Wed, 14 Jun 2023 18:37:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8971A2695 for ; Wed, 14 Jun 2023 15:37:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1DAC3640D0 for ; Wed, 14 Jun 2023 22:37:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02962C433C8; Wed, 14 Jun 2023 22:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686782234; bh=tDLQzqjNkzIjU6E5pRGpFT/ZHAhWOJkfrFQPDVXR+iA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gFplnqasLLA2JaHiH5YyCcAm8Xz/XCDEbXKNQHRM0EtA3SZ+90nM3p3Vc+vt9213+ N4abn4UyDL9gGT+prH6DimZl30HlK+aXy20d8f5DabdCVR0nYo7lRWt9uc7G3Virf1 Zd0FlGqQIgsEDsKtKnc1PKqHVNNw8xBwBMQDBvlKWjkmZPIMX/iAFrISuDZuJLUocQ kgeRpdwpWb2f7sS1M6vmqankSMrWQ4GqRMc3i2XV80sJYc/vLuiLdLC9O/nmGYx2EH u5twi6qM1ihmRWKl+vWwn60Nh0vkRbY/qQ1aoLLMhdVzE0G+BPSrX3bUHT0n+sVSDL tj64c+bpPp9pA== Date: Thu, 15 Jun 2023 00:37:11 +0200 From: Andi Shyti To: Heiner Kallweit Cc: Jean Delvare , "linux-i2c@vger.kernel.org" Subject: Re: [PATCH 4/4] i2c: i801: Switch to new macro DEFINE_SIMPLE_DEV_PM_OPS Message-ID: <20230614223711.mh26wohdivz6rll5@intel.intel> References: <1de49847-bb13-38b1-2820-15a7aa0fcb9a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1de49847-bb13-38b1-2820-15a7aa0fcb9a@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Hi Heiner, On Sat, Mar 04, 2023 at 10:37:34PM +0100, Heiner Kallweit wrote: > By using the newer macro DEFINE_SIMPLE_DEV_PM_OPS we can get rid > of the conditional compiling. > > Signed-off-by: Heiner Kallweit > --- > 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 e1350a8cc..bd2349768 100644 > --- a/drivers/i2c/busses/i2c-i801.c > +++ b/drivers/i2c/busses/i2c-i801.c > @@ -1800,7 +1800,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); > @@ -1821,9 +1820,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, > @@ -1832,7 +1830,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), Reviewed-by: Andi Shyti Andi