diff options
author | Marcus Folkesson <marcus.folkesson@gmail.com> | 2018-09-02 13:37:04 -0400 |
---|---|---|
committer | Peter Chen <peter.chen@nxp.com> | 2018-09-20 05:04:21 -0400 |
commit | 9f644a64884f97f0d92f0689afc7fcf177b6ee92 (patch) | |
tree | 6e9aa0fc5ff356695b9e532afc0f6cbbc6e2bceb | |
parent | 1652a83fa494b12e20fc02a2cc3ddbcd75d53170 (diff) |
usb: chipidea: imx: do not use preprocessor conditionals for PM
Use preprocessor conditionals for CONFIG_PM and CONFIG_PM_SLEEP is
not necessary since SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS does
that internally.
It is also the preferred way according to our coding style guidelines.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 19f5f5f2a48a..ab79d23ca6ec 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
@@ -364,8 +364,7 @@ static void ci_hdrc_imx_shutdown(struct platform_device *pdev) | |||
364 | ci_hdrc_imx_remove(pdev); | 364 | ci_hdrc_imx_remove(pdev); |
365 | } | 365 | } |
366 | 366 | ||
367 | #ifdef CONFIG_PM | 367 | static int __maybe_unused imx_controller_suspend(struct device *dev) |
368 | static int imx_controller_suspend(struct device *dev) | ||
369 | { | 368 | { |
370 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | 369 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); |
371 | 370 | ||
@@ -377,7 +376,7 @@ static int imx_controller_suspend(struct device *dev) | |||
377 | return 0; | 376 | return 0; |
378 | } | 377 | } |
379 | 378 | ||
380 | static int imx_controller_resume(struct device *dev) | 379 | static int __maybe_unused imx_controller_resume(struct device *dev) |
381 | { | 380 | { |
382 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | 381 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); |
383 | int ret = 0; | 382 | int ret = 0; |
@@ -408,8 +407,7 @@ clk_disable: | |||
408 | return ret; | 407 | return ret; |
409 | } | 408 | } |
410 | 409 | ||
411 | #ifdef CONFIG_PM_SLEEP | 410 | static int __maybe_unused ci_hdrc_imx_suspend(struct device *dev) |
412 | static int ci_hdrc_imx_suspend(struct device *dev) | ||
413 | { | 411 | { |
414 | int ret; | 412 | int ret; |
415 | 413 | ||
@@ -431,7 +429,7 @@ static int ci_hdrc_imx_suspend(struct device *dev) | |||
431 | return imx_controller_suspend(dev); | 429 | return imx_controller_suspend(dev); |
432 | } | 430 | } |
433 | 431 | ||
434 | static int ci_hdrc_imx_resume(struct device *dev) | 432 | static int __maybe_unused ci_hdrc_imx_resume(struct device *dev) |
435 | { | 433 | { |
436 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | 434 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); |
437 | int ret; | 435 | int ret; |
@@ -445,9 +443,8 @@ static int ci_hdrc_imx_resume(struct device *dev) | |||
445 | 443 | ||
446 | return ret; | 444 | return ret; |
447 | } | 445 | } |
448 | #endif /* CONFIG_PM_SLEEP */ | ||
449 | 446 | ||
450 | static int ci_hdrc_imx_runtime_suspend(struct device *dev) | 447 | static int __maybe_unused ci_hdrc_imx_runtime_suspend(struct device *dev) |
451 | { | 448 | { |
452 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); | 449 | struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); |
453 | int ret; | 450 | int ret; |
@@ -466,13 +463,11 @@ static int ci_hdrc_imx_runtime_suspend(struct device *dev) | |||
466 | return imx_controller_suspend(dev); | 463 | return imx_controller_suspend(dev); |
467 | } | 464 | } |
468 | 465 | ||
469 | static int ci_hdrc_imx_runtime_resume(struct device *dev) | 466 | static int __maybe_unused ci_hdrc_imx_runtime_resume(struct device *dev) |
470 | { | 467 | { |
471 | return imx_controller_resume(dev); | 468 | return imx_controller_resume(dev); |
472 | } | 469 | } |
473 | 470 | ||
474 | #endif /* CONFIG_PM */ | ||
475 | |||
476 | static const struct dev_pm_ops ci_hdrc_imx_pm_ops = { | 471 | static const struct dev_pm_ops ci_hdrc_imx_pm_ops = { |
477 | SET_SYSTEM_SLEEP_PM_OPS(ci_hdrc_imx_suspend, ci_hdrc_imx_resume) | 472 | SET_SYSTEM_SLEEP_PM_OPS(ci_hdrc_imx_suspend, ci_hdrc_imx_resume) |
478 | SET_RUNTIME_PM_OPS(ci_hdrc_imx_runtime_suspend, | 473 | SET_RUNTIME_PM_OPS(ci_hdrc_imx_runtime_suspend, |