From nobody Mon Apr 6 11:22:39 2026 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 A18CDC6FA8E for ; Tue, 27 Sep 2022 16:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbiI0QY3 (ORCPT ); Tue, 27 Sep 2022 12:24:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232877AbiI0QYK (ORCPT ); Tue, 27 Sep 2022 12:24:10 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 822AF177343; Tue, 27 Sep 2022 09:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664295849; x=1695831849; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yIqxRHRS1triyvN1zukI7EVS4f3lxjAFUc90xkhDIu4=; b=dp5BVjDqlQff+n5t2CUTcILZREXOYk035xXnqtWfYnF16gUS0i+SjJlM VCpknJhhusxtRTgVbPczTsTrF7tSkkJ6Vnuc69vd8SW1U5ysbOi/lbwLy cI/99WT5dP7YD5gmKMTkYDrUyybryQElcUcyRshsiqstDMsNZ66DSyo1I xCjCKTYcpQwgyNNbxyrVDPF/uG4wCdlRLknonRyrAKSa/Nb2zAiiTg7Xq gU+1a6LBJy2x5TFScdASsvTdx9RU0YR8tFJZgA/Pm8x5gmeAG9my36d5+ nq58WXtLzx+csUknqpqI8ogjwuTCI1mw+r22qQGxvi12C6gH0VsWBIbdG g==; X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="327719522" X-IronPort-AV: E=Sophos;i="5.93,349,1654585200"; d="scan'208";a="327719522" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 09:24:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10483"; a="684047856" X-IronPort-AV: E=Sophos;i="5.93,349,1654585200"; d="scan'208";a="684047856" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 27 Sep 2022 09:24:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9CC46268; Tue, 27 Sep 2022 19:24:23 +0300 (EEST) From: Andy Shevchenko To: Hans de Goede , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Andy Shevchenko , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thierry Reding Subject: [PATCH v4 5/7] pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros Date: Tue, 27 Sep 2022 19:24:19 +0300 Message-Id: <20220927162421.11052-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220927162421.11052-1-andriy.shevchenko@linux.intel.com> References: <20220927162421.11052-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Hans de Goede Acked-by: Uwe Kleine-K=C3=B6nig --- 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); } =20 -#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 *d= ev) { return 0; } -#endif =20 -static const struct dev_pm_ops pwm_lpss_pci_pm =3D { - 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); =20 static const struct pci_device_id pwm_lpss_pci_ids[] =3D { { PCI_VDEVICE(INTEL, 0x0ac8), (unsigned long)&pwm_lpss_bxt_info}, @@ -89,7 +87,7 @@ static struct pci_driver pwm_lpss_driver_pci =3D { .probe =3D pwm_lpss_probe_pci, .remove =3D pwm_lpss_remove_pci, .driver =3D { - .pm =3D &pwm_lpss_pci_pm, + .pm =3D pm_ptr(&pwm_lpss_pci_pm), }, }; module_pci_driver(pwm_lpss_driver_pci); --=20 2.35.1