From 163bb6f99312d50604783b35f0837f1fa89fefc1 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 27 Sep 2022 19:24:19 +0300 Subject: pwm: lpss: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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önig Signed-off-by: Thierry Reding --- drivers/pwm/pwm-lpss-pci.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/pwm/pwm-lpss-pci.c') 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); -- cgit v1.2.3