Commit ba733668 authored by Paul Cercueil's avatar Paul Cercueil Committed by Andi Shyti
Browse files

i2c: mt65xx: Remove #ifdef guards for PM related functions



Use the new 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.

Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230722115046.27323-13-paul@crapouillou.net


Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
parent 9f38edaf
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1514,7 +1514,6 @@ static void mtk_i2c_remove(struct platform_device *pdev)
	clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
}

#ifdef CONFIG_PM_SLEEP
static int mtk_i2c_suspend_noirq(struct device *dev)
{
	struct mtk_i2c *i2c = dev_get_drvdata(dev);
@@ -1544,10 +1543,9 @@ static int mtk_i2c_resume_noirq(struct device *dev)

	return 0;
}
#endif

static const struct dev_pm_ops mtk_i2c_pm = {
	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
	NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
				  mtk_i2c_resume_noirq)
};

@@ -1556,7 +1554,7 @@ static struct platform_driver mtk_i2c_driver = {
	.remove_new = mtk_i2c_remove,
	.driver = {
		.name = I2C_DRV_NAME,
		.pm = &mtk_i2c_pm,
		.pm = pm_sleep_ptr(&mtk_i2c_pm),
		.of_match_table = mtk_i2c_of_match,
	},
};