Skip to contentSkip to conversation

memory: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS()

PATCH Applied Triet Hoang 2 participants 6 messages Aug 25 – Nov 2

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover memory: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS()

This series converts the Atmel EBI and PL353 SMC memory drivers to use DEFINE_SIMPLE_DEV_PM_OPS().

This is a straightforward cleanup with no functional change intended.

---
Changes in v2:
- Wrap to 75 ish chars for commit messages.
- Organize patches into a series with a cover letter.
---
Triet Hoang (2):
memory: atmel-ebi: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
memory: pl353: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

 drivers/memory/atmel-ebi.c | 6 +++---
 drivers/memory/pl353-smc.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH v2 1/2 memory: atmel-ebi: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().

This lets us drop the __maybe_unused annotations from the suspend and resume callbacks, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
 drivers/memory/atmel-ebi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/memory/atmel-ebi.c +3 -3
index 1e8e8aba2542..3b1246e9ed66 100644
@@ -610,7 +610,7 @@ static int atmel_ebi_probe(struct platform_device *pdev)
 	return of_platform_populate(np, NULL, NULL, dev);
 }
 
-static __maybe_unused int atmel_ebi_resume(struct device *dev)
+static int atmel_ebi_resume(struct device *dev)
 {
 	struct atmel_ebi *ebi = dev_get_drvdata(dev);
 	struct atmel_ebi_dev *ebid;
@@ -625,14 +625,14 @@ static __maybe_unused int atmel_ebi_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(atmel_ebi_pm_ops, NULL, atmel_ebi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(atmel_ebi_pm_ops, NULL, atmel_ebi_resume);
 
 static struct platform_driver atmel_ebi_driver = {
 	.probe = atmel_ebi_probe,
 	.driver = {
 		.name = "atmel-ebi",
 		.of_match_table	= atmel_ebi_id_table,
-		.pm = &atmel_ebi_pm_ops,
+		.pm = pm_sleep_ptr(&atmel_ebi_pm_ops),
 	},
 };
 builtin_platform_driver(atmel_ebi_driver);
Signature · 1 line
2.53.0
#2 lore raw

PATCH v2 2/2 memory: pl353: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

In reply to Triet Hoang

Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().

This lets us drop the __maybe_unused annotations from the suspend and resume callbacks, also reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

---
 drivers/memory/pl353-smc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/memory/pl353-smc.c +4 -4
index 28a8cc56003c..047e42c8715a 100644
@@ -25,7 +25,7 @@ struct pl353_smc_data {
 	struct clk		*aclk;
 };
 
-static int __maybe_unused pl353_smc_suspend(struct device *dev)
+static int pl353_smc_suspend(struct device *dev)
 {
 	struct pl353_smc_data *pl353_smc = dev_get_drvdata(dev);
 
@@ -35,7 +35,7 @@ static int __maybe_unused pl353_smc_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pl353_smc_resume(struct device *dev)
+static int pl353_smc_resume(struct device *dev)
 {
 	struct pl353_smc_data *pl353_smc = dev_get_drvdata(dev);
 	int ret;
@@ -56,7 +56,7 @@ static int __maybe_unused pl353_smc_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(pl353_smc_dev_pm_ops, pl353_smc_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(pl353_smc_dev_pm_ops, pl353_smc_suspend,
 			 pl353_smc_resume);
 
 static const struct of_device_id pl353_smc_supported_children[] = {
@@ -121,7 +121,7 @@ MODULE_DEVICE_TABLE(amba, pl353_ids);
 static struct amba_driver pl353_smc_driver = {
 	.drv = {
 		.name = "pl353-smc",
-		.pm = &pl353_smc_dev_pm_ops,
+		.pm = pm_sleep_ptr(&pl353_smc_dev_pm_ops),
 	},
 	.id_table = pl353_ids,
 	.probe = pl353_smc_probe,
Signature · 1 line
2.53.0
#3 lore raw
In reply to Triet Hoang
Quoted 10 lines · Triet Hoang

This series converts the Atmel EBI and PL353 SMC memory drivers to use DEFINE_SIMPLE_DEV_PM_OPS().

This is a straightforward cleanup with no functional change intended.

---
Changes in v2:
- Wrap to 75 ish chars for commit messages.
- Organize patches into a series with a cover letter.

Did you receive review?

<form letter>
This is a friendly reminder during the review process.

It looks like you received a tag and forgot to add it.

If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Please read:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577

If a tag was not added on purpose, please state in the patch changelog or cover letter why and what changed.
</form letter>

Best regards,
Krzysztof

#4 lore raw
Quoted 16 lines · Krzysztof Kozlowski

Did you receive review?

<form letter>
This is a friendly reminder during the review process.

It looks like you received a tag and forgot to add it.

If you do not know the process, here is a short explanation:
Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply.

Quoted 6 lines

Please read:
https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577

If a tag was not added on purpose, please state in the patch changelog or cover letter why and what changed.
</form letter>

Yes, this was my mistake. I missed adding the review tag when preparing v2.

This is still new to me, so thank you very much for the explanation and guidance. I’ll make sure to keep this in mind for future working.

Regards,
Triet

maintainer Applied
#5 lore raw
In reply to Triet Hoang
Quoted 4 lines · Triet Hoang

This series converts the Atmel EBI and PL353 SMC memory drivers to use DEFINE_SIMPLE_DEV_PM_OPS().

This is a straightforward cleanup with no functional change intended.

Applied, thanks!

[1/2] memory: atmel-ebi: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

      https://git.kernel.org/krzk/linux-mem-ctrl/c/c402c2c002616df803c2bc80949c7fe37217b890
[2/2] memory: pl353: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
      https://git.kernel.org/krzk/linux-mem-ctrl/c/b2219e9b406dbe62681a55f3d3bef5a07fec752b

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>