diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-01-07 20:28:06 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-04-05 13:17:51 -0400 |
commit | 20aa787e453faec948ad75ebaa1535dbd5adb271 (patch) | |
tree | 1658dae09d892d4666da934fa5556353b10dea4c | |
parent | b5ca3ea327a6467591751e4c98207281fe884da3 (diff) |
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>
-rw-r--r-- | drivers/input/touchscreen/ti_am335x_tsc.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index a21a07c3ab6d..8b3f15ca7725 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c | |||
@@ -487,8 +487,7 @@ static int titsc_remove(struct platform_device *pdev) | |||
487 | return 0; | 487 | return 0; |
488 | } | 488 | } |
489 | 489 | ||
490 | #ifdef CONFIG_PM | 490 | static int __maybe_unused titsc_suspend(struct device *dev) |
491 | static int titsc_suspend(struct device *dev) | ||
492 | { | 491 | { |
493 | struct titsc *ts_dev = dev_get_drvdata(dev); | 492 | struct titsc *ts_dev = dev_get_drvdata(dev); |
494 | struct ti_tscadc_dev *tscadc_dev; | 493 | struct ti_tscadc_dev *tscadc_dev; |
@@ -504,7 +503,7 @@ static int titsc_suspend(struct device *dev) | |||
504 | return 0; | 503 | return 0; |
505 | } | 504 | } |
506 | 505 | ||
507 | static int titsc_resume(struct device *dev) | 506 | static int __maybe_unused titsc_resume(struct device *dev) |
508 | { | 507 | { |
509 | struct titsc *ts_dev = dev_get_drvdata(dev); | 508 | struct titsc *ts_dev = dev_get_drvdata(dev); |
510 | struct ti_tscadc_dev *tscadc_dev; | 509 | struct ti_tscadc_dev *tscadc_dev; |
@@ -521,14 +520,7 @@ static int titsc_resume(struct device *dev) | |||
521 | return 0; | 520 | return 0; |
522 | } | 521 | } |
523 | 522 | ||
524 | static const struct dev_pm_ops titsc_pm_ops = { | 523 | static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); |
525 | .suspend = titsc_suspend, | ||
526 | .resume = titsc_resume, | ||
527 | }; | ||
528 | #define TITSC_PM_OPS (&titsc_pm_ops) | ||
529 | #else | ||
530 | #define TITSC_PM_OPS NULL | ||
531 | #endif | ||
532 | 524 | ||
533 | static const struct of_device_id ti_tsc_dt_ids[] = { | 525 | static const struct of_device_id ti_tsc_dt_ids[] = { |
534 | { .compatible = "ti,am3359-tsc", }, | 526 | { .compatible = "ti,am3359-tsc", }, |
@@ -541,7 +533,7 @@ static struct platform_driver ti_tsc_driver = { | |||
541 | .remove = titsc_remove, | 533 | .remove = titsc_remove, |
542 | .driver = { | 534 | .driver = { |
543 | .name = "TI-am335x-tsc", | 535 | .name = "TI-am335x-tsc", |
544 | .pm = TITSC_PM_OPS, | 536 | .pm = &titsc_pm_ops, |
545 | .of_match_table = ti_tsc_dt_ids, | 537 | .of_match_table = ti_tsc_dt_ids, |
546 | }, | 538 | }, |
547 | }; | 539 | }; |