linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: caam: fix PM operations definition
@ 2023-08-07 11:16 Arnd Bergmann
  2023-08-08  7:28 ` Meenakshi Aggarwal
  2023-08-18  9:29 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-08-07 11:16 UTC (permalink / raw)
  To: Horia Geantă,
	Pankaj Gupta, Gaurav Jain, Herbert Xu, David S. Miller,
	Meenakshi Aggarwal, Victoria Milhoan, Franck LENORMAND
  Cc: Arnd Bergmann, Vipul Kumar, Christophe JAILLET, Dan Douglass,
	linux-crypto, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: 322d74752c28a ("crypto: caam - add power management support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/crypto/caam/ctrl.c | 4 ++--
 drivers/crypto/caam/jr.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index a7a4583107f41..2a228a36fa15a 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -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,
 };
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 316180d26f8ae..767fbf052536a 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -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


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

* RE: [PATCH] crypto: caam: fix PM operations definition
  2023-08-07 11:16 [PATCH] crypto: caam: fix PM operations definition Arnd Bergmann
@ 2023-08-08  7:28 ` Meenakshi Aggarwal
  2023-08-18  9:29 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Meenakshi Aggarwal @ 2023-08-08  7:28 UTC (permalink / raw)
  To: Arnd Bergmann, Horia Geanta, Pankaj Gupta, Gaurav Jain,
	Herbert Xu, David S. Miller, Victoria Milhoan, Franck Lenormand
  Cc: Arnd Bergmann, Vipul Kumar, Christophe JAILLET, Dan Douglass,
	linux-crypto, linux-kernel

Reviewed-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>

> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Monday, August 7, 2023 4:47 PM
> To: Horia Geanta <horia.geanta@nxp.com>; Pankaj Gupta
> <pankaj.gupta@nxp.com>; Gaurav Jain <gaurav.jain@nxp.com>; Herbert Xu
> <herbert@gondor.apana.org.au>; David S. Miller <davem@davemloft.net>;
> Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>; Victoria Milhoan
> <vicki.milhoan@freescale.com>; Franck Lenormand
> <franck.lenormand@nxp.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Vipul Kumar
> <vipul_kumar@mentor.com>; Christophe JAILLET
> <christophe.jaillet@wanadoo.fr>; Dan Douglass <dan.douglass@nxp.com>;
> linux-crypto@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] crypto: caam: fix PM operations definition
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.
> 
> Fixes: 322d74752c28a ("crypto: caam - add power management support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/crypto/caam/ctrl.c | 4 ++--
>  drivers/crypto/caam/jr.c   | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index
> a7a4583107f41..2a228a36fa15a 100644
> --- a/drivers/crypto/caam/ctrl.c
> +++ b/drivers/crypto/caam/ctrl.c
> @@ -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,
>  };
> diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index
> 316180d26f8ae..767fbf052536a 100644
> --- a/drivers/crypto/caam/jr.c
> +++ b/drivers/crypto/caam/jr.c
> @@ -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


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

* Re: [PATCH] crypto: caam: fix PM operations definition
  2023-08-07 11:16 [PATCH] crypto: caam: fix PM operations definition Arnd Bergmann
  2023-08-08  7:28 ` Meenakshi Aggarwal
@ 2023-08-18  9:29 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2023-08-18  9:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Horia Geantă,
	Pankaj Gupta, Gaurav Jain, David S. Miller, Meenakshi Aggarwal,
	Victoria Milhoan, Franck LENORMAND, Arnd Bergmann, Vipul Kumar,
	Christophe JAILLET, Dan Douglass, linux-crypto, linux-kernel

On Mon, Aug 07, 2023 at 01:16:43PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.
> 
> Fixes: 322d74752c28a ("crypto: caam - add power management support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/crypto/caam/ctrl.c | 4 ++--
>  drivers/crypto/caam/jr.c   | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2023-08-18  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 11:16 [PATCH] crypto: caam: fix PM operations definition Arnd Bergmann
2023-08-08  7:28 ` Meenakshi Aggarwal
2023-08-18  9:29 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).