Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: atmel: remove #ifdef CONFIG_{PM, SLEEP}

Remove #ifdef CONFIG_PM, #ifdef CONFIG_PM_SLEEP and use
SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() macros instead which allows
getting also rid of __maybe_unused in the code.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220718071052.1707858-1-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Claudiu Beznea and committed by
Mark Brown
a3fd35be 0ee0ab0b

+4 -11
+4 -11
drivers/spi/spi-atmel.c
··· 1631 1631 return 0; 1632 1632 } 1633 1633 1634 - #ifdef CONFIG_PM 1635 1634 static int atmel_spi_runtime_suspend(struct device *dev) 1636 1635 { 1637 1636 struct spi_master *master = dev_get_drvdata(dev); ··· 1652 1653 return clk_prepare_enable(as->clk); 1653 1654 } 1654 1655 1655 - #ifdef CONFIG_PM_SLEEP 1656 1656 static int atmel_spi_suspend(struct device *dev) 1657 1657 { 1658 1658 struct spi_master *master = dev_get_drvdata(dev); ··· 1691 1693 /* Start the queue running */ 1692 1694 return spi_master_resume(master); 1693 1695 } 1694 - #endif 1695 1696 1696 1697 static const struct dev_pm_ops atmel_spi_pm_ops = { 1697 - SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume) 1698 - SET_RUNTIME_PM_OPS(atmel_spi_runtime_suspend, 1699 - atmel_spi_runtime_resume, NULL) 1698 + SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume) 1699 + RUNTIME_PM_OPS(atmel_spi_runtime_suspend, 1700 + atmel_spi_runtime_resume, NULL) 1700 1701 }; 1701 - #define ATMEL_SPI_PM_OPS (&atmel_spi_pm_ops) 1702 - #else 1703 - #define ATMEL_SPI_PM_OPS NULL 1704 - #endif 1705 1702 1706 1703 static const struct of_device_id atmel_spi_dt_ids[] = { 1707 1704 { .compatible = "atmel,at91rm9200-spi" }, ··· 1708 1715 static struct platform_driver atmel_spi_driver = { 1709 1716 .driver = { 1710 1717 .name = "atmel_spi", 1711 - .pm = ATMEL_SPI_PM_OPS, 1718 + .pm = pm_ptr(&atmel_spi_pm_ops), 1712 1719 .of_match_table = atmel_spi_dt_ids, 1713 1720 }, 1714 1721 .probe = atmel_spi_probe,