diff mbox series

[31/33] dmaengine: at_hdmac: Use pm_ptr()

Message ID 20220820125717.588722-32-tudor.ambarus@microchip.com (mailing list archive)
State Changes Requested
Headers show
Series dmaengine: at_hdmac: Fix concurrency bugs and then convert to virt-dma | expand

Commit Message

Tudor Ambarus Aug. 20, 2022, 12:57 p.m. UTC
From: Tudor Ambarus <tudor.ambarus@gmail.com>

Use pm_ptr() macro to fill at_xdmac_driver.driver.pm. In case CONFIG_PM is
not enabled, the macro will return NULL.

Signed-off-by: Tudor Ambarus <tudor.ambarus@gmail.com>
---
 drivers/dma/at_hdmac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vinod Koul Oct. 19, 2022, 4:50 p.m. UTC | #1
On 20-08-22, 15:57, Tudor Ambarus wrote:
> From: Tudor Ambarus <tudor.ambarus@gmail.com>
> 
> Use pm_ptr() macro to fill at_xdmac_driver.driver.pm. In case CONFIG_PM is
> not enabled, the macro will return NULL.

You annotated at_dma_dev_pm_ops with __maybe_unused which is a correct
thing to do, but should be explained here

> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@gmail.com>
> ---
>  drivers/dma/at_hdmac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 0b473e6d161d..e35b4b325452 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -2524,7 +2524,7 @@ static int at_dma_resume_noirq(struct device *dev)
>  	return 0;
>  }
>  
> -static const struct dev_pm_ops at_dma_dev_pm_ops = {
> +static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = {
>  	.prepare = at_dma_prepare,
>  	.suspend_noirq = at_dma_suspend_noirq,
>  	.resume_noirq = at_dma_resume_noirq,
> @@ -2536,7 +2536,7 @@ static struct platform_driver at_dma_driver = {
>  	.id_table	= atdma_devtypes,
>  	.driver = {
>  		.name	= "at_hdmac",
> -		.pm	= &at_dma_dev_pm_ops,
> +		.pm	= pm_ptr(&at_dma_dev_pm_ops),
>  		.of_match_table	= of_match_ptr(atmel_dma_dt_ids),
>  	},
>  };
> -- 
> 2.25.1
Tudor Ambarus Oct. 20, 2022, 7:10 a.m. UTC | #2
On 10/19/22 19:50, Vinod Koul wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 20-08-22, 15:57, Tudor Ambarus wrote:
>> From: Tudor Ambarus <tudor.ambarus@gmail.com>
>>
>> Use pm_ptr() macro to fill at_xdmac_driver.driver.pm. In case CONFIG_PM is
>> not enabled, the macro will return NULL.
> 
> You annotated at_dma_dev_pm_ops with __maybe_unused which is a correct
> thing to do, but should be explained here

okay, will refine the commit message.

> 
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus@gmail.com>
>> ---
>>  drivers/dma/at_hdmac.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
>> index 0b473e6d161d..e35b4b325452 100644
>> --- a/drivers/dma/at_hdmac.c
>> +++ b/drivers/dma/at_hdmac.c
>> @@ -2524,7 +2524,7 @@ static int at_dma_resume_noirq(struct device *dev)
>>       return 0;
>>  }
>>
>> -static const struct dev_pm_ops at_dma_dev_pm_ops = {
>> +static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = {
>>       .prepare = at_dma_prepare,
>>       .suspend_noirq = at_dma_suspend_noirq,
>>       .resume_noirq = at_dma_resume_noirq,
>> @@ -2536,7 +2536,7 @@ static struct platform_driver at_dma_driver = {
>>       .id_table       = atdma_devtypes,
>>       .driver = {
>>               .name   = "at_hdmac",
>> -             .pm     = &at_dma_dev_pm_ops,
>> +             .pm     = pm_ptr(&at_dma_dev_pm_ops),
>>               .of_match_table = of_match_ptr(atmel_dma_dt_ids),
>>       },
>>  };
>> --
>> 2.25.1
> 
> --
> ~Vinod
diff mbox series

Patch

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 0b473e6d161d..e35b4b325452 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -2524,7 +2524,7 @@  static int at_dma_resume_noirq(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops at_dma_dev_pm_ops = {
+static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = {
 	.prepare = at_dma_prepare,
 	.suspend_noirq = at_dma_suspend_noirq,
 	.resume_noirq = at_dma_resume_noirq,
@@ -2536,7 +2536,7 @@  static struct platform_driver at_dma_driver = {
 	.id_table	= atdma_devtypes,
 	.driver = {
 		.name	= "at_hdmac",
-		.pm	= &at_dma_dev_pm_ops,
+		.pm	= pm_ptr(&at_dma_dev_pm_ops),
 		.of_match_table	= of_match_ptr(atmel_dma_dt_ids),
 	},
 };