mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
Input: ti_am335x_tsc - use SIMPLE_DEV_PM_OPS
Instead of doing the dance with macro that either resolves to a pointer or NULL, let's switch to using SIMPLE_DEV_PM_OPS(). Also let's mark suspend and resume methods as __maybe_unused instead of guarding them with an #ifdef and rely on linker to drop unused code. Doing so should allow better compile coverage. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
b5ca3ea327
commit
20aa787e45
1 changed files with 4 additions and 12 deletions
|
@ -487,8 +487,7 @@ static int titsc_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
static int __maybe_unused titsc_suspend(struct device *dev)
|
||||||
static int titsc_suspend(struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct titsc *ts_dev = dev_get_drvdata(dev);
|
struct titsc *ts_dev = dev_get_drvdata(dev);
|
||||||
struct ti_tscadc_dev *tscadc_dev;
|
struct ti_tscadc_dev *tscadc_dev;
|
||||||
|
@ -504,7 +503,7 @@ static int titsc_suspend(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int titsc_resume(struct device *dev)
|
static int __maybe_unused titsc_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct titsc *ts_dev = dev_get_drvdata(dev);
|
struct titsc *ts_dev = dev_get_drvdata(dev);
|
||||||
struct ti_tscadc_dev *tscadc_dev;
|
struct ti_tscadc_dev *tscadc_dev;
|
||||||
|
@ -521,14 +520,7 @@ static int titsc_resume(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops titsc_pm_ops = {
|
static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume);
|
||||||
.suspend = titsc_suspend,
|
|
||||||
.resume = titsc_resume,
|
|
||||||
};
|
|
||||||
#define TITSC_PM_OPS (&titsc_pm_ops)
|
|
||||||
#else
|
|
||||||
#define TITSC_PM_OPS NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct of_device_id ti_tsc_dt_ids[] = {
|
static const struct of_device_id ti_tsc_dt_ids[] = {
|
||||||
{ .compatible = "ti,am3359-tsc", },
|
{ .compatible = "ti,am3359-tsc", },
|
||||||
|
@ -541,7 +533,7 @@ static struct platform_driver ti_tsc_driver = {
|
||||||
.remove = titsc_remove,
|
.remove = titsc_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "TI-am335x-tsc",
|
.name = "TI-am335x-tsc",
|
||||||
.pm = TITSC_PM_OPS,
|
.pm = &titsc_pm_ops,
|
||||||
.of_match_table = ti_tsc_dt_ids,
|
.of_match_table = ti_tsc_dt_ids,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue