mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
i2c: exynos5: 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: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20230722115046.27323-7-paul@crapouillou.net Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
This commit is contained in:
parent
a9e4d8b641
commit
375b26c952
@ -892,7 +892,6 @@ static void exynos5_i2c_remove(struct platform_device *pdev)
|
|||||||
clk_unprepare(i2c->pclk);
|
clk_unprepare(i2c->pclk);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
|
||||||
static int exynos5_i2c_suspend_noirq(struct device *dev)
|
static int exynos5_i2c_suspend_noirq(struct device *dev)
|
||||||
{
|
{
|
||||||
struct exynos5_i2c *i2c = dev_get_drvdata(dev);
|
struct exynos5_i2c *i2c = dev_get_drvdata(dev);
|
||||||
@ -934,11 +933,10 @@ err_pclk:
|
|||||||
clk_disable_unprepare(i2c->pclk);
|
clk_disable_unprepare(i2c->pclk);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct dev_pm_ops exynos5_i2c_dev_pm_ops = {
|
static const struct dev_pm_ops exynos5_i2c_dev_pm_ops = {
|
||||||
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq,
|
NOIRQ_SYSTEM_SLEEP_PM_OPS(exynos5_i2c_suspend_noirq,
|
||||||
exynos5_i2c_resume_noirq)
|
exynos5_i2c_resume_noirq)
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_driver exynos5_i2c_driver = {
|
static struct platform_driver exynos5_i2c_driver = {
|
||||||
@ -946,7 +944,7 @@ static struct platform_driver exynos5_i2c_driver = {
|
|||||||
.remove_new = exynos5_i2c_remove,
|
.remove_new = exynos5_i2c_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "exynos5-hsi2c",
|
.name = "exynos5-hsi2c",
|
||||||
.pm = &exynos5_i2c_dev_pm_ops,
|
.pm = pm_sleep_ptr(&exynos5_i2c_dev_pm_ops),
|
||||||
.of_match_table = exynos5_i2c_match,
|
.of_match_table = exynos5_i2c_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user