mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
@ 2024-10-07 15:09 Andy Shevchenko
  2024-10-10 19:36 ` Serge Semin
  2025-02-10 14:35 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2024-10-07 15:09 UTC (permalink / raw)
  To: Andy Shevchenko, Serge Semin, dmaengine, linux-kernel
  Cc: Viresh Kumar, Vinod Koul

SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
the driver's pm routines. We can now remove the ifdeffery
in the suspend and resume functions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/dw/pci.c      | 8 ++------
 drivers/dma/dw/platform.c | 8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
index e8a0eb81726a..a3aae3d1c093 100644
--- a/drivers/dma/dw/pci.c
+++ b/drivers/dma/dw/pci.c
@@ -76,8 +76,6 @@ static void dw_pci_remove(struct pci_dev *pdev)
 		dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
 }
 
-#ifdef CONFIG_PM_SLEEP
-
 static int dw_pci_suspend_late(struct device *dev)
 {
 	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -94,10 +92,8 @@ static int dw_pci_resume_early(struct device *dev)
 	return do_dw_dma_enable(chip);
 };
 
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops dw_pci_dev_pm_ops = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
+	LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
 };
 
 static const struct pci_device_id dw_pci_id_table[] = {
@@ -136,7 +132,7 @@ static struct pci_driver dw_pci_driver = {
 	.probe		= dw_pci_probe,
 	.remove		= dw_pci_remove,
 	.driver	= {
-		.pm	= &dw_pci_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&dw_pci_dev_pm_ops),
 	},
 };
 
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 47c58ad468cb..bf86c34285f3 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -157,8 +157,6 @@ static const struct acpi_device_id dw_dma_acpi_id_table[] = {
 MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
 #endif
 
-#ifdef CONFIG_PM_SLEEP
-
 static int dw_suspend_late(struct device *dev)
 {
 	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -183,10 +181,8 @@ static int dw_resume_early(struct device *dev)
 	return do_dw_dma_enable(chip);
 }
 
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops dw_dev_pm_ops = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
+	LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
 };
 
 static struct platform_driver dw_driver = {
@@ -195,7 +191,7 @@ static struct platform_driver dw_driver = {
 	.shutdown       = dw_shutdown,
 	.driver = {
 		.name	= DRV_NAME,
-		.pm	= &dw_dev_pm_ops,
+		.pm	= pm_sleep_ptr(&dw_dev_pm_ops),
 		.of_match_table = of_match_ptr(dw_dma_of_id_table),
 		.acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
 	},
-- 
2.43.0.rc1.1336.g36b5255a03ac


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
  2024-10-07 15:09 [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS() Andy Shevchenko
@ 2024-10-10 19:36 ` Serge Semin
  2025-02-10 14:35 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Serge Semin @ 2024-10-10 19:36 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dmaengine, linux-kernel, Viresh Kumar, Vinod Koul

On Mon, Oct 07, 2024 at 06:09:12PM GMT, Andy Shevchenko wrote:
> SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
> LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
> the driver's pm routines. We can now remove the ifdeffery
> in the suspend and resume functions.

Nice clean up. Thanks!
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/dma/dw/pci.c      | 8 ++------
>  drivers/dma/dw/platform.c | 8 ++------
>  2 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c
> index e8a0eb81726a..a3aae3d1c093 100644
> --- a/drivers/dma/dw/pci.c
> +++ b/drivers/dma/dw/pci.c
> @@ -76,8 +76,6 @@ static void dw_pci_remove(struct pci_dev *pdev)
>  		dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -
>  static int dw_pci_suspend_late(struct device *dev)
>  {
>  	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
> @@ -94,10 +92,8 @@ static int dw_pci_resume_early(struct device *dev)
>  	return do_dw_dma_enable(chip);
>  };
>  
> -#endif /* CONFIG_PM_SLEEP */
> -
>  static const struct dev_pm_ops dw_pci_dev_pm_ops = {
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
> +	LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
>  };
>  
>  static const struct pci_device_id dw_pci_id_table[] = {
> @@ -136,7 +132,7 @@ static struct pci_driver dw_pci_driver = {
>  	.probe		= dw_pci_probe,
>  	.remove		= dw_pci_remove,
>  	.driver	= {
> -		.pm	= &dw_pci_dev_pm_ops,
> +		.pm	= pm_sleep_ptr(&dw_pci_dev_pm_ops),
>  	},
>  };
>  
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index 47c58ad468cb..bf86c34285f3 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -157,8 +157,6 @@ static const struct acpi_device_id dw_dma_acpi_id_table[] = {
>  MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
>  #endif
>  
> -#ifdef CONFIG_PM_SLEEP
> -
>  static int dw_suspend_late(struct device *dev)
>  {
>  	struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
> @@ -183,10 +181,8 @@ static int dw_resume_early(struct device *dev)
>  	return do_dw_dma_enable(chip);
>  }
>  
> -#endif /* CONFIG_PM_SLEEP */
> -
>  static const struct dev_pm_ops dw_dev_pm_ops = {
> -	SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
> +	LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
>  };
>  
>  static struct platform_driver dw_driver = {
> @@ -195,7 +191,7 @@ static struct platform_driver dw_driver = {
>  	.shutdown       = dw_shutdown,
>  	.driver = {
>  		.name	= DRV_NAME,
> -		.pm	= &dw_dev_pm_ops,
> +		.pm	= pm_sleep_ptr(&dw_dev_pm_ops),
>  		.of_match_table = of_match_ptr(dw_dma_of_id_table),
>  		.acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
>  	},
> -- 
> 2.43.0.rc1.1336.g36b5255a03ac
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
  2024-10-07 15:09 [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS() Andy Shevchenko
  2024-10-10 19:36 ` Serge Semin
@ 2025-02-10 14:35 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2025-02-10 14:35 UTC (permalink / raw)
  To: Serge Semin, dmaengine, linux-kernel, Andy Shevchenko; +Cc: Viresh Kumar


On Mon, 07 Oct 2024 18:09:12 +0300, Andy Shevchenko wrote:
> SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
> LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
> the driver's pm routines. We can now remove the ifdeffery
> in the suspend and resume functions.
> 
> 

Applied, thanks!

[1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
      commit: 1e137d53e8471b45257d937e9773b61a88807fe7

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-10 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-07 15:09 [PATCH v1 1/1] dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS() Andy Shevchenko
2024-10-10 19:36 ` Serge Semin
2025-02-10 14:35 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®