Commit dab4b0e8 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Wolfram Sang

i2c: at91: remove #define CONFIG_PM

Remove #define CONFIG_PM and use __maybe_unused for PM functions and
pm_ptr() for PM ops.
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: default avatarCodrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 9c5b1daa
...@@ -286,9 +286,7 @@ static int at91_twi_remove(struct platform_device *pdev) ...@@ -286,9 +286,7 @@ static int at91_twi_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused at91_twi_runtime_suspend(struct device *dev)
static int at91_twi_runtime_suspend(struct device *dev)
{ {
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev); struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
...@@ -299,7 +297,7 @@ static int at91_twi_runtime_suspend(struct device *dev) ...@@ -299,7 +297,7 @@ static int at91_twi_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int at91_twi_runtime_resume(struct device *dev) static int __maybe_unused at91_twi_runtime_resume(struct device *dev)
{ {
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev); struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
...@@ -308,7 +306,7 @@ static int at91_twi_runtime_resume(struct device *dev) ...@@ -308,7 +306,7 @@ static int at91_twi_runtime_resume(struct device *dev)
return clk_prepare_enable(twi_dev->clk); return clk_prepare_enable(twi_dev->clk);
} }
static int at91_twi_suspend_noirq(struct device *dev) static int __maybe_unused at91_twi_suspend_noirq(struct device *dev)
{ {
if (!pm_runtime_status_suspended(dev)) if (!pm_runtime_status_suspended(dev))
at91_twi_runtime_suspend(dev); at91_twi_runtime_suspend(dev);
...@@ -316,7 +314,7 @@ static int at91_twi_suspend_noirq(struct device *dev) ...@@ -316,7 +314,7 @@ static int at91_twi_suspend_noirq(struct device *dev)
return 0; return 0;
} }
static int at91_twi_resume_noirq(struct device *dev) static int __maybe_unused at91_twi_resume_noirq(struct device *dev)
{ {
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev); struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
int ret; int ret;
...@@ -342,11 +340,6 @@ static const struct dev_pm_ops at91_twi_pm = { ...@@ -342,11 +340,6 @@ static const struct dev_pm_ops at91_twi_pm = {
.runtime_resume = at91_twi_runtime_resume, .runtime_resume = at91_twi_runtime_resume,
}; };
#define at91_twi_pm_ops (&at91_twi_pm)
#else
#define at91_twi_pm_ops NULL
#endif
static struct platform_driver at91_twi_driver = { static struct platform_driver at91_twi_driver = {
.probe = at91_twi_probe, .probe = at91_twi_probe,
.remove = at91_twi_remove, .remove = at91_twi_remove,
...@@ -354,7 +347,7 @@ static struct platform_driver at91_twi_driver = { ...@@ -354,7 +347,7 @@ static struct platform_driver at91_twi_driver = {
.driver = { .driver = {
.name = "at91_i2c", .name = "at91_i2c",
.of_match_table = of_match_ptr(atmel_twi_dt_ids), .of_match_table = of_match_ptr(atmel_twi_dt_ids),
.pm = at91_twi_pm_ops, .pm = pm_ptr(&at91_twi_pm),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment