diff mbox series

spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS

Message ID 20230424102546.1604484-1-d-gole@ti.com
State Accepted
Commit cc5f6fa4f6590e3b9eb8d34302ea43af4a3cfed7
Headers show
Series spi: bcm63xx: use macro DEFINE_SIMPLE_DEV_PM_OPS | expand

Commit Message

Dhruva Gole April 24, 2023, 10:25 a.m. UTC
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

Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
 drivers/spi/spi-bcm63xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jonas Gorski April 25, 2023, 11:25 a.m. UTC | #1
On Mon, 24 Apr 2023 at 12:25, Dhruva Gole <d-gole@ti.com> wrote:
>
> 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
>
> Signed-off-by: Dhruva Gole <d-gole@ti.com>

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
Dhruva Gole April 25, 2023, 5:08 p.m. UTC | #2
Hi Jonas,

On 4/25/2023 4:55 PM, Jonas Gorski wrote:
> On Mon, 24 Apr 2023 at 12:25, Dhruva Gole <d-gole@ti.com> wrote:
>> 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
>>
>> Signed-off-by: Dhruva Gole <d-gole@ti.com>
> 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/8edb48ee-55a3-4cc2-9c81-514ec867b35c@roeck-us.net/

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

corresponding fixes tag?

>
> Regards
> Jonas
Mark Brown April 25, 2023, 5:23 p.m. UTC | #3
On Mon, 24 Apr 2023 15:55:46 +0530, Dhruva Gole wrote:
> 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
> 
> [...]

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
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 99395932074c..9aecb77c3d89 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -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 = {