spi: use modern PM macros
Subsystems (27)
cover spi: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or __maybe_unused.
Compiled testd for arm, arm64, riscv and riscv64 with below combinations:
!PM && !PM_SLEEP
PM && !PM_SLEEP
PM && PM_SLEEP
Jisheng Zhang (39):
spi: atmel-quadspi: use modern PM macros
spi: amlogic-spifc-a1: use modern PM macros
spi: at91-usart: use modern PM macros
spi: axiado: use modern PM macros
spi: bcm-qspi: use modern PM macros
spi: bcm63xx-hsspi: use modern PM macros
spi: bcmbca-hsspi: use modern PM macros
spi: cadence: use modern PM macros
spi: coldfire-qspi: use modern PM macros
spi: dln2: use modern PM macros
spi: dw-pci: use modern PM macros
spi: spi-fsl-dspi: use modern PM macros
spi: fsl-espi: use modern PM macros
spi: fsl-lpspi: use modern PM macros
spi: qcom-geni: use modern PM macros
spi: img-spfi: use modern PM macros
spi: loongson: use modern PM macros
spi: meson-spifc: use modern PM macros
spi: mt65xx: use modern PM macros
spi: mtk-nor: use modern PM macros
spi: mxic: use modern PM macros
spi: omap2-mcspi: use modern PM macros
spi: orion: use modern PM macros
spi: pl022: use modern PM macros
spi: spi-qcom-qspi: use modern PM macros
spi: qup: use modern PM macros
spi: rockchip-sfc: use modern PM macros
spi: rockchip: use modern PM macros
spi: s3c64xx: use modern PM macros
spi: slave-mt27xx: use modern PM macros
spi: sprd: use modern PM macros
spi: sunplus-sp7021: use modern PM macros
spi: syncuacer: use modern PM macros
spi: tegra114: use modern PM macros
spi: tegra20-sflash: use modern PM macros
spi: tegra20-slink: use modern PM macros
spi: tegra210-quad: use modern PM macros
spi: topcliff-pch: use modern PM macros
spi: zynqmp-gqspi: use modern PM macros
drivers/spi/atmel-quadspi.c | 16 +++++----- drivers/spi/spi-amlogic-spifc-a1.c | 15 ++++------ drivers/spi/spi-at91-usart.c | 8 ++--- drivers/spi/spi-axiado.c | 15 +++++----- drivers/spi/spi-bcm-qspi.c | 6 ++-- drivers/spi/spi-bcm63xx-hsspi.c | 8 ++--- drivers/spi/spi-bcmbca-hsspi.c | 8 ++--- drivers/spi/spi-brcmstb-qspi.c | 2 +- drivers/spi/spi-cadence.c | 15 +++++----- drivers/spi/spi-coldfire-qspi.c | 12 +++----- drivers/spi/spi-dln2.c | 11 ++----- drivers/spi/spi-dw-pci.c | 6 ++-- drivers/spi/spi-fsl-dspi.c | 6 ++-- drivers/spi/spi-fsl-espi.c | 11 ++----- drivers/spi/spi-fsl-lpspi.c | 6 ++-- drivers/spi/spi-geni-qcom.c | 15 +++++----- drivers/spi/spi-img-spfi.c | 11 ++----- drivers/spi/spi-iproc-qspi.c | 2 +- drivers/spi/spi-loongson-core.c | 4 +-- drivers/spi/spi-loongson-pci.c | 2 +- drivers/spi/spi-loongson-plat.c | 2 +- drivers/spi/spi-meson-spifc.c | 14 ++++----- drivers/spi/spi-mt65xx.c | 11 ++----- drivers/spi/spi-mtk-nor.c | 15 +++++----- drivers/spi/spi-mxic.c | 9 +++--- drivers/spi/spi-omap2-mcspi.c | 9 +++--- drivers/spi/spi-orion.c | 12 +++----- drivers/spi/spi-pl022.c | 10 ++----- drivers/spi/spi-qcom-qspi.c | 16 +++++----- drivers/spi/spi-qup.c | 14 ++++----- drivers/spi/spi-rockchip-sfc.c | 12 +++----- drivers/spi/spi-rockchip.c | 12 +++----- drivers/spi/spi-s3c64xx.c | 12 +++----- drivers/spi/spi-slave-mt27xx.c | 12 +++----- drivers/spi/spi-sprd.c | 9 +++--- drivers/spi/spi-sunplus-sp7021.c | 16 +++++----- drivers/spi/spi-synquacer.c | 10 +++---- drivers/spi/spi-tegra114.c | 10 +++---- drivers/spi/spi-tegra20-sflash.c | 10 +++---- drivers/spi/spi-tegra20-slink.c | 14 ++++----- drivers/spi/spi-tegra210-quad.c | 14 ++++----- drivers/spi/spi-topcliff-pch.c | 47 +++++++++++++----------------- drivers/spi/spi-zynqmp-gqspi.c | 15 +++++----- 43 files changed, 195 insertions(+), 289 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/39 spi: atmel-quadspi: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/atmel-quadspi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/spi/atmel-quadspi.c +8 -8
@@ -1527,7 +1527,7 @@ static void atmel_qspi_remove(struct platform_device *pdev) } } -static int __maybe_unused atmel_qspi_suspend (struct device *dev) +static int atmel_qspi_suspend (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct atmel_qspi *aq =spi_controller_get_devdata (ctrl);
@@ -1554,7 +1554,7 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev)return 0 ; } -static int __maybe_unused atmel_qspi_resume (struct device *dev) +static int atmel_qspi_resume (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct atmel_qspi *aq =spi_controller_get_devdata (ctrl);
@@ -1586,7 +1586,7 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)return 0 ; } -static int __maybe_unused atmel_qspi_runtime_suspend (struct device *dev) +static int atmel_qspi_runtime_suspend (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct atmel_qspi *aq =spi_controller_get_devdata (ctrl);
@@ -1597,7 +1597,7 @@ static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused atmel_qspi_runtime_resume (struct device *dev) +static int atmel_qspi_runtime_resume (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct atmel_qspi *aq =spi_controller_get_devdata (ctrl);
@@ -1614,10 +1614,10 @@ static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops __maybe_unused atmel_qspi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume) -SET_RUNTIME_PM_OPS (atmel_qspi_runtime_suspend, - atmel_qspi_runtime_resume,NULL ) +static const struct dev_pm_ops atmel_qspi_pm_ops = { + SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume) +RUNTIME_PM_OPS (atmel_qspi_runtime_suspend, + atmel_qspi_runtime_resume,NULL ) };static const struct atmel_qspi_caps atmel_sama5d2_qspi_caps = {};
Signature · 1 line
2.53.0
PATCH 2/39 spi: amlogic-spifc-a1: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-amlogic-spifc-a1.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/spi/spi-amlogic-spifc-a1.c +5 -10
@@ -374,7 +374,6 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM_SLEEP static int amlogic_spifc_a1_suspend (struct device *dev) {struct amlogic_spifc_a1 *spifc =dev_get_drvdata (dev);
@@ -409,9 +408,7 @@ static int amlogic_spifc_a1_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int amlogic_spifc_a1_runtime_suspend (struct device *dev) {struct amlogic_spifc_a1 *spifc =dev_get_drvdata (dev);
@@ -432,14 +429,12 @@ static int amlogic_spifc_a1_runtime_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops amlogic_spifc_a1_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend, - amlogic_spifc_a1_resume) -SET_RUNTIME_PM_OPS (amlogic_spifc_a1_runtime_suspend, - amlogic_spifc_a1_runtime_resume, -NULL ) + SYSTEM_SLEEP_PM_OPS(amlogic_spifc_a1_suspend, amlogic_spifc_a1_resume) +RUNTIME_PM_OPS (amlogic_spifc_a1_runtime_suspend, + amlogic_spifc_a1_runtime_resume, +NULL ) };#ifdef CONFIG_OF
@@ -455,7 +450,7 @@ static struct platform_driver amlogic_spifc_a1_driver = { .driver = { .name = "amlogic-spifc-a1", .of_match_table = of_match_ptr(amlogic_spifc_a1_dt_match), - .pm = &amlogic_spifc_a1_pm_ops, + .pm = pm_ptr(&amlogic_spifc_a1_pm_ops), }, };module_platform_driver (amlogic_spifc_a1_driver);
Signature · 1 line
2.53.0
PATCH 3/39 spi: at91-usart: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-at91-usart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-at91-usart.c +4 -4
@@ -571,7 +571,7 @@ static int at91_usart_spi_probe(struct platform_device *pdev)return ret; } -__maybe_unused static int at91_usart_spi_suspend (struct device *dev) +static int at91_usart_spi_suspend (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct at91_usart_spi *aus =spi_controller_get_devdata (ctrl);
@@ -587,7 +587,7 @@ __maybe_unused static int at91_usart_spi_suspend(struct device *dev)return 0 ; } -__maybe_unused static int at91_usart_spi_resume (struct device *dev) +static int at91_usart_spi_resume (struct device *dev) {struct spi_controller *ctrl =dev_get_drvdata (dev);struct at91_usart_spi *aus =spi_controller_get_devdata (ctrl);
@@ -616,13 +616,13 @@ static void at91_usart_spi_remove(struct platform_device *pdev) }static const struct dev_pm_ops at91_usart_spi_pm_ops = { -SET_SYSTEM_SLEEP_PM_OPS (at91_usart_spi_suspend, at91_usart_spi_resume) +SYSTEM_SLEEP_PM_OPS (at91_usart_spi_suspend, at91_usart_spi_resume) };static struct platform_driver at91_usart_spi_driver = { .driver = { .name ="at91_usart_spi" , - .pm = &at91_usart_spi_pm_ops, + .pm =pm_sleep_ptr (&at91_usart_spi_pm_ops), }, .probe = at91_usart_spi_probe, .remove = at91_usart_spi_remove,
Signature · 1 line
2.53.0
PATCH 4/39 spi: axiado: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-axiado.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/spi/spi-axiado.c +7 -8
@@ -902,7 +902,7 @@ static void ax_spi_remove(struct platform_device *pdev)* * Return: 0 on success and error value on error */ -static int __maybe_unused ax_spi_suspend (struct device *dev) +static int ax_spi_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -917,7 +917,7 @@ static int __maybe_unused ax_spi_suspend(struct device *dev)* * Return: 0 on success and error value on error */ -static int __maybe_unused ax_spi_resume (struct device *dev) +static int ax_spi_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct ax_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -934,7 +934,7 @@ static int __maybe_unused ax_spi_resume(struct device *dev)* * Return: 0 on success and error value on error */ -static int __maybe_unused ax_spi_runtime_resume (struct device *dev) +static int ax_spi_runtime_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct ax_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -963,7 +963,7 @@ static int __maybe_unused ax_spi_runtime_resume(struct device *dev)* * Return: Always 0 */ -static int __maybe_unused ax_spi_runtime_suspend (struct device *dev) +static int ax_spi_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct ax_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -975,9 +975,8 @@ static int __maybe_unused ax_spi_runtime_suspend(struct device *dev) }static const struct dev_pm_ops ax_spi_dev_pm_ops = { - SET_RUNTIME_PM_OPS(ax_spi_runtime_suspend, - ax_spi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (ax_spi_suspend, ax_spi_resume) + RUNTIME_PM_OPS(ax_spi_runtime_suspend, ax_spi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (ax_spi_suspend, ax_spi_resume) };static const struct of_device_id ax_spi_of_match[] = {
@@ -993,7 +992,7 @@ static struct platform_driver ax_spi_driver = { .driver = { .name = AX_SPI_NAME, .of_match_table = ax_spi_of_match, - .pm = &ax_spi_dev_pm_ops, + .pm = pm_ptr(&ax_spi_dev_pm_ops), }, };
Signature · 1 line
2.53.0
PATCH 5/39 spi: bcm-qspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-bcm-qspi.c | 6 +++--- drivers/spi/spi-brcmstb-qspi.c | 2 +- drivers/spi/spi-iproc-qspi.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/spi/spi-bcm-qspi.c +3 -3
@@ -1689,7 +1689,7 @@ void bcm_qspi_remove(struct platform_device *pdev)/* function to be called by SoC specific platform driver remove() */ EXPORT_SYMBOL_GPL (bcm_qspi_remove); -static int __maybe_unused bcm_qspi_suspend (struct device *dev) +static int bcm_qspi_suspend (struct device *dev) {struct bcm_qspi *qspi =dev_get_drvdata (dev);
@@ -1705,7 +1705,7 @@ static int __maybe_unused bcm_qspi_suspend(struct device *dev)return 0 ; }; -static int __maybe_unused bcm_qspi_resume (struct device *dev) +static int bcm_qspi_resume (struct device *dev) {struct bcm_qspi *qspi =dev_get_drvdata (dev);int ret =0 ;
@@ -1724,7 +1724,7 @@ static int __maybe_unused bcm_qspi_resume(struct device *dev)return ret; } -SIMPLE_DEV_PM_OPS (bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume); +DEFINE_SIMPLE_DEV_PM_OPS (bcm_qspi_pm_ops, bcm_qspi_suspend, bcm_qspi_resume);/* pm_ops to be called by SoC specific platform driver */ EXPORT_SYMBOL_GPL (bcm_qspi_pm_ops);
drivers/spi/spi-brcmstb-qspi.c +1 -1
@@ -31,7 +31,7 @@ static struct platform_driver brcmstb_qspi_driver = { .remove = brcmstb_qspi_remove, .driver = { .name = "brcmstb_qspi", - .pm = &bcm_qspi_pm_ops, + .pm = pm_sleep_ptr(&bcm_qspi_pm_ops), .of_match_table = brcmstb_qspi_of_match, } };
drivers/spi/spi-iproc-qspi.c +1 -1
@@ -141,7 +141,7 @@ static struct platform_driver bcm_iproc_driver = { .remove = bcm_iproc_remove, .driver = { .name = "bcm_iproc", - .pm = &bcm_qspi_pm_ops, + .pm = pm_sleep_ptr(&bcm_qspi_pm_ops), .of_match_table = bcm_iproc_of_match, } };
Signature · 1 line
2.53.0
PATCH 6/39 spi: bcm63xx-hsspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-bcm63xx-hsspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/spi/spi-bcm63xx-hsspi.c +3 -5
@@ -884,7 +884,6 @@ static void bcm63xx_hsspi_remove(struct platform_device *pdev)sysfs_remove_group (&pdev->dev.kobj, &bcm63xx_hsspi_group); } -#ifdef CONFIG_PM_SLEEP static int bcm63xx_hsspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -919,10 +918,9 @@ static int bcm63xx_hsspi_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend, - bcm63xx_hsspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend, + bcm63xx_hsspi_resume);static const struct of_device_id bcm63xx_hsspi_of_match[] = { { .compatible ="brcm,bcm6328-hsspi" , },
@@ -934,7 +932,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_hsspi_of_match);static struct platform_driver bcm63xx_hsspi_driver = { .driver = { .name ="bcm63xx-hsspi" , - .pm = &bcm63xx_hsspi_pm_ops, + .pm =pm_sleep_ptr (&bcm63xx_hsspi_pm_ops), .of_match_table = bcm63xx_hsspi_of_match, }, .probe = bcm63xx_hsspi_probe,
Signature · 1 line
2.53.0
Re: [PATCH 06/39] spi: bcm63xx-hsspi: use modern PM macros
Quoted 49 lines · Jisheng Zhang
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when
CONFIG_PMorCONFIG_PM_SLEEPare disabled, without having to use #ifdef guards.This has the advantage of always compiling these functions in, independently of any
Kconfigoption. Thanks to that, bugs and other regressions are subsequently easier to catch.Signed-off-by Jisheng Zhang <[email protected]>--- drivers/spi/spi-bcm63xx-hsspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/spi/spi-bcm63xx-hsspi.c +3
-6@@ -884,7 +884,6 @@ static void bcm63xx_hsspi_remove(struct platform_device *pdev)sysfs_remove_group (&pdev->dev.kobj, &bcm63xx_hsspi_group); } -#ifdef CONFIG_PM_SLEEP static int bcm63xx_hsspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);@@ -919,10 +918,9 @@ static int bcm63xx_hsspi_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend, - bcm63xx_hsspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend, + bcm63xx_hsspi_resume);static const struct of_device_id bcm63xx_hsspi_of_match[] = { { .compatible ="brcm,bcm6328-hsspi" , },@@ -934,7 +932,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_hsspi_of_match);static struct platform_driver bcm63xx_hsspi_driver = { .driver = { .name ="bcm63xx-hsspi" , - .pm = &bcm63xx_hsspi_pm_ops, + .pm =pm_sleep_ptr (&bcm63xx_hsspi_pm_ops), .of_match_table = bcm63xx_hsspi_of_match, }, .probe = bcm63xx_hsspi_probe, --
Quoted 2 lines
2.53.0
PATCH 7/39 spi: bcmbca-hsspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-bcmbca-hsspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/spi/spi-bcmbca-hsspi.c +3 -5
@@ -563,7 +563,6 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev)sysfs_remove_group (&pdev->dev.kobj, &bcmbca_hsspi_group); } -#ifdef CONFIG_PM_SLEEP static int bcmbca_hsspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -598,10 +597,9 @@ static int bcmbca_hsspi_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend, - bcmbca_hsspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend, + bcmbca_hsspi_resume);static const struct of_device_id bcmbca_hsspi_of_match[] = { { .compatible ="brcm,bcmbca-hsspi-v1.1" , },
@@ -613,7 +611,7 @@ MODULE_DEVICE_TABLE(of, bcmbca_hsspi_of_match);static struct platform_driver bcmbca_hsspi_driver = { .driver = { .name ="bcmbca-hsspi" , - .pm = &bcmbca_hsspi_pm_ops, + .pm =pm_sleep_ptr (&bcmbca_hsspi_pm_ops), .of_match_table = bcmbca_hsspi_of_match, }, .probe = bcmbca_hsspi_probe,
Signature · 1 line
2.53.0
Re: [PATCH 07/39] spi: bcmbca-hsspi: use modern PM macros
Quoted 49 lines · Jisheng Zhang
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when
CONFIG_PMorCONFIG_PM_SLEEPare disabled, without having to use #ifdef guards.This has the advantage of always compiling these functions in, independently of any
Kconfigoption. Thanks to that, bugs and other regressions are subsequently easier to catch.Signed-off-by Jisheng Zhang <[email protected]>--- drivers/spi/spi-bcmbca-hsspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/spi/spi-bcmbca-hsspi.c +3
-6@@ -563,7 +563,6 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev)sysfs_remove_group (&pdev->dev.kobj, &bcmbca_hsspi_group); } -#ifdef CONFIG_PM_SLEEP static int bcmbca_hsspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);@@ -598,10 +597,9 @@ static int bcmbca_hsspi_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend, - bcmbca_hsspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bcmbca_hsspi_pm_ops, bcmbca_hsspi_suspend, + bcmbca_hsspi_resume);static const struct of_device_id bcmbca_hsspi_of_match[] = { { .compatible ="brcm,bcmbca-hsspi-v1.1" , },@@ -613,7 +611,7 @@ MODULE_DEVICE_TABLE(of, bcmbca_hsspi_of_match);static struct platform_driver bcmbca_hsspi_driver = { .driver = { .name ="bcmbca-hsspi" , - .pm = &bcmbca_hsspi_pm_ops, + .pm =pm_sleep_ptr (&bcmbca_hsspi_pm_ops), .of_match_table = bcmbca_hsspi_of_match, }, .probe = bcmbca_hsspi_probe, --
Quoted 2 lines
2.53.0
PATCH 8/39 spi: cadence: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-cadence.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/spi/spi-cadence.c +7 -8
@@ -801,7 +801,7 @@ static void cdns_spi_remove(struct platform_device *pdev)* * Return: 0 on success and error value on error */ -static int __maybe_unused cdns_spi_suspend (struct device *dev) +static int cdns_spi_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -816,7 +816,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)* * Return: 0 on success and error value on error */ -static int __maybe_unused cdns_spi_resume (struct device *dev) +static int cdns_spi_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct cdns_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -833,7 +833,7 @@ static int __maybe_unused cdns_spi_resume(struct device *dev)* * Return: 0 on success and error value on error */ -static int __maybe_unused cdns_spi_runtime_resume (struct device *dev) +static int cdns_spi_runtime_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct cdns_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -862,7 +862,7 @@ static int __maybe_unused cdns_spi_runtime_resume(struct device *dev)* * Return: Always 0 */ -static int __maybe_unused cdns_spi_runtime_suspend (struct device *dev) +static int cdns_spi_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct cdns_spi *xspi =spi_controller_get_devdata (ctlr);
@@ -874,9 +874,8 @@ static int __maybe_unused cdns_spi_runtime_suspend(struct device *dev) }static const struct dev_pm_ops cdns_spi_dev_pm_ops = { - SET_RUNTIME_PM_OPS(cdns_spi_runtime_suspend, - cdns_spi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (cdns_spi_suspend, cdns_spi_resume) + RUNTIME_PM_OPS(cdns_spi_runtime_suspend, cdns_spi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (cdns_spi_suspend, cdns_spi_resume) };static const struct of_device_id cdns_spi_of_match[] = {
@@ -894,7 +893,7 @@ static struct platform_driver cdns_spi_driver = { .driver = { .name = CDNS_SPI_NAME, .of_match_table = cdns_spi_of_match, - .pm = &cdns_spi_dev_pm_ops, + .pm = pm_ptr(&cdns_spi_dev_pm_ops), }, };
Signature · 1 line
2.53.0
PATCH 9/39 spi: coldfire-qspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-coldfire-qspi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-coldfire-qspi.c +4 -8
@@ -437,7 +437,6 @@ static void mcfqspi_remove(struct platform_device *pdev)mcfqspi_cs_teardown (mcfqspi); } -#ifdef CONFIG_PM_SLEEP static int mcfqspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -462,9 +461,7 @@ static int mcfqspi_resume(struct device *dev)return spi_controller_resume (host); } -#endif -#ifdef CONFIG_PM static int mcfqspi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -484,17 +481,16 @@ static int mcfqspi_runtime_resume(struct device *dev)return 0 ; } -#endif static const struct dev_pm_ops mcfqspi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume) -SET_RUNTIME_PM_OPS (mcfqspi_runtime_suspend, mcfqspi_runtime_resume, -NULL ) + SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume) +RUNTIME_PM_OPS (mcfqspi_runtime_suspend, mcfqspi_runtime_resume, +NULL ) };static struct platform_driver mcfqspi_driver = { .driver.name =DRIVER_NAME , - .driver.pm = &mcfqspi_pm, + .driver.pm =pm_ptr (&mcfqspi_pm), .probe = mcfqspi_probe, .remove = mcfqspi_remove, };
Signature · 1 line
2.53.0
PATCH 10/39 spi: dln2: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-dln2.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/spi/spi-dln2.c +3 -8
@@ -787,7 +787,6 @@ static void dln2_spi_remove(struct platform_device *pdev)dev_err (&pdev->dev,"Failed to disable SPI module\n" ); } -#ifdef CONFIG_PM_SLEEP static int dln2_spi_suspend (struct device *dev) {int ret;
@@ -834,9 +833,7 @@ static int dln2_spi_resume(struct device *dev)return spi_controller_resume (host); } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int dln2_spi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -852,18 +849,16 @@ static int dln2_spi_runtime_resume(struct device *dev)return dln2_spi_enable (dln2, true); } -#endif /* CONFIG_PM */ static const struct dev_pm_ops dln2_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume) -SET_RUNTIME_PM_OPS (dln2_spi_runtime_suspend, - dln2_spi_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume) +RUNTIME_PM_OPS (dln2_spi_runtime_suspend, dln2_spi_runtime_resume,NULL ) };static struct platform_driver spi_dln2_driver = { .driver = { .name ="dln2-spi" , - .pm = &dln2_spi_pm, + .pm =pm_ptr (&dln2_spi_pm), }, .probe = dln2_spi_probe, .remove = dln2_spi_remove,
Signature · 1 line
2.53.0
PATCH 11/39 spi: dw-pci: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-dw-pci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/spi/spi-dw-pci.c +2 -4
@@ -154,7 +154,6 @@ static void dw_spi_pci_remove(struct pci_dev *pdev)dw_spi_remove_controller (dws); } -#ifdef CONFIG_PM_SLEEP static int dw_spi_pci_suspend (struct device *dev) {struct dw_spi *dws =dev_get_drvdata (dev);
@@ -168,9 +167,8 @@ static int dw_spi_pci_resume(struct device *dev)return dw_spi_resume_controller (dws); } -#endif -static SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(dw_spi_pci_pm_ops, dw_spi_pci_suspend, dw_spi_pci_resume);static const struct pci_device_id dw_spi_pci_ids[] = {/* Intel MID platform SPI controller 0 */
@@ -197,7 +195,7 @@ static struct pci_driver dw_spi_pci_driver = { .probe = dw_spi_pci_probe, .remove = dw_spi_pci_remove, .driver = { - .pm = &dw_spi_pci_pm_ops, + .pm = pm_sleep_ptr(&dw_spi_pci_pm_ops), }, };module_pci_driver (dw_spi_pci_driver);
Signature · 1 line
2.53.0
PATCH 12/39 spi: spi-fsl-dspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-fsl-dspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/spi/spi-fsl-dspi.c +2 -4
@@ -1460,7 +1460,6 @@ static int dspi_init(struct fsl_dspi *dspi)return 0 ; } -#ifdef CONFIG_PM_SLEEP static int dspi_suspend (struct device *dev) {struct fsl_dspi *dspi =dev_get_drvdata (dev);
@@ -1500,9 +1499,8 @@ static int dspi_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);static int dspi_target_abort (struct spi_controller *host) {
@@ -1727,7 +1725,7 @@ static void dspi_shutdown(struct platform_device *pdev)static struct platform_driver fsl_dspi_driver = { .driver.name =DRIVER_NAME , .driver.of_match_table = fsl_dspi_dt_ids, - .driver.pm = &dspi_pm, + .driver.pm =pm_sleep_ptr (&dspi_pm), .probe = dspi_probe, .remove = dspi_remove, .shutdown = dspi_shutdown,
Signature · 1 line
2.53.0
PATCH 13/39 spi: fsl-espi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-fsl-espi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/spi/spi-fsl-espi.c +3 -8
@@ -580,7 +580,6 @@ static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)return IRQ_HANDLED ; } -#ifdef CONFIG_PM static int fsl_espi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -606,7 +605,6 @@ static int fsl_espi_runtime_resume(struct device *dev)return 0 ; } -#endif static size_t fsl_espi_max_message_size (struct spi_device *spi) {
@@ -785,7 +783,6 @@ static void of_fsl_espi_remove(struct platform_device *dev)pm_runtime_disable (&dev->dev); } -#ifdef CONFIG_PM_SLEEP static int of_fsl_espi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -811,12 +808,10 @@ static int of_fsl_espi_resume(struct device *dev)return spi_controller_resume (host); } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops espi_pm = { - SET_RUNTIME_PM_OPS(fsl_espi_runtime_suspend, - fsl_espi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (of_fsl_espi_suspend, of_fsl_espi_resume) + RUNTIME_PM_OPS(fsl_espi_runtime_suspend, fsl_espi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (of_fsl_espi_suspend, of_fsl_espi_resume) };static const struct of_device_id of_fsl_espi_match[] = {
@@ -829,7 +824,7 @@ static struct platform_driver fsl_espi_driver = { .driver = { .name = "fsl_espi", .of_match_table = of_fsl_espi_match, - .pm = &espi_pm, + .pm = pm_ptr(&espi_pm), }, .probe = of_fsl_espi_probe, .remove = of_fsl_espi_remove,
Signature · 1 line
2.53.0
PATCH 14/39 spi: fsl-lpspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-fsl-lpspi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/spi/spi-fsl-lpspi.c +2 -4
@@ -842,7 +842,6 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id)return IRQ_NONE ; } -#ifdef CONFIG_PM static int fsl_lpspi_runtime_resume (struct device *dev) {struct spi_controller *controller =dev_get_drvdata (dev);
@@ -876,7 +875,6 @@ static int fsl_lpspi_runtime_suspend(struct device *dev)return 0 ; } -#endif static int fsl_lpspi_init_rpm (struct fsl_lpspi_data *fsl_lpspi) {
@@ -1056,8 +1054,8 @@ static int fsl_lpspi_resume(struct device *dev) }static const struct dev_pm_ops fsl_lpspi_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend, - fsl_lpspi_runtime_resume, NULL) + RUNTIME_PM_OPS(fsl_lpspi_runtime_suspend, + fsl_lpspi_runtime_resume, NULL)SYSTEM_SLEEP_PM_OPS (fsl_lpspi_suspend, fsl_lpspi_resume) };
Signature · 1 line
2.53.0
PATCH 15/39 spi: qcom-geni: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-geni-qcom.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/spi/spi-geni-qcom.c +7 -8
@@ -1150,7 +1150,7 @@ static int spi_geni_probe(struct platform_device *pdev)return devm_spi_register_controller (dev, spi); } -static int __maybe_unused spi_geni_runtime_suspend (struct device *dev) +static int spi_geni_runtime_suspend (struct device *dev) {struct spi_controller *spi =dev_get_drvdata (dev);struct spi_geni_master *mas =spi_controller_get_devdata (spi);
@@ -1166,7 +1166,7 @@ static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)return geni_icc_disable (&mas->se); } -static int __maybe_unused spi_geni_runtime_resume (struct device *dev) +static int spi_geni_runtime_resume (struct device *dev) {struct spi_controller *spi =dev_get_drvdata (dev);struct spi_geni_master *mas =spi_controller_get_devdata (spi);
@@ -1183,7 +1183,7 @@ static int __maybe_unused spi_geni_runtime_resume(struct device *dev)return dev_pm_opp_set_rate (mas->dev, mas->cur_sclk_hz); } -static int __maybe_unused spi_geni_suspend (struct device *dev) +static int spi_geni_suspend (struct device *dev) {struct spi_controller *spi =dev_get_drvdata (dev);int ret;
@@ -1199,7 +1199,7 @@ static int __maybe_unused spi_geni_suspend(struct device *dev)return ret; } -static int __maybe_unused spi_geni_resume (struct device *dev) +static int spi_geni_resume (struct device *dev) {struct spi_controller *spi =dev_get_drvdata (dev);int ret;
@@ -1216,9 +1216,8 @@ static int __maybe_unused spi_geni_resume(struct device *dev) }static const struct dev_pm_ops spi_geni_pm_ops = { - SET_RUNTIME_PM_OPS(spi_geni_runtime_suspend, - spi_geni_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (spi_geni_suspend, spi_geni_resume) + RUNTIME_PM_OPS(spi_geni_runtime_suspend, spi_geni_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (spi_geni_suspend, spi_geni_resume) };static const struct of_device_id spi_geni_dt_match[] = {
@@ -1231,7 +1230,7 @@ static struct platform_driver spi_geni_driver = { .probe = spi_geni_probe, .driver = { .name = "geni_spi", - .pm = &spi_geni_pm_ops, + .pm = pm_ptr(&spi_geni_pm_ops), .of_match_table = spi_geni_dt_match, }, };
Signature · 1 line
2.53.0
PATCH 16/39 spi: img-spfi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-img-spfi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/spi/spi-img-spfi.c +3 -8
@@ -677,7 +677,6 @@ static void img_spfi_remove(struct platform_device *pdev) } } -#ifdef CONFIG_PM static int img_spfi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -706,9 +705,7 @@ static int img_spfi_runtime_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP static int img_spfi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -730,12 +727,10 @@ static int img_spfi_resume(struct device *dev)return spi_controller_resume (host); } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops img_spfi_pm_ops = { - SET_RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, - NULL) -SET_SYSTEM_SLEEP_PM_OPS (img_spfi_suspend, img_spfi_resume) + RUNTIME_PM_OPS(img_spfi_runtime_suspend, img_spfi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (img_spfi_suspend, img_spfi_resume) };static const struct of_device_id img_spfi_of_match[] = {
@@ -747,7 +742,7 @@ MODULE_DEVICE_TABLE(of, img_spfi_of_match);static struct platform_driver img_spfi_driver = { .driver = { .name ="img-spfi" , - .pm = &img_spfi_pm_ops, + .pm =pm_ptr (&img_spfi_pm_ops), .of_match_table =of_match_ptr (img_spfi_of_match), }, .probe = img_spfi_probe,
Signature · 1 line
2.53.0
PATCH 17/39 spi: loongson: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-loongson-core.c | 4 ++-- drivers/spi/spi-loongson-pci.c | 2 +- drivers/spi/spi-loongson-plat.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-loongson-core.c +2 -2
@@ -229,7 +229,7 @@ int loongson_spi_init_controller(struct device *dev, void __iomem *regs) }EXPORT_SYMBOL_NS_GPL (loongson_spi_init_controller,"SPI_LOONGSON_CORE" ); -static int __maybe_unused loongson_spi_suspend (struct device *dev) +static int loongson_spi_suspend (struct device *dev) {struct loongson_spi *loongson_spi;struct spi_controller *controller;
@@ -249,7 +249,7 @@ static int __maybe_unused loongson_spi_suspend(struct device *dev)return 0 ; } -static int __maybe_unused loongson_spi_resume (struct device *dev) +static int loongson_spi_resume (struct device *dev) {struct loongson_spi *loongson_spi;struct spi_controller *controller;
drivers/spi/spi-loongson-pci.c +1 -1
@@ -43,7 +43,7 @@ static struct pci_driver loongson_spi_pci_driver = { .probe = loongson_spi_pci_register, .driver = { .bus = &pci_bus_type, - .pm = &loongson_spi_dev_pm_ops, + .pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops), }, };module_pci_driver (loongson_spi_pci_driver);
drivers/spi/spi-loongson-plat.c +1 -1
@@ -35,7 +35,7 @@ static struct platform_driver loongson_spi_plat_driver = { .driver = { .name = "loongson-spi", .bus = &platform_bus_type, - .pm = &loongson_spi_dev_pm_ops, + .pm = pm_sleep_ptr(&loongson_spi_dev_pm_ops), .of_match_table = loongson_spi_id_table, }, };
Signature · 1 line
2.53.0
PATCH 18/39 spi: meson-spifc: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-meson-spifc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/spi/spi-meson-spifc.c +5 -9
@@ -348,7 +348,6 @@ static void meson_spifc_remove(struct platform_device *pdev)pm_runtime_put_noidle (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int meson_spifc_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -385,9 +384,7 @@ static int meson_spifc_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int meson_spifc_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -405,13 +402,12 @@ static int meson_spifc_runtime_resume(struct device *dev)return clk_prepare_enable (spifc->clk); } -#endif /* CONFIG_PM */ static const struct dev_pm_ops meson_spifc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume) -SET_RUNTIME_PM_OPS (meson_spifc_runtime_suspend, - meson_spifc_runtime_resume, -NULL ) + SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume) +RUNTIME_PM_OPS (meson_spifc_runtime_suspend, + meson_spifc_runtime_resume, +NULL ) };static const struct of_device_id meson_spifc_dt_match[] = {
@@ -427,7 +423,7 @@ static struct platform_driver meson_spifc_driver = { .driver = { .name = "meson-spifc", .of_match_table = of_match_ptr(meson_spifc_dt_match), - .pm = &meson_spifc_pm_ops, + .pm = pm_ptr(&meson_spifc_pm_ops), }, };
Signature · 1 line
2.53.0
PATCH 19/39 spi: mt65xx: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-mt65xx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/spi/spi-mt65xx.c +3 -8
@@ -1367,7 +1367,6 @@ static void mtk_spi_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int mtk_spi_suspend (struct device *dev) {int ret;
@@ -1419,9 +1418,7 @@ static int mtk_spi_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int mtk_spi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -1473,18 +1470,16 @@ static int mtk_spi_runtime_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops mtk_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume) -SET_RUNTIME_PM_OPS (mtk_spi_runtime_suspend, - mtk_spi_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(mtk_spi_suspend, mtk_spi_resume) +RUNTIME_PM_OPS (mtk_spi_runtime_suspend, mtk_spi_runtime_resume,NULL ) };static struct platform_driver mtk_spi_driver = { .driver = { .name ="mtk-spi" , - .pm = &mtk_spi_pm, + .pm =pm_ptr (&mtk_spi_pm), .of_match_table = mtk_spi_of_match, }, .probe = mtk_spi_probe,
Signature · 1 line
2.53.0
PATCH 20/39 spi: mtk-nor: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-mtk-nor.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/spi/spi-mtk-nor.c +7 -8
@@ -947,7 +947,7 @@ static void mtk_nor_remove(struct platform_device *pdev)mtk_nor_disable_clk (sp); } -static int __maybe_unused mtk_nor_runtime_suspend (struct device *dev) +static int mtk_nor_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct mtk_nor *sp =spi_controller_get_devdata (ctlr);
@@ -957,7 +957,7 @@ static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused mtk_nor_runtime_resume (struct device *dev) +static int mtk_nor_runtime_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct mtk_nor *sp =spi_controller_get_devdata (ctlr);
@@ -965,12 +965,12 @@ static int __maybe_unused mtk_nor_runtime_resume(struct device *dev)return mtk_nor_enable_clk (sp); } -static int __maybe_unused mtk_nor_suspend (struct device *dev) +static int mtk_nor_suspend (struct device *dev) {return pm_runtime_force_suspend (dev); } -static int __maybe_unused mtk_nor_resume (struct device *dev) +static int mtk_nor_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct mtk_nor *sp =spi_controller_get_devdata (ctlr);
@@ -986,16 +986,15 @@ static int __maybe_unused mtk_nor_resume(struct device *dev) }static const struct dev_pm_ops mtk_nor_pm_ops = { - SET_RUNTIME_PM_OPS(mtk_nor_runtime_suspend, - mtk_nor_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (mtk_nor_suspend, mtk_nor_resume) + RUNTIME_PM_OPS(mtk_nor_runtime_suspend, mtk_nor_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (mtk_nor_suspend, mtk_nor_resume) };static struct platform_driver mtk_nor_driver = { .driver = { .name =DRIVER_NAME , .of_match_table = mtk_nor_match, - .pm = &mtk_nor_pm_ops, + .pm =pm_ptr (&mtk_nor_pm_ops), }, .probe = mtk_nor_probe, .remove = mtk_nor_remove,
Signature · 1 line
2.53.0
PATCH 21/39 spi: mxic: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-mxic.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/spi/spi-mxic.c +4 -5
@@ -721,7 +721,7 @@ static int mxic_spi_mem_ecc_probe(struct platform_device *pdev,return 0 ; } -static int __maybe_unused mxic_spi_runtime_suspend (struct device *dev) +static int mxic_spi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct mxic_spi *mxic =spi_controller_get_devdata (host);
@@ -732,7 +732,7 @@ static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused mxic_spi_runtime_resume (struct device *dev) +static int mxic_spi_runtime_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct mxic_spi *mxic =spi_controller_get_devdata (host);
@@ -748,8 +748,7 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev) }static const struct dev_pm_ops mxic_spi_dev_pm_ops = { -SET_RUNTIME_PM_OPS (mxic_spi_runtime_suspend, - mxic_spi_runtime_resume,NULL ) +RUNTIME_PM_OPS (mxic_spi_runtime_suspend, mxic_spi_runtime_resume,NULL ) };static int mxic_spi_probe (struct platform_device *pdev)
@@ -850,7 +849,7 @@ static struct platform_driver mxic_spi_driver = { .driver = { .name = "mxic-spi", .of_match_table = mxic_spi_of_ids, - .pm = &mxic_spi_dev_pm_ops, + .pm = pm_ptr(&mxic_spi_dev_pm_ops), }, };module_platform_driver (mxic_spi_driver);
Signature · 1 line
2.53.0
PATCH 22/39 spi: omap2-mcspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-omap2-mcspi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/spi/spi-omap2-mcspi.c +4 -5
@@ -1620,7 +1620,7 @@ static void omap2_mcspi_remove(struct platform_device *pdev)/* work with hotplug and coldplug */ MODULE_ALIAS ("platform:omap2_mcspi" ); -static int __maybe_unused omap2_mcspi_suspend (struct device *dev) +static int omap2_mcspi_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct omap2_mcspi *mcspi =spi_controller_get_devdata (ctlr);
@@ -1639,7 +1639,7 @@ static int __maybe_unused omap2_mcspi_suspend(struct device *dev)return pm_runtime_force_suspend (dev); } -static int __maybe_unused omap2_mcspi_resume (struct device *dev) +static int omap2_mcspi_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct omap2_mcspi *mcspi =spi_controller_get_devdata (ctlr);
@@ -1654,8 +1654,7 @@ static int __maybe_unused omap2_mcspi_resume(struct device *dev) }static const struct dev_pm_ops omap2_mcspi_pm_ops = { -SET_SYSTEM_SLEEP_PM_OPS (omap2_mcspi_suspend, - omap2_mcspi_resume) +SYSTEM_SLEEP_PM_OPS (omap2_mcspi_suspend, omap2_mcspi_resume) .runtime_suspend = omap_mcspi_runtime_suspend, .runtime_resume = omap_mcspi_runtime_resume, };
@@ -1663,7 +1662,7 @@ static const struct dev_pm_ops omap2_mcspi_pm_ops = {static struct platform_driver omap2_mcspi_driver = { .driver = { .name ="omap2_mcspi" , - .pm = &omap2_mcspi_pm_ops, + .pm =pm_ptr (&omap2_mcspi_pm_ops), .of_match_table = omap_mcspi_of_match, }, .probe = omap2_mcspi_probe,
Signature · 1 line
2.53.0
PATCH 23/39 spi: orion: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-orion.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-orion.c +4 -8
@@ -100,10 +100,8 @@ struct orion_spi {struct orion_child_options child[ORION_NUM_CHIPSELECTS ]; }; -#ifdef CONFIG_PM static int orion_spi_runtime_suspend (struct device *dev);static int orion_spi_runtime_resume (struct device *dev); -#endif static inline void __iomem *spi_reg (struct orion_spi *orion_spi,u32 reg) {
@@ -814,7 +812,6 @@ static void orion_spi_remove(struct platform_device *pdev)MODULE_ALIAS ("platform:" DRIVER_NAME ); -#ifdef CONFIG_PM static int orion_spi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -834,18 +831,17 @@ static int orion_spi_runtime_resume(struct device *dev)clk_prepare_enable (spi->axi_clk);return clk_prepare_enable (spi->clk); } -#endif static const struct dev_pm_ops orion_spi_pm_ops = { -SET_RUNTIME_PM_OPS (orion_spi_runtime_suspend, - orion_spi_runtime_resume, -NULL ) +RUNTIME_PM_OPS (orion_spi_runtime_suspend, + orion_spi_runtime_resume, +NULL ) };static struct platform_driver orion_spi_driver = { .driver = { .name =DRIVER_NAME , - .pm = &orion_spi_pm_ops, + .pm =pm_ptr (&orion_spi_pm_ops), .of_match_table =of_match_ptr (orion_spi_of_match_table), }, .probe = orion_spi_probe,
Signature · 1 line
2.53.0
PATCH 24/39 spi: pl022: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-pl022.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/spi/spi-pl022.c +3 -7
@@ -2011,7 +2011,6 @@ pl022_remove(struct amba_device *adev)amba_release_regions (adev); } -#ifdef CONFIG_PM_SLEEP static int pl022_suspend (struct device *dev) {struct pl022 *pl022 =dev_get_drvdata (dev);
@@ -2049,9 +2048,7 @@ static int pl022_resume(struct device *dev)return ret; } -#endif -#ifdef CONFIG_PM static int pl022_runtime_suspend (struct device *dev) {struct pl022 *pl022 =dev_get_drvdata (dev);
@@ -2071,11 +2068,10 @@ static int pl022_runtime_resume(struct device *dev)return 0 ; } -#endif static const struct dev_pm_ops pl022_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) -SET_RUNTIME_PM_OPS (pl022_runtime_suspend, pl022_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(pl022_suspend, pl022_resume) +RUNTIME_PM_OPS (pl022_runtime_suspend, pl022_runtime_resume,NULL ) };static struct vendor_data vendor_arm = {
@@ -2166,7 +2162,7 @@ MODULE_DEVICE_TABLE(amba, pl022_ids);static struct amba_driver pl022_driver = { .drv = { .name ="ssp-pl022" , - .pm = &pl022_dev_pm_ops, + .pm =pm_ptr (&pl022_dev_pm_ops), }, .id_table = pl022_ids, .probe = pl022_probe,
Signature · 1 line
2.53.0
PATCH 25/39 spi: spi-qcom-qspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-qcom-qspi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/spi/spi-qcom-qspi.c +8 -8
@@ -828,7 +828,7 @@ static void qcom_qspi_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -static int __maybe_unused qcom_qspi_runtime_suspend (struct device *dev) +static int qcom_qspi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct qcom_qspi *ctrl =spi_controller_get_devdata (host);
@@ -872,7 +872,7 @@ static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)return ret; } -static int __maybe_unused qcom_qspi_runtime_resume (struct device *dev) +static int qcom_qspi_runtime_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct qcom_qspi *ctrl =spi_controller_get_devdata (host);
@@ -916,7 +916,7 @@ static int __maybe_unused qcom_qspi_runtime_resume(struct device *dev)return ret; } -static int __maybe_unused qcom_qspi_suspend (struct device *dev) +static int qcom_qspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);int ret;
@@ -932,7 +932,7 @@ static int __maybe_unused qcom_qspi_suspend(struct device *dev)return ret; } -static int __maybe_unused qcom_qspi_resume (struct device *dev) +static int qcom_qspi_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);int ret;
@@ -949,9 +949,9 @@ static int __maybe_unused qcom_qspi_resume(struct device *dev) }static const struct dev_pm_ops qcom_qspi_dev_pm_ops = { - SET_RUNTIME_PM_OPS(qcom_qspi_runtime_suspend, - qcom_qspi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (qcom_qspi_suspend, qcom_qspi_resume) + RUNTIME_PM_OPS(qcom_qspi_runtime_suspend, + qcom_qspi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (qcom_qspi_suspend, qcom_qspi_resume) };static const struct of_device_id qcom_qspi_dt_match[] = {
@@ -963,7 +963,7 @@ MODULE_DEVICE_TABLE(of, qcom_qspi_dt_match);static struct platform_driver qcom_qspi_driver = { .driver = { .name ="qcom_qspi" , - .pm = &qcom_qspi_dev_pm_ops, + .pm =pm_ptr (&qcom_qspi_dev_pm_ops), .of_match_table = qcom_qspi_dt_match, }, .probe = qcom_qspi_probe,
Signature · 1 line
2.53.0
PATCH 26/39 spi: qup: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-qup.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/spi/spi-qup.c +5 -9
@@ -1211,7 +1211,6 @@ static int spi_qup_probe(struct platform_device *pdev)return ret; } -#ifdef CONFIG_PM static int spi_qup_pm_suspend_runtime (struct device *device) {struct spi_controller *host =dev_get_drvdata (device);
@@ -1253,9 +1252,7 @@ static int spi_qup_pm_resume_runtime(struct device *device)writel_relaxed (config, controller->base +QUP_CONFIG );return 0 ; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP static int spi_qup_suspend (struct device *device) {struct spi_controller *host =dev_get_drvdata (device);
@@ -1312,7 +1309,6 @@ static int spi_qup_resume(struct device *device)clk_disable_unprepare (controller->iclk);return ret; } -#endif /* CONFIG_PM_SLEEP */ static void spi_qup_remove (struct platform_device *pdev) {
@@ -1352,16 +1348,16 @@ static const struct of_device_id spi_qup_dt_match[] = {MODULE_DEVICE_TABLE (of, spi_qup_dt_match);static const struct dev_pm_ops spi_qup_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume) -SET_RUNTIME_PM_OPS (spi_qup_pm_suspend_runtime, - spi_qup_pm_resume_runtime, -NULL ) + SYSTEM_SLEEP_PM_OPS(spi_qup_suspend, spi_qup_resume) +RUNTIME_PM_OPS (spi_qup_pm_suspend_runtime, + spi_qup_pm_resume_runtime, +NULL ) };static struct platform_driver spi_qup_driver = { .driver = { .name ="spi_qup" , - .pm = &spi_qup_dev_pm_ops, + .pm =pm_ptr (&spi_qup_dev_pm_ops), .of_match_table = spi_qup_dt_match, }, .probe = spi_qup_probe,
Signature · 1 line
2.53.0
PATCH 27/39 spi: rockchip-sfc: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-rockchip-sfc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-rockchip-sfc.c +4 -8
@@ -751,7 +751,6 @@ static void rockchip_sfc_remove(struct platform_device *pdev)clk_disable_unprepare (sfc->hclk); } -#ifdef CONFIG_PM static int rockchip_sfc_runtime_suspend (struct device *dev) {struct rockchip_sfc *sfc =dev_get_drvdata (dev);
@@ -777,9 +776,7 @@ static int rockchip_sfc_runtime_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP static int rockchip_sfc_suspend (struct device *dev) {pinctrl_pm_select_sleep_state (dev);
@@ -810,12 +807,11 @@ static int rockchip_sfc_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops rockchip_sfc_pm_ops = { - SET_RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend, - rockchip_sfc_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (rockchip_sfc_suspend, rockchip_sfc_resume) + RUNTIME_PM_OPS(rockchip_sfc_runtime_suspend, + rockchip_sfc_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (rockchip_sfc_suspend, rockchip_sfc_resume) };static const struct of_device_id rockchip_sfc_dt_ids[] = {
@@ -828,7 +824,7 @@ static struct platform_driver rockchip_sfc_driver = { .driver = { .name = "rockchip-sfc", .of_match_table = rockchip_sfc_dt_ids, - .pm = &rockchip_sfc_pm_ops, + .pm = pm_ptr(&rockchip_sfc_pm_ops), }, .probe = rockchip_sfc_probe, .remove = rockchip_sfc_remove,
Signature · 1 line
2.53.0
PATCH 28/39 spi: rockchip: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-rockchip.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-rockchip.c +4 -8
@@ -938,7 +938,6 @@ static void rockchip_spi_remove(struct platform_device *pdev)dma_release_channel (ctlr->dma_rx); } -#ifdef CONFIG_PM_SLEEP static int rockchip_spi_suspend (struct device *dev) {int ret;
@@ -972,9 +971,7 @@ static int rockchip_spi_resume(struct device *dev)return spi_controller_resume (ctlr); } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int rockchip_spi_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -1002,12 +999,11 @@ static int rockchip_spi_runtime_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops rockchip_spi_pm = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) -SET_RUNTIME_PM_OPS (rockchip_spi_runtime_suspend, - rockchip_spi_runtime_resume,NULL ) + NOIRQ_SYSTEM_SLEEP_PM_OPS(rockchip_spi_suspend, rockchip_spi_resume) +RUNTIME_PM_OPS (rockchip_spi_runtime_suspend, + rockchip_spi_runtime_resume,NULL ) };static const struct of_device_id rockchip_spi_dt_match[] = {
@@ -1030,7 +1026,7 @@ MODULE_DEVICE_TABLE(of, rockchip_spi_dt_match);static struct platform_driver rockchip_spi_driver = { .driver = { .name =DRIVER_NAME , - .pm = &rockchip_spi_pm, + .pm =pm_ptr (&rockchip_spi_pm), .of_match_table =of_match_ptr (rockchip_spi_dt_match), }, .probe = rockchip_spi_probe,
Signature · 1 line
2.53.0
PATCH 29/39 spi: s3c64xx: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-s3c64xx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-s3c64xx.c +4 -8
@@ -1408,7 +1408,6 @@ static void s3c64xx_spi_remove(struct platform_device *pdev)pm_runtime_set_suspended (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int s3c64xx_spi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -1444,9 +1443,7 @@ static int s3c64xx_spi_resume(struct device *dev)return spi_controller_resume (host); } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int s3c64xx_spi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -1494,12 +1491,11 @@ static int s3c64xx_spi_runtime_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops s3c64xx_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume) -SET_RUNTIME_PM_OPS (s3c64xx_spi_runtime_suspend, - s3c64xx_spi_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(s3c64xx_spi_suspend, s3c64xx_spi_resume) +RUNTIME_PM_OPS (s3c64xx_spi_runtime_suspend, + s3c64xx_spi_runtime_resume,NULL ) };static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
@@ -1655,7 +1651,7 @@ MODULE_DEVICE_TABLE(of, s3c64xx_spi_dt_match);static struct platform_driver s3c64xx_spi_driver = { .driver = { .name ="s3c64xx-spi" , - .pm = &s3c64xx_spi_pm, + .pm =pm_ptr (&s3c64xx_spi_pm), .of_match_table =of_match_ptr (s3c64xx_spi_dt_match), }, .probe = s3c64xx_spi_probe,
Signature · 1 line
2.53.0
PATCH 30/39 spi: slave-mt27xx: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-slave-mt27xx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-slave-mt27xx.c +4 -8
@@ -471,7 +471,6 @@ static void mtk_spi_slave_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int mtk_spi_slave_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -508,9 +507,7 @@ static int mtk_spi_slave_resume(struct device *dev)return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int mtk_spi_slave_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -535,18 +532,17 @@ static int mtk_spi_slave_runtime_resume(struct device *dev)return 0 ; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops mtk_spi_slave_pm = { - SET_SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume) -SET_RUNTIME_PM_OPS (mtk_spi_slave_runtime_suspend, - mtk_spi_slave_runtime_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(mtk_spi_slave_suspend, mtk_spi_slave_resume) +RUNTIME_PM_OPS (mtk_spi_slave_runtime_suspend, + mtk_spi_slave_runtime_resume,NULL ) };static struct platform_driver mtk_spi_slave_driver = { .driver = { .name ="mtk-spi-slave" , - .pm = &mtk_spi_slave_pm, + .pm =pm_ptr (&mtk_spi_slave_pm), .of_match_table = mtk_spi_slave_of_match, }, .probe = mtk_spi_slave_probe,
Signature · 1 line
2.53.0
PATCH 31/39 spi: sprd: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-sprd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/spi/spi-sprd.c +4 -5
@@ -1016,7 +1016,7 @@ static void sprd_spi_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -static int __maybe_unused sprd_spi_runtime_suspend (struct device *dev) +static int sprd_spi_runtime_suspend (struct device *dev) {struct spi_controller *sctlr =dev_get_drvdata (dev);struct sprd_spi *ss =spi_controller_get_devdata (sctlr);
@@ -1029,7 +1029,7 @@ static int __maybe_unused sprd_spi_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused sprd_spi_runtime_resume (struct device *dev) +static int sprd_spi_runtime_resume (struct device *dev) {struct spi_controller *sctlr =dev_get_drvdata (dev);struct sprd_spi *ss =spi_controller_get_devdata (sctlr);
@@ -1050,8 +1050,7 @@ static int __maybe_unused sprd_spi_runtime_resume(struct device *dev) }static const struct dev_pm_ops sprd_spi_pm_ops = { -SET_RUNTIME_PM_OPS (sprd_spi_runtime_suspend, - sprd_spi_runtime_resume,NULL ) +RUNTIME_PM_OPS (sprd_spi_runtime_suspend, sprd_spi_runtime_resume,NULL ) };static const struct of_device_id sprd_spi_of_match[] = {
@@ -1064,7 +1063,7 @@ static struct platform_driver sprd_spi_driver = { .driver = { .name = "sprd-spi", .of_match_table = sprd_spi_of_match, - .pm = &sprd_spi_pm_ops, + .pm = pm_ptr(&sprd_spi_pm_ops), }, .probe = sprd_spi_probe, .remove = sprd_spi_remove,
Signature · 1 line
2.53.0
PATCH 32/39 spi: sunplus-sp7021: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or __maybe_unused.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-sunplus-sp7021.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/spi/spi-sunplus-sp7021.c +7 -9
@@ -498,7 +498,7 @@ static void sp7021_spi_controller_remove(struct platform_device *pdev)pm_runtime_set_suspended (&pdev->dev); } -static int __maybe_unused sp7021_spi_controller_suspend (struct device *dev) +static int sp7021_spi_controller_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct sp7021_spi_ctlr *pspim =spi_controller_get_devdata (ctlr);
@@ -506,7 +506,7 @@ static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)return reset_control_assert (pspim->rstc); } -static int __maybe_unused sp7021_spi_controller_resume (struct device *dev) +static int sp7021_spi_controller_resume (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);struct sp7021_spi_ctlr *pspim =spi_controller_get_devdata (ctlr);
@@ -515,7 +515,6 @@ static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)return clk_prepare_enable (pspim->spi_clk); } -#ifdef CONFIG_PM static int sp7021_spi_runtime_suspend (struct device *dev) {struct spi_controller *ctlr =dev_get_drvdata (dev);
@@ -531,13 +530,12 @@ static int sp7021_spi_runtime_resume(struct device *dev)return reset_control_deassert (pspim->rstc); } -#endif static const struct dev_pm_ops sp7021_spi_pm_ops = { - SET_RUNTIME_PM_OPS(sp7021_spi_runtime_suspend, - sp7021_spi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (sp7021_spi_controller_suspend, - sp7021_spi_controller_resume) + RUNTIME_PM_OPS(sp7021_spi_runtime_suspend, + sp7021_spi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (sp7021_spi_controller_suspend, + sp7021_spi_controller_resume) };static const struct of_device_id sp7021_spi_controller_ids[] = {
@@ -552,7 +550,7 @@ static struct platform_driver sp7021_spi_controller_driver = { .driver = { .name = "sunplus,sp7021-spi-controller", .of_match_table = sp7021_spi_controller_ids, - .pm = &sp7021_spi_pm_ops, + .pm = pm_ptr(&sp7021_spi_pm_ops), }, };module_platform_driver (sp7021_spi_controller_driver);
Signature · 1 line
2.53.0
PATCH 33/39 spi: syncuacer: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-synquacer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/spi/spi-synquacer.c +5 -5
@@ -738,7 +738,7 @@ static void synquacer_spi_remove(struct platform_device *pdev)clk_disable_unprepare (sspi->clk); } -static int __maybe_unused synquacer_spi_suspend (struct device *dev) +static int synquacer_spi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct synquacer_spi *sspi =spi_controller_get_devdata (host);
@@ -754,7 +754,7 @@ static int __maybe_unused synquacer_spi_suspend(struct device *dev)return ret; } -static int __maybe_unused synquacer_spi_resume (struct device *dev) +static int synquacer_spi_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct synquacer_spi *sspi =spi_controller_get_devdata (host);
@@ -786,8 +786,8 @@ static int __maybe_unused synquacer_spi_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend, - synquacer_spi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(synquacer_spi_pm_ops, synquacer_spi_suspend, + synquacer_spi_resume);static const struct of_device_id synquacer_spi_of_match[] = { {.compatible ="socionext,synquacer-spi" },
@@ -806,7 +806,7 @@ MODULE_DEVICE_TABLE(acpi, synquacer_hsspi_acpi_ids);static struct platform_driver synquacer_spi_driver = { .driver = { .name ="synquacer-spi" , - .pm = &synquacer_spi_pm_ops, + .pm =pm_sleep_ptr (&synquacer_spi_pm_ops), .of_match_table = synquacer_spi_of_match, .acpi_match_table =ACPI_PTR (synquacer_hsspi_acpi_ids), },
Signature · 1 line
2.53.0
PATCH 34/39 spi: tegra114: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-tegra114.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/spi/spi-tegra114.c +4 -6
@@ -1450,7 +1450,6 @@ static void tegra_spi_remove(struct platform_device *pdev)tegra_spi_runtime_suspend (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int tegra_spi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -1476,7 +1475,6 @@ static int tegra_spi_resume(struct device *dev)return spi_controller_resume (host); } -#endif static int tegra_spi_runtime_suspend (struct device *dev) {
@@ -1505,14 +1503,14 @@ static int tegra_spi_runtime_resume(struct device *dev) }static const struct dev_pm_ops tegra_spi_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_spi_runtime_suspend, - tegra_spi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (tegra_spi_suspend, tegra_spi_resume) + RUNTIME_PM_OPS(tegra_spi_runtime_suspend, + tegra_spi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (tegra_spi_suspend, tegra_spi_resume) };static struct platform_driver tegra_spi_driver = { .driver = { .name ="spi-tegra114" , - .pm = &tegra_spi_pm_ops, + .pm =pm_ptr (&tegra_spi_pm_ops), .of_match_table = tegra_spi_of_match, }, .probe = tegra_spi_probe,
Signature · 1 line
2.53.0
PATCH 35/39 spi: tegra20-sflash: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-tegra20-sflash.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/spi/spi-tegra20-sflash.c +4 -6
@@ -533,7 +533,6 @@ static void tegra_sflash_remove(struct platform_device *pdev)tegra_sflash_runtime_suspend (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int tegra_sflash_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -557,7 +556,6 @@ static int tegra_sflash_resume(struct device *dev)return spi_controller_resume (host); } -#endif static int tegra_sflash_runtime_suspend (struct device *dev) {
@@ -586,14 +584,14 @@ static int tegra_sflash_runtime_resume(struct device *dev) }static const struct dev_pm_ops slink_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_sflash_runtime_suspend, - tegra_sflash_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (tegra_sflash_suspend, tegra_sflash_resume) + RUNTIME_PM_OPS(tegra_sflash_runtime_suspend, + tegra_sflash_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (tegra_sflash_suspend, tegra_sflash_resume) };static struct platform_driver tegra_sflash_driver = { .driver = { .name ="spi-tegra-sflash" , - .pm = &slink_pm_ops, + .pm =pm_ptr (&slink_pm_ops), .of_match_table = tegra_sflash_of_match, }, .probe = tegra_sflash_probe,
Signature · 1 line
2.53.0
PATCH 36/39 spi: tegra20-slink: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or __maybe_unused.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
--- drivers/spi/spi-tegra20-slink.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/spi/spi-tegra20-slink.c +6 -8
@@ -1144,7 +1144,6 @@ static void tegra_slink_remove(struct platform_device *pdev)tegra_slink_deinit_dma_param (tspi, true); } -#ifdef CONFIG_PM_SLEEP static int tegra_slink_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);
@@ -1169,9 +1168,8 @@ static int tegra_slink_resume(struct device *dev)return spi_controller_resume (host); } -#endif -static int __maybe_unused tegra_slink_runtime_suspend (struct device *dev) +static int tegra_slink_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct tegra_slink_data *tspi =spi_controller_get_devdata (host);
@@ -1183,7 +1181,7 @@ static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused tegra_slink_runtime_resume (struct device *dev) +static int tegra_slink_runtime_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct tegra_slink_data *tspi =spi_controller_get_devdata (host);
@@ -1198,14 +1196,14 @@ static int __maybe_unused tegra_slink_runtime_resume(struct device *dev) }static const struct dev_pm_ops slink_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend, - tegra_slink_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (tegra_slink_suspend, tegra_slink_resume) + RUNTIME_PM_OPS(tegra_slink_runtime_suspend, + tegra_slink_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (tegra_slink_suspend, tegra_slink_resume) };static struct platform_driver tegra_slink_driver = { .driver = { .name ="spi-tegra-slink" , - .pm = &slink_pm_ops, + .pm =pm_ptr (&slink_pm_ops), .of_match_table = tegra_slink_of_match, }, .probe = tegra_slink_probe,
Signature · 1 line
2.53.0
PATCH 37/39 spi: tegra210-quad: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-tegra210-quad.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/spi/spi-tegra210-quad.c +7 -7
@@ -1837,14 +1837,14 @@ static void tegra_qspi_remove(struct platform_device *pdev)tegra_qspi_deinit_dma (tqspi); } -static int __maybe_unused tegra_qspi_suspend (struct device *dev) +static int tegra_qspi_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);return spi_controller_suspend (host); } -static int __maybe_unused tegra_qspi_resume (struct device *dev) +static int tegra_qspi_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct tegra_qspi *tqspi =spi_controller_get_devdata (host);
@@ -1863,7 +1863,7 @@ static int __maybe_unused tegra_qspi_resume(struct device *dev)return spi_controller_resume (host); } -static int __maybe_unused tegra_qspi_runtime_suspend (struct device *dev) +static int tegra_qspi_runtime_suspend (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct tegra_qspi *tqspi =spi_controller_get_devdata (host);
@@ -1879,7 +1879,7 @@ static int __maybe_unused tegra_qspi_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused tegra_qspi_runtime_resume (struct device *dev) +static int tegra_qspi_runtime_resume (struct device *dev) {struct spi_controller *host =dev_get_drvdata (dev);struct tegra_qspi *tqspi =spi_controller_get_devdata (host);
@@ -1896,14 +1896,14 @@ static int __maybe_unused tegra_qspi_runtime_resume(struct device *dev) }static const struct dev_pm_ops tegra_qspi_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (tegra_qspi_suspend, tegra_qspi_resume) + RUNTIME_PM_OPS(tegra_qspi_runtime_suspend, tegra_qspi_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (tegra_qspi_suspend, tegra_qspi_resume) };static struct platform_driver tegra_qspi_driver = { .driver = { .name ="tegra-qspi" , - .pm = &tegra_qspi_pm_ops, + .pm =pm_ptr (&tegra_qspi_pm_ops), .of_match_table = tegra_qspi_of_match, .acpi_match_table =ACPI_PTR (tegra_qspi_acpi_match), },
Signature · 1 line
2.53.0
PATCH 38/39 spi: topcliff-pch: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch.
At the same time, for pch_spi_pd_driver, we also switch to modern driver.pm for pm ops.
--- drivers/spi/spi-topcliff-pch.c | 47 +++++++++++++++------------------- 1 file changed, 20 insertions(+), 27 deletions(-)
drivers/spi/spi-topcliff-pch.c +20 -27
@@ -1438,19 +1438,17 @@ static void pch_spi_pd_remove(struct platform_device *plat_dev)spi_controller_put (data->host); } -#ifdef CONFIG_PM -static int pch_spi_pd_suspend (struct platform_device *pd_dev, -pm_message_t state) + +static int pch_spi_pd_suspend (struct device *dev) {u8 count; -struct pch_spi_board_data *board_dat =dev_get_platdata (&pd_dev->dev); -struct pch_spi_data *data =platform_get_drvdata (pd_dev); +struct pch_spi_board_data *board_dat =dev_get_platdata (dev); +struct pch_spi_data *data =dev_get_drvdata (dev); -dev_dbg (&pd_dev->dev,"%s ENTRY\n" , __func__); +dev_dbg (dev,"%s ENTRY\n" , __func__);if (!board_dat) { -dev_err (&pd_dev->dev, -"%s pci_get_drvdata returned NULL\n" , __func__); +dev_err (dev,"%s pci_get_drvdata returned NULL\n" , __func__);return -EFAULT ; }
@@ -1471,22 +1469,20 @@ static int pch_spi_pd_suspend(struct platform_device *pd_dev,free_irq (board_dat->pdev->irq, data); data->irq_reg_sts = false; -dev_dbg (&pd_dev->dev, -"%s free_irq invoked successfully.\n" , __func__); +dev_dbg (dev,"%s free_irq invoked successfully.\n" , __func__); }return 0 ; } -static int pch_spi_pd_resume (struct platform_device *pd_dev) +static int pch_spi_pd_resume (struct device *dev) { -struct pch_spi_board_data *board_dat =dev_get_platdata (&pd_dev->dev); -struct pch_spi_data *data =platform_get_drvdata (pd_dev); +struct pch_spi_board_data *board_dat =dev_get_platdata (dev); +struct pch_spi_data *data =dev_get_drvdata (dev);int retval;if (!board_dat) { -dev_err (&pd_dev->dev, -"%s pci_get_drvdata returned NULL\n" , __func__); +dev_err (dev,"%s pci_get_drvdata returned NULL\n" , __func__);return -EFAULT ; }
@@ -1495,8 +1491,7 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev) retval =request_irq (board_dat->pdev->irq, pch_spi_handler,IRQF_SHARED ,KBUILD_MODNAME , data);if (retval <0 ) { -dev_err (&pd_dev->dev, -"%s request_irq failed\n" , __func__); +dev_err (dev,"%s request_irq failed\n" , __func__);return retval; }
@@ -1507,19 +1502,17 @@ static int pch_spi_pd_resume(struct platform_device *pd_dev) }return 0 ; } -#else -#define pch_spi_pd_suspend NULL -#define pch_spi_pd_resume NULL -#endif + +static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pd_pm_ops, + pch_spi_pd_suspend, pch_spi_pd_resume);static struct platform_driver pch_spi_pd_driver = { .driver = { .name ="pch-spi" , + .pm =pm_sleep_ptr (&pch_spi_pd_pm_ops), }, .probe = pch_spi_pd_probe, .remove = pch_spi_pd_remove, - .suspend = pch_spi_pd_suspend, - .resume = pch_spi_pd_resume };static int pch_spi_probe (struct pci_dev *pdev,const struct pci_device_id *id)
@@ -1618,7 +1611,7 @@ static void pch_spi_remove(struct pci_dev *pdev)kfree (pd_dev_save); } -static int __maybe_unused pch_spi_suspend (struct device *dev) +static int pch_spi_suspend (struct device *dev) {struct pch_pd_dev_save *pd_dev_save =dev_get_drvdata (dev);
@@ -1629,7 +1622,7 @@ static int __maybe_unused pch_spi_suspend(struct device *dev)return 0 ; } -static int __maybe_unused pch_spi_resume (struct device *dev) +static int pch_spi_resume (struct device *dev) {struct pch_pd_dev_save *pd_dev_save =dev_get_drvdata (dev);
@@ -1641,14 +1634,14 @@ static int __maybe_unused pch_spi_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pch_spi_pm_ops, pch_spi_suspend, pch_spi_resume);static struct pci_driver pch_spi_pcidev_driver = { .name ="pch_spi" , .id_table = pch_spi_pcidev_id, .probe = pch_spi_probe, .remove = pch_spi_remove, - .driver.pm = &pch_spi_pm_ops, + .driver.pm =pm_sleep_ptr (&pch_spi_pm_ops), };static int __init pch_spi_init (void )
Signature · 1 line
2.53.0
PATCH 39/39 spi: zynqmp-gqspi: use modern PM macros
In reply to Jisheng ZhangUse the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused.
--- drivers/spi/spi-zynqmp-gqspi.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/spi/spi-zynqmp-gqspi.c +7 -8
@@ -935,7 +935,7 @@ static int zynqmp_qspi_read_op(struct zynqmp_qspi *xqspi, u8 rx_nbits,* * Return: Always 0 */ -static int __maybe_unused zynqmp_qspi_suspend (struct device *dev) +static int zynqmp_qspi_suspend (struct device *dev) {struct zynqmp_qspi *xqspi =dev_get_drvdata (dev);struct spi_controller *ctlr = xqspi->ctlr;
@@ -959,7 +959,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)* * Return: 0 on success; error value otherwise */ -static int __maybe_unused zynqmp_qspi_resume (struct device *dev) +static int zynqmp_qspi_resume (struct device *dev) {struct zynqmp_qspi *xqspi =dev_get_drvdata (dev);struct spi_controller *ctlr = xqspi->ctlr;
@@ -979,7 +979,7 @@ static int __maybe_unused zynqmp_qspi_resume(struct device *dev)* * Return: Always 0 */ -static int __maybe_unused zynqmp_runtime_suspend (struct device *dev) +static int zynqmp_runtime_suspend (struct device *dev) {struct zynqmp_qspi *xqspi =dev_get_drvdata (dev);
@@ -997,7 +997,7 @@ static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)* * Return: 0 on success and error value on error */ -static int __maybe_unused zynqmp_runtime_resume (struct device *dev) +static int zynqmp_runtime_resume (struct device *dev) {struct zynqmp_qspi *xqspi =dev_get_drvdata (dev);int ret;
@@ -1186,9 +1186,8 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem, }static const struct dev_pm_ops zynqmp_qspi_dev_pm_ops = { - SET_RUNTIME_PM_OPS(zynqmp_runtime_suspend, - zynqmp_runtime_resume, NULL) -SET_SYSTEM_SLEEP_PM_OPS (zynqmp_qspi_suspend, zynqmp_qspi_resume) + RUNTIME_PM_OPS(zynqmp_runtime_suspend, zynqmp_runtime_resume, NULL) +SYSTEM_SLEEP_PM_OPS (zynqmp_qspi_suspend, zynqmp_qspi_resume) };static const struct qspi_platform_data versal_qspi_def = {
@@ -1382,7 +1381,7 @@ static struct platform_driver zynqmp_qspi_driver = { .driver = { .name = "zynqmp-qspi", .of_match_table = zynqmp_qspi_of_match, - .pm = &zynqmp_qspi_dev_pm_ops, + .pm = pm_ptr(&zynqmp_qspi_dev_pm_ops), }, };
Signature · 1 line
2.53.0
Mark Brown
maintainerQuoted 8 lines · Jisheng Zhang
spi: use modern PM macros
Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when
CONFIG_PMorCONFIG_PM_SLEEPare disabled, without having to use #ifdef guards or__maybe_unused.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.3
Thanks!
[01/39] spi: atmel-quadspi: use modern PM macros
https://git.kernel.org/broonie/spi/c/c4a452dd40aa [02/39] spi: amlogic-spifc-a1: use modern PM macros https://git.kernel.org/broonie/spi/c/6fe48b995296 [03/39] spi: at91-usart: use modern PM macros https://git.kernel.org/broonie/spi/c/363557bf4d1f [04/39] spi: axiado: use modern PM macros https://git.kernel.org/broonie/spi/c/a7fe79fd31d5 [05/39] spi: bcm-qspi: use modern PM macros https://git.kernel.org/broonie/spi/c/6062e0f2045e [06/39] spi: bcm63xx-hsspi: use modern PM macros https://git.kernel.org/broonie/spi/c/408ba1d06ee1 [07/39] spi: bcmbca-hsspi: use modern PM macros https://git.kernel.org/broonie/spi/c/f95bf30ed173 [08/39] spi: cadence: use modern PM macros https://git.kernel.org/broonie/spi/c/1e64a0671159 [09/39] spi: coldfire-qspi: use modern PM macros https://git.kernel.org/broonie/spi/c/7975bfcf50dd [10/39] spi: dln2: use modern PM macros https://git.kernel.org/broonie/spi/c/a0b764e3ec76 [11/39] spi: dw-pci: use modern PM macros https://git.kernel.org/broonie/spi/c/65172b5d381a [12/39] spi: spi-fsl-dspi: use modern PM macros https://git.kernel.org/broonie/spi/c/cda6ef242a6f [13/39] spi: fsl-espi: use modern PM macros https://git.kernel.org/broonie/spi/c/4669d74be689 [14/39] spi: fsl-lpspi: use modern PM macros https://git.kernel.org/broonie/spi/c/4f6d93537f01 [15/39] spi: qcom-geni: use modern PM macros https://git.kernel.org/broonie/spi/c/527adbf1a193 [16/39] spi: img-spfi: use modern PM macros https://git.kernel.org/broonie/spi/c/88672e90a945 [17/39] spi: loongson: use modern PM macros https://git.kernel.org/broonie/spi/c/8de18aced458 [18/39] spi: meson-spifc: use modern PM macros https://git.kernel.org/broonie/spi/c/aceceea2a44a [19/39] spi: mt65xx: use modern PM macros https://git.kernel.org/broonie/spi/c/06f9d950cb4c [20/39] spi: mtk-nor: use modern PM macros https://git.kernel.org/broonie/spi/c/fcb6a6e73e58 [21/39] spi: mxic: use modern PM macros https://git.kernel.org/broonie/spi/c/169d9f0fd984 [22/39] spi: omap2-mcspi: use modern PM macros https://git.kernel.org/broonie/spi/c/aa9d02583a91 [23/39] spi: orion: use modern PM macros https://git.kernel.org/broonie/spi/c/4fbaf6e6f112 [24/39] spi: pl022: use modern PM macros https://git.kernel.org/broonie/spi/c/9329021dcb44 [25/39] spi: spi-qcom-qspi: use modern PM macros https://git.kernel.org/broonie/spi/c/498e32cba465 [26/39] spi: qup: use modern PM macros https://git.kernel.org/broonie/spi/c/d87ae277834d [27/39] spi: rockchip-sfc: use modern PM macros https://git.kernel.org/broonie/spi/c/07d3854aded4 [28/39] spi: rockchip: use modern PM macros https://git.kernel.org/broonie/spi/c/c88fb9432198 [29/39] spi: s3c64xx: use modern PM macros https://git.kernel.org/broonie/spi/c/1c892a2f00a7 [30/39] spi: slave-mt27xx: use modern PM macros https://git.kernel.org/broonie/spi/c/abc34022d658 [31/39] spi: sprd: use modern PM macros https://git.kernel.org/broonie/spi/c/96e9434dee1d [32/39] spi: sunplus-sp7021: use modern PM macros https://git.kernel.org/broonie/spi/c/3c71dabf596a [33/39] spi: syncuacer: use modern PM macros https://git.kernel.org/broonie/spi/c/7bf07ac9be73 [34/39] spi: tegra114: use modern PM macros https://git.kernel.org/broonie/spi/c/46aec256a5f0 [35/39] spi: tegra20-sflash: use modern PM macros https://git.kernel.org/broonie/spi/c/f4bc18af3b3c [36/39] spi: tegra20-slink: use modern PM macros https://git.kernel.org/broonie/spi/c/355848a0f90a [37/39] spi: tegra210-quad: use modern PM macros https://git.kernel.org/broonie/spi/c/e3f3d046f3f6 [38/39] spi: topcliff-pch: use modern PM macros https://git.kernel.org/broonie/spi/c/2dae40e9dcfb [39/39] spi: zynqmp-gqspi: use modern PM macros https://git.kernel.org/broonie/spi/c/bec2ec4186d0
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