crypto: caam: fix PM operations definition
PATCH 1/1 crypto: caam: fix PM operations definition
From: Arnd Bergmann <[email protected]>
The newly added PM operations use the deprecated SIMPLE_DEV_PM_OPS() macro, causing a warning in some configurations:
drivers/crypto/caam/ctrl.c:828:12: error: 'caam_ctrl_resume' defined but not used [-Werror=unused-function]
828 | static int caam_ctrl_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~
drivers/crypto/caam/ctrl.c:818:12: error: 'caam_ctrl_suspend' defined but not used [-Werror=unused-function]
818 | static int caam_ctrl_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~
drivers/crypto/caam/jr.c:732:12: error: 'caam_jr_resume' defined but not used [-Werror=unused-function]
732 | static int caam_jr_resume(struct device *dev)
| ^~~~~~~~~~~~~~
drivers/crypto/caam/jr.c:687:12: error: 'caam_jr_suspend' defined but not used [-Werror=unused-function]
687 | static int caam_jr_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~Use the normal DEFINE_SIMPLE_DEV_PM_OPS() variant now, and use pm_ptr() to completely eliminate the structure in configs without CONFIG_PM.
--- drivers/crypto/caam/ctrl.c | 4 ++-- drivers/crypto/caam/jr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/caam/ctrl.c +2 -2
@@ -841,7 +841,7 @@ static int caam_ctrl_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(caam_ctrl_pm_ops, caam_ctrl_suspend, caam_ctrl_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(caam_ctrl_pm_ops, caam_ctrl_suspend, caam_ctrl_resume);/* Probe routine for CAAM top (controller) level */ static int caam_probe (struct platform_device *pdev)
@@ -1138,7 +1138,7 @@ static struct platform_driver caam_driver = { .driver = { .name = "caam", .of_match_table = caam_match, - .pm = &caam_ctrl_pm_ops, + .pm = pm_ptr(&caam_ctrl_pm_ops), }, .probe = caam_probe, };
drivers/crypto/caam/jr.c +2 -2
@@ -794,7 +794,7 @@ static int caam_jr_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend, caam_jr_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend, caam_jr_resume);static const struct of_device_id caam_jr_match[] = { {
@@ -811,7 +811,7 @@ static struct platform_driver caam_jr_driver = { .driver = { .name = "caam_jr", .of_match_table = caam_jr_match, - .pm = &caam_jr_pm_ops, + .pm = pm_ptr(&caam_jr_pm_ops), }, .probe = caam_jr_probe, .remove = caam_jr_remove,
Signature · 1 line
2.39.2
Quoted 97 lines
-----Original Message-----
From: Arnd Bergmann <[email protected]>
Sent: Monday, August 7, 2023 4:47 PM
To: Horia Geanta <[email protected]>; Pankaj Gupta <[email protected]>; Gaurav Jain <[email protected]>; Herbert Xu <[email protected]>; David S. Miller <[email protected]>; Meenakshi Aggarwal <[email protected]>; Victoria Milhoan <[email protected]>; Franck Lenormand <[email protected]>
Cc: Arnd Bergmann <[email protected]>; Vipul Kumar <[email protected]>; Christophe JAILLET <[email protected]>; Dan Douglass <[email protected]>; [email protected]; [email protected]
Subject: [PATCH] crypto: caam: fix PM operations definitionFrom: Arnd Bergmann <[email protected]>
The newly added PM operations use the deprecated
SIMPLE_DEV_PM_OPS()macro, causing a warning in some configurations:
drivers/crypto/caam/ctrl.c:828:12: error: 'caam_ctrl_resume' defined but not used [-Werror=unused-function]
828 | static intcaam_ctrl_resume(struct device *dev)| ^~~~~~~~~~~~~~~~ drivers/crypto/caam/ctrl.c:818:12: error: 'caam_ctrl_suspend' defined but not used [-Werror=unused-function] 818 | static int caam_ctrl_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/crypto/caam/jr.c:732:12: error: 'caam_jr_resume' defined but not used [-Werror=unused-function] 732 | static int caam_jr_resume(struct device *dev) | ^~~~~~~~~~~~~~ drivers/crypto/caam/jr.c:687:12: error: 'caam_jr_suspend' defined but not used [-Werror=unused-function] 687 | static int caam_jr_suspend(struct device *dev) | ^~~~~~~~~~~~~~~Use the normal
DEFINE_SIMPLE_DEV_PM_OPS()variant now, and usepm_ptr()to completely eliminate the structure in configs withoutCONFIG_PM.Fixes 322d74752c28a ("crypto: caam - add power management support")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/crypto/caam/ctrl.c | 4 ++-- drivers/crypto/caam/jr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/crypto/caam/ctrl.c index renamed from drivers/crypto/caam/ctrl.c +0
-0
a7a4583107f41..2a228a36fa15a100644drivers/crypto/caam/ctrl.c +2
-1@@ -841,7 +841,7 @@ static int caam_ctrl_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(caam_ctrl_pm_ops, caam_ctrl_suspend, caam_ctrl_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(caam_ctrl_pm_ops, caam_ctrl_suspend, +caam_ctrl_resume); /* Probe routine for CAAM top (controller) level */ static int caam_probe(struct
platform_device*pdev) @@ -1138,7 +1138,7 @@ static structplatform_drivercaam_driver= {drivers/crypto/caam/ctrl.c +1
-1.driver = { .name = "caam", .of_match_table = caam_match, - .pm = &caam_ctrl_pm_ops, + .pm = pm_ptr(&caam_ctrl_pm_ops), }, .probe = caam_probe, };drivers/crypto/caam/jr.c index renamed from drivers/crypto/caam/jr.c +0
-0
316180d26f8ae..767fbf052536a100644drivers/crypto/caam/jr.c +3
-3@@ -794,7 +794,7 @@ static int caam_jr_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend, caam_jr_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(caam_jr_pm_ops, caam_jr_suspend, +caam_jr_resume);static const struct of_device_id caam_jr_match[] = { {@@ -811,7 +811,7 @@ static struct platform_driver caam_jr_driver = { .driver = { .name = "caam_jr", .of_match_table = caam_jr_match, - .pm = &caam_jr_pm_ops, + .pm = pm_ptr(&caam_jr_pm_ops), }, .probe = caam_jr_probe, .remove = caam_jr_remove, --2.39.2
Herbert Xu
maintainerQuoted 21 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The newly added PM operations use the deprecated
SIMPLE_DEV_PM_OPS()macro, causing a warning in some configurations:
drivers/crypto/caam/ctrl.c:828:12: error: 'caam_ctrl_resume' defined but not used [-Werror=unused-function]
828 | static intcaam_ctrl_resume(struct device *dev)| ^~~~~~~~~~~~~~~~ drivers/crypto/caam/ctrl.c:818:12: error: 'caam_ctrl_suspend' defined but not used [-Werror=unused-function] 818 | static int caam_ctrl_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/crypto/caam/jr.c:732:12: error: 'caam_jr_resume' defined but not used [-Werror=unused-function] 732 | static int caam_jr_resume(struct device *dev) | ^~~~~~~~~~~~~~ drivers/crypto/caam/jr.c:687:12: error: 'caam_jr_suspend' defined but not used [-Werror=unused-function] 687 | static int caam_jr_suspend(struct device *dev) | ^~~~~~~~~~~~~~~Use the normal
DEFINE_SIMPLE_DEV_PM_OPS()variant now, and usepm_ptr()to completely eliminate the structure in configs withoutCONFIG_PM.
Quoted 6 lines
Fixes 322d74752c28a ("crypto: caam - add power management support")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/crypto/caam/ctrl.c | 4 ++-- drivers/crypto/caam/jr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt