Skip to contentSkip to conversation

spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS

PATCH In review Dhruva Gole 3 participants 4 messages Apr 24, 2023 – Apr 25, 2023

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

PATCH 1/1 spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner without us explicitly needing to:

.suspend = bcm63xx_spi_suspend, \
.resume = bcm63xx_spi_resume, \
.freeze = bcm63xx_spi_suspend, \
.thaw = bcm63xx_spi_resume, \
.poweroff = bcm63xx_spi_suspend, \
.restore = bcm63xx_spi_resume

---
 drivers/spi/spi-bcm63xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/spi/spi-bcm63xx.c +1 -3
index 99395932074c..9aecb77c3d89 100644
@@ -644,9 +644,7 @@ static int bcm63xx_spi_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops bcm63xx_spi_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(bcm63xx_spi_suspend, bcm63xx_spi_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_spi_pm_ops, bcm63xx_spi_suspend, bcm63xx_spi_resume);
 
 static struct platform_driver bcm63xx_spi_driver = {
 	.driver = {
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · Dhruva Gole

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner without us explicitly needing to:

Quoted 8 lines

.suspend = bcm63xx_spi_suspend, \
.resume = bcm63xx_spi_resume, \
.freeze = bcm63xx_spi_suspend, \
.thaw = bcm63xx_spi_resume, \
.poweroff = bcm63xx_spi_suspend, \
.restore = bcm63xx_spi_resume

I think this should have an appropriate Fixes tag as it will fix a build warning when building with !CONFIG_PM after applying the previous patch.

Regards
Jonas

#2 lore raw

Hi Jonas,

Quoted 12 lines · Jonas Gorski
Quoted 11 lines · Dhruva Gole

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner without us explicitly needing to:

.suspend = bcm63xx_spi_suspend, \
.resume = bcm63xx_spi_resume, \
.freeze = bcm63xx_spi_suspend, \
.thaw = bcm63xx_spi_resume, \
.poweroff = bcm63xx_spi_suspend, \
.restore = bcm63xx_spi_resume

Quoted 4 lines
Quoted 1 line

I think this should have an appropriate Fixes tag as it will fix a build warning when building with !CONFIG_PM after applying the previous patch.

You mean these build issues that have been pointed here?

https://lore.kernel.org/all/[email protected]/

So I should add a fixes "spi: bcm63xx: remove PM_SLEEP based conditional compilation"

corresponding fixes tag?

Quoted 3 lines

Regards
Jonas

Signature · 2 lines
Regards,
Dhruva Gole <[email protected]>
maintainer
#3 lore raw
In reply to Dhruva Gole
Quoted 4 lines · Dhruva Gole

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner without us explicitly needing to:

Quoted 8 lines

.suspend = bcm63xx_spi_suspend, \
.resume = bcm63xx_spi_resume, \
.freeze = bcm63xx_spi_suspend, \
.thaw = bcm63xx_spi_resume, \
.poweroff = bcm63xx_spi_suspend, \
.restore = bcm63xx_spi_resume

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS

      commit: cc5f6fa4f6590e3b9eb8d34302ea43af4a3cfed7

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark