diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2014-02-15 00:56:26 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-02-28 05:35:37 -0500 |
commit | f1d2ff8b9d0c6192a9ade7195353e434c9273e64 (patch) | |
tree | d91e2fe989c28d58ae9d03c1fb4a186111c2e09e | |
parent | f590f99ab9c13731aede86b522c0b8bf140a292e (diff) |
video: imxfb: Convert to SIMPLE_DEV_PM_OPS
Instead of assigning the pm_ops fields individually we can simply
use SIMPLE_DEV_PM_OPS.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/imxfb.c | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 398a8ca0e3dc..086e02431232 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -622,37 +622,6 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
622 | return 0; | 622 | return 0; |
623 | } | 623 | } |
624 | 624 | ||
625 | #ifdef CONFIG_PM | ||
626 | /* | ||
627 | * Power management hooks. Note that we won't be called from IRQ context, | ||
628 | * unlike the blank functions above, so we may sleep. | ||
629 | */ | ||
630 | static int imxfb_suspend(struct platform_device *dev, pm_message_t state) | ||
631 | { | ||
632 | struct fb_info *info = platform_get_drvdata(dev); | ||
633 | struct imxfb_info *fbi = info->par; | ||
634 | |||
635 | pr_debug("%s\n", __func__); | ||
636 | |||
637 | imxfb_disable_controller(fbi); | ||
638 | return 0; | ||
639 | } | ||
640 | |||
641 | static int imxfb_resume(struct platform_device *dev) | ||
642 | { | ||
643 | struct fb_info *info = platform_get_drvdata(dev); | ||
644 | struct imxfb_info *fbi = info->par; | ||
645 | |||
646 | pr_debug("%s\n", __func__); | ||
647 | |||
648 | imxfb_enable_controller(fbi); | ||
649 | return 0; | ||
650 | } | ||
651 | #else | ||
652 | #define imxfb_suspend NULL | ||
653 | #define imxfb_resume NULL | ||
654 | #endif | ||
655 | |||
656 | static int imxfb_init_fbinfo(struct platform_device *pdev) | 625 | static int imxfb_init_fbinfo(struct platform_device *pdev) |
657 | { | 626 | { |
658 | struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); | 627 | struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); |
@@ -1063,23 +1032,37 @@ static int imxfb_remove(struct platform_device *pdev) | |||
1063 | return 0; | 1032 | return 0; |
1064 | } | 1033 | } |
1065 | 1034 | ||
1066 | static void imxfb_shutdown(struct platform_device *dev) | 1035 | static int __maybe_unused imxfb_suspend(struct device *dev) |
1067 | { | 1036 | { |
1068 | struct fb_info *info = platform_get_drvdata(dev); | 1037 | struct fb_info *info = dev_get_drvdata(dev); |
1069 | struct imxfb_info *fbi = info->par; | 1038 | struct imxfb_info *fbi = info->par; |
1039 | |||
1070 | imxfb_disable_controller(fbi); | 1040 | imxfb_disable_controller(fbi); |
1041 | |||
1042 | return 0; | ||
1071 | } | 1043 | } |
1072 | 1044 | ||
1045 | static int __maybe_unused imxfb_resume(struct device *dev) | ||
1046 | { | ||
1047 | struct fb_info *info = dev_get_drvdata(dev); | ||
1048 | struct imxfb_info *fbi = info->par; | ||
1049 | |||
1050 | imxfb_enable_controller(fbi); | ||
1051 | |||
1052 | return 0; | ||
1053 | } | ||
1054 | |||
1055 | static SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume); | ||
1056 | |||
1073 | static struct platform_driver imxfb_driver = { | 1057 | static struct platform_driver imxfb_driver = { |
1074 | .suspend = imxfb_suspend, | ||
1075 | .resume = imxfb_resume, | ||
1076 | .probe = imxfb_probe, | ||
1077 | .remove = imxfb_remove, | ||
1078 | .shutdown = imxfb_shutdown, | ||
1079 | .driver = { | 1058 | .driver = { |
1080 | .name = DRIVER_NAME, | 1059 | .name = DRIVER_NAME, |
1081 | .of_match_table = imxfb_of_dev_id, | 1060 | .of_match_table = imxfb_of_dev_id, |
1061 | .owner = THIS_MODULE, | ||
1062 | .pm = &imxfb_pm_ops, | ||
1082 | }, | 1063 | }, |
1064 | .probe = imxfb_probe, | ||
1065 | .remove = imxfb_remove, | ||
1083 | .id_table = imxfb_devtype, | 1066 | .id_table = imxfb_devtype, |
1084 | }; | 1067 | }; |
1085 | module_platform_driver(imxfb_driver); | 1068 | module_platform_driver(imxfb_driver); |