mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
drivers/clk: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the deprecated SIMPLE_DEV_PM_OPS to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr(). This lets us drop the __maybe_unused annotations from its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled. Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com> Reviewed-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
e831ea3564
commit
48bec6fd8e
|
|
@ -341,7 +341,7 @@ static int si521xx_probe(struct i2c_client *client)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused si521xx_suspend(struct device *dev)
|
||||
static int si521xx_suspend(struct device *dev)
|
||||
{
|
||||
struct si521xx *si = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ static int __maybe_unused si521xx_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused si521xx_resume(struct device *dev)
|
||||
static int si521xx_resume(struct device *dev)
|
||||
{
|
||||
struct si521xx *si = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
|
@ -379,12 +379,12 @@ static const struct of_device_id clk_si521xx_of_match[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(of, clk_si521xx_of_match);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(si521xx_pm_ops, si521xx_suspend, si521xx_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(si521xx_pm_ops, si521xx_suspend, si521xx_resume);
|
||||
|
||||
static struct i2c_driver si521xx_driver = {
|
||||
.driver = {
|
||||
.name = "clk-si521xx",
|
||||
.pm = &si521xx_pm_ops,
|
||||
.pm = pm_sleep_ptr(&si521xx_pm_ops),
|
||||
.of_match_table = clk_si521xx_of_match,
|
||||
},
|
||||
.probe = si521xx_probe,
|
||||
|
|
|
|||
|
|
@ -1223,7 +1223,7 @@ static void vc5_remove(struct i2c_client *client)
|
|||
clk_unregister_fixed_rate(vc5->pin_xin);
|
||||
}
|
||||
|
||||
static int __maybe_unused vc5_suspend(struct device *dev)
|
||||
static int vc5_suspend(struct device *dev)
|
||||
{
|
||||
struct vc5_driver_data *vc5 = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -1233,7 +1233,7 @@ static int __maybe_unused vc5_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused vc5_resume(struct device *dev)
|
||||
static int vc5_resume(struct device *dev)
|
||||
{
|
||||
struct vc5_driver_data *vc5 = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
|
@ -1335,12 +1335,12 @@ static const struct of_device_id clk_vc5_of_match[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(of, clk_vc5_of_match);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(vc5_pm_ops, vc5_suspend, vc5_resume);
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(vc5_pm_ops, vc5_suspend, vc5_resume);
|
||||
|
||||
static struct i2c_driver vc5_driver = {
|
||||
.driver = {
|
||||
.name = "vc5",
|
||||
.pm = &vc5_pm_ops,
|
||||
.pm = pm_sleep_ptr(&vc5_pm_ops),
|
||||
.of_match_table = clk_vc5_of_match,
|
||||
},
|
||||
.probe = vc5_probe,
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ static void exynos_clkout_remove(struct platform_device *pdev)
|
|||
iounmap(clkout->reg);
|
||||
}
|
||||
|
||||
static int __maybe_unused exynos_clkout_suspend(struct device *dev)
|
||||
static int exynos_clkout_suspend(struct device *dev)
|
||||
{
|
||||
struct exynos_clkout *clkout = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ static int __maybe_unused exynos_clkout_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused exynos_clkout_resume(struct device *dev)
|
||||
static int exynos_clkout_resume(struct device *dev)
|
||||
{
|
||||
struct exynos_clkout *clkout = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -232,13 +232,13 @@ static int __maybe_unused exynos_clkout_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(exynos_clkout_pm_ops, exynos_clkout_suspend,
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(exynos_clkout_pm_ops, exynos_clkout_suspend,
|
||||
exynos_clkout_resume);
|
||||
|
||||
static struct platform_driver exynos_clkout_driver = {
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.pm = &exynos_clkout_pm_ops,
|
||||
.pm = pm_sleep_ptr(&exynos_clkout_pm_ops),
|
||||
},
|
||||
.probe = exynos_clkout_probe,
|
||||
.remove = exynos_clkout_remove,
|
||||
|
|
|
|||
|
|
@ -1091,7 +1091,7 @@ static int clk_wzrd_clk_notifier(struct notifier_block *nb, unsigned long event,
|
|||
}
|
||||
}
|
||||
|
||||
static int __maybe_unused clk_wzrd_suspend(struct device *dev)
|
||||
static int clk_wzrd_suspend(struct device *dev)
|
||||
{
|
||||
struct clk_wzrd *clk_wzrd = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -1101,7 +1101,7 @@ static int __maybe_unused clk_wzrd_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused clk_wzrd_resume(struct device *dev)
|
||||
static int clk_wzrd_resume(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
struct clk_wzrd *clk_wzrd = dev_get_drvdata(dev);
|
||||
|
|
@ -1117,7 +1117,7 @@ static int __maybe_unused clk_wzrd_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(clk_wzrd_dev_pm_ops, clk_wzrd_suspend,
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(clk_wzrd_dev_pm_ops, clk_wzrd_suspend,
|
||||
clk_wzrd_resume);
|
||||
|
||||
static const struct versal_clk_data versal_data = {
|
||||
|
|
@ -1378,7 +1378,7 @@ static struct platform_driver clk_wzrd_driver = {
|
|||
.driver = {
|
||||
.name = "clk-wizard",
|
||||
.of_match_table = clk_wzrd_ids,
|
||||
.pm = &clk_wzrd_dev_pm_ops,
|
||||
.pm = pm_sleep_ptr(&clk_wzrd_dev_pm_ops),
|
||||
},
|
||||
.probe = clk_wzrd_probe,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user