Unverified Commit 10a6d750 authored by Alain Volmat's avatar Alain Volmat Committed by Mark Brown
Browse files

spi: stm32-qspi: avoid __maybe_unused and use pm_ptr



Switch to usage of pm_ptr / SYSTEM_SLEEP_PM_OPS / RUNTIME_PM_OPS
in order to avoid having to mark the pm related functions as
__maybe_unused.

Signed-off-by: default avatarAlain Volmat <alain.volmat@foss.st.com>
Link: https://patch.msgid.link/20260106-spi_st_maybe_unused_removal-v1-3-8f5ca7136e96@foss.st.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2a2d7187
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -891,7 +891,7 @@ static void stm32_qspi_remove(struct platform_device *pdev)
	clk_disable_unprepare(qspi->clk);
}

static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
static int stm32_qspi_runtime_suspend(struct device *dev)
{
	struct stm32_qspi *qspi = dev_get_drvdata(dev);

@@ -900,21 +900,21 @@ static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
	return 0;
}

static int __maybe_unused stm32_qspi_runtime_resume(struct device *dev)
static int stm32_qspi_runtime_resume(struct device *dev)
{
	struct stm32_qspi *qspi = dev_get_drvdata(dev);

	return clk_prepare_enable(qspi->clk);
}

static int __maybe_unused stm32_qspi_suspend(struct device *dev)
static int stm32_qspi_suspend(struct device *dev)
{
	pinctrl_pm_select_sleep_state(dev);

	return pm_runtime_force_suspend(dev);
}

static int __maybe_unused stm32_qspi_resume(struct device *dev)
static int stm32_qspi_resume(struct device *dev)
{
	struct stm32_qspi *qspi = dev_get_drvdata(dev);
	int ret;
@@ -938,9 +938,8 @@ static int __maybe_unused stm32_qspi_resume(struct device *dev)
}

static const struct dev_pm_ops stm32_qspi_pm_ops = {
	SET_RUNTIME_PM_OPS(stm32_qspi_runtime_suspend,
			   stm32_qspi_runtime_resume, NULL)
	SET_SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
	RUNTIME_PM_OPS(stm32_qspi_runtime_suspend, stm32_qspi_runtime_resume, NULL)
	SYSTEM_SLEEP_PM_OPS(stm32_qspi_suspend, stm32_qspi_resume)
};

static const struct of_device_id stm32_qspi_match[] = {
@@ -955,7 +954,7 @@ static struct platform_driver stm32_qspi_driver = {
	.driver	= {
		.name = "stm32-qspi",
		.of_match_table = stm32_qspi_match,
		.pm = &stm32_qspi_pm_ops,
		.pm = pm_ptr(&stm32_qspi_pm_ops),
	},
};
module_platform_driver(stm32_qspi_driver);