diff options
Diffstat (limited to 'drivers/devfreq/exynos4_bus.c')
-rw-r--r-- | drivers/devfreq/exynos4_bus.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c index 6460577d6701..1a361e99965a 100644 --- a/drivers/devfreq/exynos4_bus.c +++ b/drivers/devfreq/exynos4_bus.c | |||
@@ -619,15 +619,19 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp, | |||
619 | return err; | 619 | return err; |
620 | } | 620 | } |
621 | 621 | ||
622 | static int exynos4_bus_target(struct device *dev, unsigned long *_freq) | 622 | static int exynos4_bus_target(struct device *dev, unsigned long *_freq, |
623 | u32 flags) | ||
623 | { | 624 | { |
624 | int err = 0; | 625 | int err = 0; |
625 | struct platform_device *pdev = container_of(dev, struct platform_device, | 626 | struct platform_device *pdev = container_of(dev, struct platform_device, |
626 | dev); | 627 | dev); |
627 | struct busfreq_data *data = platform_get_drvdata(pdev); | 628 | struct busfreq_data *data = platform_get_drvdata(pdev); |
628 | struct opp *opp = devfreq_recommended_opp(dev, _freq); | 629 | struct opp *opp = devfreq_recommended_opp(dev, _freq, flags); |
629 | unsigned long old_freq = opp_get_freq(data->curr_opp); | ||
630 | unsigned long freq = opp_get_freq(opp); | 630 | unsigned long freq = opp_get_freq(opp); |
631 | unsigned long old_freq = opp_get_freq(data->curr_opp); | ||
632 | |||
633 | if (IS_ERR(opp)) | ||
634 | return PTR_ERR(opp); | ||
631 | 635 | ||
632 | if (old_freq == freq) | 636 | if (old_freq == freq) |
633 | return 0; | 637 | return 0; |
@@ -689,9 +693,7 @@ static int exynos4_get_busier_dmc(struct busfreq_data *data) | |||
689 | static int exynos4_bus_get_dev_status(struct device *dev, | 693 | static int exynos4_bus_get_dev_status(struct device *dev, |
690 | struct devfreq_dev_status *stat) | 694 | struct devfreq_dev_status *stat) |
691 | { | 695 | { |
692 | struct platform_device *pdev = container_of(dev, struct platform_device, | 696 | struct busfreq_data *data = dev_get_drvdata(dev); |
693 | dev); | ||
694 | struct busfreq_data *data = platform_get_drvdata(pdev); | ||
695 | int busier_dmc; | 697 | int busier_dmc; |
696 | int cycles_x2 = 2; /* 2 x cycles */ | 698 | int cycles_x2 = 2; /* 2 x cycles */ |
697 | void __iomem *addr; | 699 | void __iomem *addr; |
@@ -739,9 +741,7 @@ static int exynos4_bus_get_dev_status(struct device *dev, | |||
739 | 741 | ||
740 | static void exynos4_bus_exit(struct device *dev) | 742 | static void exynos4_bus_exit(struct device *dev) |
741 | { | 743 | { |
742 | struct platform_device *pdev = container_of(dev, struct platform_device, | 744 | struct busfreq_data *data = dev_get_drvdata(dev); |
743 | dev); | ||
744 | struct busfreq_data *data = platform_get_drvdata(pdev); | ||
745 | 745 | ||
746 | devfreq_unregister_opp_notifier(dev, data->devfreq); | 746 | devfreq_unregister_opp_notifier(dev, data->devfreq); |
747 | } | 747 | } |
@@ -1087,9 +1087,7 @@ static __devexit int exynos4_busfreq_remove(struct platform_device *pdev) | |||
1087 | 1087 | ||
1088 | static int exynos4_busfreq_resume(struct device *dev) | 1088 | static int exynos4_busfreq_resume(struct device *dev) |
1089 | { | 1089 | { |
1090 | struct platform_device *pdev = container_of(dev, struct platform_device, | 1090 | struct busfreq_data *data = dev_get_drvdata(dev); |
1091 | dev); | ||
1092 | struct busfreq_data *data = platform_get_drvdata(pdev); | ||
1093 | 1091 | ||
1094 | busfreq_mon_reset(data); | 1092 | busfreq_mon_reset(data); |
1095 | return 0; | 1093 | return 0; |
@@ -1132,4 +1130,3 @@ module_exit(exynos4_busfreq_exit); | |||
1132 | MODULE_LICENSE("GPL"); | 1130 | MODULE_LICENSE("GPL"); |
1133 | MODULE_DESCRIPTION("EXYNOS4 busfreq driver with devfreq framework"); | 1131 | MODULE_DESCRIPTION("EXYNOS4 busfreq driver with devfreq framework"); |
1134 | MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); | 1132 | MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); |
1135 | MODULE_ALIAS("exynos4-busfreq"); | ||