diff mbox series

[1/2] accel/amdxdna: use modern PM helpers

Message ID 20241213090259.68492-1-arnd@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/2] accel/amdxdna: use modern PM helpers | expand

Commit Message

Arnd Bergmann Dec. 13, 2024, 9:02 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a build
warning when CONFIG_PM is disabled:

drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
  343 | static int amdxdna_pmops_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~
drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
  328 | static int amdxdna_pmops_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~

Change these to the modern replacements.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/accel/amdxdna/amdxdna_pci_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeffrey Hugo Dec. 13, 2024, 5:07 p.m. UTC | #1
On 12/13/2024 2:02 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a build
> warning when CONFIG_PM is disabled:
> 
> drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
>    343 | static int amdxdna_pmops_resume(struct device *dev)
>        |            ^~~~~~~~~~~~~~~~~~~~
> drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
>    328 | static int amdxdna_pmops_suspend(struct device *dev)
>        |            ^~~~~~~~~~~~~~~~~~~~~
> 
> Change these to the modern replacements.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Looks sane to me.

Lizhi, can you verify that this works as expected for you?  I'd hate to 
accidentally break something.

-Jeff
Lizhi Hou Dec. 13, 2024, 5:41 p.m. UTC | #2
On 12/13/24 09:07, Jeffrey Hugo wrote:
> On 12/13/2024 2:02 AM, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a 
>> build
>> warning when CONFIG_PM is disabled:
>>
>> drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 
>> 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
>>    343 | static int amdxdna_pmops_resume(struct device *dev)
>>        |            ^~~~~~~~~~~~~~~~~~~~
>> drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 
>> 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
>>    328 | static int amdxdna_pmops_suspend(struct device *dev)
>>        |            ^~~~~~~~~~~~~~~~~~~~~
>>
>> Change these to the modern replacements.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Looks sane to me.
>
> Lizhi, can you verify that this works as expected for you?  I'd hate 
> to accidentally break something.

Verified suspend/resume. It works fine.


Lizhi

>
> -Jeff
>
Jeffrey Hugo Dec. 13, 2024, 5:49 p.m. UTC | #3
On 12/13/2024 10:41 AM, Lizhi Hou wrote:
> 
> On 12/13/24 09:07, Jeffrey Hugo wrote:
>> On 12/13/2024 2:02 AM, Arnd Bergmann wrote:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause a 
>>> build
>>> warning when CONFIG_PM is disabled:
>>>
>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 
>>> 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
>>>    343 | static int amdxdna_pmops_resume(struct device *dev)
>>>        |            ^~~~~~~~~~~~~~~~~~~~
>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 
>>> 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
>>>    328 | static int amdxdna_pmops_suspend(struct device *dev)
>>>        |            ^~~~~~~~~~~~~~~~~~~~~
>>>
>>> Change these to the modern replacements.
>>>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> Looks sane to me.
>>
>> Lizhi, can you verify that this works as expected for you?  I'd hate 
>> to accidentally break something.
> 
> Verified suspend/resume. It works fine.

Excellent.  Would you like to give a reviewed-by and/or a tested-by?

-Jeff
Lizhi Hou Dec. 13, 2024, 5:57 p.m. UTC | #4
On 12/13/24 09:49, Jeffrey Hugo wrote:
> On 12/13/2024 10:41 AM, Lizhi Hou wrote:
>>
>> On 12/13/24 09:07, Jeffrey Hugo wrote:
>>> On 12/13/2024 2:02 AM, Arnd Bergmann wrote:
>>>> From: Arnd Bergmann <arnd@arndb.de>
>>>>
>>>> The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause 
>>>> a build
>>>> warning when CONFIG_PM is disabled:
>>>>
>>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 
>>>> 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
>>>>    343 | static int amdxdna_pmops_resume(struct device *dev)
>>>>        |            ^~~~~~~~~~~~~~~~~~~~
>>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 
>>>> 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
>>>>    328 | static int amdxdna_pmops_suspend(struct device *dev)
>>>>        |            ^~~~~~~~~~~~~~~~~~~~~
>>>>
>>>> Change these to the modern replacements.
>>>>
>>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>>
>>> Looks sane to me.
>>>
>>> Lizhi, can you verify that this works as expected for you? I'd hate 
>>> to accidentally break something.
>>
>> Verified suspend/resume. It works fine.
>
> Excellent.  Would you like to give a reviewed-by and/or a tested-by?

Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>

Tested-by: Lizhi Hou <lizhi.hou@amd.com>

>
> -Jeff
>
Jeffrey Hugo Dec. 13, 2024, 6:11 p.m. UTC | #5
On 12/13/2024 10:57 AM, Lizhi Hou wrote:
> 
> On 12/13/24 09:49, Jeffrey Hugo wrote:
>> On 12/13/2024 10:41 AM, Lizhi Hou wrote:
>>>
>>> On 12/13/24 09:07, Jeffrey Hugo wrote:
>>>> On 12/13/2024 2:02 AM, Arnd Bergmann wrote:
>>>>> From: Arnd Bergmann <arnd@arndb.de>
>>>>>
>>>>> The old SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS macros cause 
>>>>> a build
>>>>> warning when CONFIG_PM is disabled:
>>>>>
>>>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:343:12: error: 
>>>>> 'amdxdna_pmops_resume' defined but not used [-Werror=unused-function]
>>>>>    343 | static int amdxdna_pmops_resume(struct device *dev)
>>>>>        |            ^~~~~~~~~~~~~~~~~~~~
>>>>> drivers/accel/amdxdna/amdxdna_pci_drv.c:328:12: error: 
>>>>> 'amdxdna_pmops_suspend' defined but not used [-Werror=unused-function]
>>>>>    328 | static int amdxdna_pmops_suspend(struct device *dev)
>>>>>        |            ^~~~~~~~~~~~~~~~~~~~~
>>>>>
>>>>> Change these to the modern replacements.
>>>>>
>>>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>>>
>>>> Looks sane to me.
>>>>
>>>> Lizhi, can you verify that this works as expected for you? I'd hate 
>>>> to accidentally break something.
>>>
>>> Verified suspend/resume. It works fine.
>>
>> Excellent.  Would you like to give a reviewed-by and/or a tested-by?
> 
> Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
> 
> Tested-by: Lizhi Hou <lizhi.hou@amd.com>

Thanks!

Pushed to drm-misc-next

-Jeff
diff mbox series

Patch

diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c
index 02533732d4ca..b2342abdddc6 100644
--- a/drivers/accel/amdxdna/amdxdna_pci_drv.c
+++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c
@@ -390,8 +390,8 @@  static int amdxdna_rpmops_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops amdxdna_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(amdxdna_pmops_suspend, amdxdna_pmops_resume)
-	SET_RUNTIME_PM_OPS(amdxdna_rpmops_suspend, amdxdna_rpmops_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(amdxdna_pmops_suspend, amdxdna_pmops_resume)
+	RUNTIME_PM_OPS(amdxdna_rpmops_suspend, amdxdna_rpmops_resume, NULL)
 };
 
 static struct pci_driver amdxdna_pci_driver = {