diff mbox series

[3/4] dmaengine: at_xdmac: use __maybe_unused for pm functions

Message ID 20211007111230.2331837-4-claudiu.beznea@microchip.com (mailing list archive)
State Accepted
Commit b183d41a340b224ed99dc0b967de590a0be8ef48
Headers show
Series dmaengine: at_xdmac: fixes and code enhancements | expand

Commit Message

Claudiu Beznea Oct. 7, 2021, 11:12 a.m. UTC
Use __maybe_unused for pm functions.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 drivers/dma/at_xdmac.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Tudor Ambarus Oct. 15, 2021, 8:01 a.m. UTC | #1
On 10/7/21 2:12 PM, Claudiu Beznea wrote:
> Use __maybe_unused for pm functions.

Explaining why would be nice. E.g. avoiding ifdefs throughout the code,
and stop defining atmel_xdmac_prepare as NULL.

> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
>  drivers/dma/at_xdmac.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index e18abbd56fb5..12371396fcc0 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1950,8 +1950,7 @@ static void at_xdmac_axi_config(struct platform_device *pdev)
>  	}
>  }
>  
> -#ifdef CONFIG_PM
> -static int atmel_xdmac_prepare(struct device *dev)
> +static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
> @@ -1965,12 +1964,8 @@ static int atmel_xdmac_prepare(struct device *dev)
>  	}
>  	return 0;
>  }
> -#else
> -#	define atmel_xdmac_prepare NULL
> -#endif
>  
> -#ifdef CONFIG_PM_SLEEP
> -static int atmel_xdmac_suspend(struct device *dev)
> +static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
> @@ -1994,7 +1989,7 @@ static int atmel_xdmac_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int atmel_xdmac_resume(struct device *dev)
> +static int __maybe_unused atmel_xdmac_resume(struct device *dev)
>  {
>  	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct at_xdmac_chan	*atchan;
> @@ -2032,7 +2027,6 @@ static int atmel_xdmac_resume(struct device *dev)
>  	}
>  	return 0;
>  }
> -#endif /* CONFIG_PM_SLEEP */
>  
>  static int at_xdmac_probe(struct platform_device *pdev)
>  {
>
diff mbox series

Patch

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index e18abbd56fb5..12371396fcc0 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1950,8 +1950,7 @@  static void at_xdmac_axi_config(struct platform_device *pdev)
 	}
 }
 
-#ifdef CONFIG_PM
-static int atmel_xdmac_prepare(struct device *dev)
+static int __maybe_unused atmel_xdmac_prepare(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct dma_chan		*chan, *_chan;
@@ -1965,12 +1964,8 @@  static int atmel_xdmac_prepare(struct device *dev)
 	}
 	return 0;
 }
-#else
-#	define atmel_xdmac_prepare NULL
-#endif
 
-#ifdef CONFIG_PM_SLEEP
-static int atmel_xdmac_suspend(struct device *dev)
+static int __maybe_unused atmel_xdmac_suspend(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct dma_chan		*chan, *_chan;
@@ -1994,7 +1989,7 @@  static int atmel_xdmac_suspend(struct device *dev)
 	return 0;
 }
 
-static int atmel_xdmac_resume(struct device *dev)
+static int __maybe_unused atmel_xdmac_resume(struct device *dev)
 {
 	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
 	struct at_xdmac_chan	*atchan;
@@ -2032,7 +2027,6 @@  static int atmel_xdmac_resume(struct device *dev)
 	}
 	return 0;
 }
-#endif /* CONFIG_PM_SLEEP */
 
 static int at_xdmac_probe(struct platform_device *pdev)
 {