Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp675203rwn; Thu, 8 Sep 2022 07:19:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nfpYp10o3F/UGsH14F2tZDn6D9hjSLImnC4MQHgx1Sr8A1AAXBTm/GOXPvk27izdjcGRf X-Received: by 2002:a17:902:e545:b0:177:e335:9757 with SMTP id n5-20020a170902e54500b00177e3359757mr6788346plf.152.1662646777283; Thu, 08 Sep 2022 07:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662646777; cv=none; d=google.com; s=arc-20160816; b=f3+v+yBQNFqUS/K+nDuJLQvhTD1Hq4fgh/cmvHjYz+xKrbTX7tt8QH8l3W3cbAFawL 1R6ZtrKBOz1ee2JD2ADb9cok+PNYzDprmmUsup7j89Q1OzNFgkTy1x1F2r8FYoVIKe3h XKI9tmHoyyk6igN9MN/XVG9k3XXCF+jMHk9d4hNkgsH1CsBtgQvzd/5ZhQdu3K1NORo/ Q5dqagiU1JE+WjvtwCfKl5GLeoEtd7vhnuEpzCxPBLyPKunz8F9MOoR6gPCXskIk7e8C p8f6r6iGrDnaRMUnzUVoCgmTdicis/zp+tzciLMwJImEQC4qiQlSE0L5zdAlx3q8hj34 rzUQ== 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=xgOkpOisnD9J+2PQ7Y7rgvwUtbq2M+zstvL3woM4HH8=; b=mRns64KZxuGdIHES/O46E7t7jhmoP2yJAtxJmH8kSYM6kY5Gl0+5Yi/gRbfLZ7vDYl 88K3IHn+3/hMeiZJ3oAnvy6JEYKqnSy3NV7mxFWV8M6YY0jZT4Jh8JdxRk4AgA0DjcGw RO0Ct93eV9GZaVGJVuADnOs0yVb5vwkpatN9hVAyUvsFIfxNSdWllH+VExQW2FQd5159 MLLyn8DxmWD+dFpZqCDJCYxSilNgzrwmI4a4yfO706BRpd3G/rYleYAvDzH8tHo1LBop U3wAdAHu4ZvESAIab2C7L3oSPovyg5ilB7vRUfDwe8t/W5C+iYQndWxMf88cpA5KExlG OObw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZW2uyM3W; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170902f39100b0016dd44dbe61si17499307ple.505.2022.09.08.07.19.25; Thu, 08 Sep 2022 07:19:37 -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=@intel.com header.s=Intel header.b=ZW2uyM3W; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbiIHN5U (ORCPT + 99 others); Thu, 8 Sep 2022 09:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbiIHN4y (ORCPT ); Thu, 8 Sep 2022 09:56:54 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C1D6FD20E; Thu, 8 Sep 2022 06:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662645411; x=1694181411; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3QJCpzgRCnUz4yyccAi/oO2t5HlZBvGdGKxNCfeQF40=; b=ZW2uyM3WbR9+gx3dazoo7IBbZk+JOxcKOfi2Ju6nX31HKCmIuhEeZ+hG EbEQHsHO93lj/vztD6vZvFg5A9fv81hnT/dCazKYinPkf2XBOWwQNNsu9 xt7FTImK3B2UWbq7DMy4BcIerJGTQB2CebDe9A5g8KNpRbBCtsXGlF7YU E5hiKFpDJ2D+Gc88eq2Dtl/1uIx1xklwoXs4Wsqrbisfx3Tj5d1ZsTO5d LY3Nnk4UwucCYNSexG8DPLaXUTGvknWrG5+Xx6a5mU52CM9mG7CDKXC14 lrpGLkQLQ4iS9ZV28LeI2AubXn5sMOmiNaJyhwVM3QpcLoaxuzvGX4UyH A==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="323366991" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="323366991" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 06:56:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="757207446" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 08 Sep 2022 06:56:48 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9F71A5E4; Thu, 8 Sep 2022 16:57:02 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Thierry Reding Subject: [PATCH v2 6/9] pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros Date: Thu, 8 Sep 2022 16:56:55 +0300 Message-Id: <20220908135658.64463-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220908135658.64463-1-andriy.shevchenko@linux.intel.com> References: <20220908135658.64463-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Andy Shevchenko --- drivers/pwm/pwm-lpss-pci.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c index f3367e844e61..98413d364338 100644 --- a/drivers/pwm/pwm-lpss-pci.c +++ b/drivers/pwm/pwm-lpss-pci.c @@ -48,7 +48,6 @@ static void pwm_lpss_remove_pci(struct pci_dev *pdev) pm_runtime_get_sync(&pdev->dev); } -#ifdef CONFIG_PM static int pwm_lpss_runtime_suspend_pci(struct device *dev) { /* @@ -62,12 +61,11 @@ static int pwm_lpss_runtime_resume_pci(struct device *dev) { return 0; } -#endif -static const struct dev_pm_ops pwm_lpss_pci_pm = { - SET_RUNTIME_PM_OPS(pwm_lpss_runtime_suspend_pci, - pwm_lpss_runtime_resume_pci, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(pwm_lpss_pci_pm, + pwm_lpss_runtime_suspend_pci, + pwm_lpss_runtime_resume_pci, + NULL); static const struct pci_device_id pwm_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x0ac8), (unsigned long)&pwm_lpss_bxt_info}, @@ -89,7 +87,7 @@ static struct pci_driver pwm_lpss_driver_pci = { .probe = pwm_lpss_probe_pci, .remove = pwm_lpss_remove_pci, .driver = { - .pm = &pwm_lpss_pci_pm, + .pm = pm_ptr(&pwm_lpss_pci_pm), }, }; module_pci_driver(pwm_lpss_driver_pci); -- 2.35.1