aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2017-10-22 21:32:07 -0400
committerMyungJoo Ham <myungjoo.ham@samsung.com>2017-10-26 04:08:40 -0400
commit1051e2c304b5cf17d4117505985f8128c5c64fd9 (patch)
treeeb3c561f3a595e52c532c97b311f02469097e9bf /drivers/devfreq/devfreq.c
parentab8f58ad72c4d1abe59216362ddb8bfa428c9071 (diff)
Revert "PM / devfreq: Add show_one macro to delete the duplicate code"
This reverts commit 3104fa3081126c9bda35793af5f335d0ee0d5818. The {min|max}_freq_show() show the stored value of the struct devfreq. But, if the drivers/thermal/devfreq_cooling.c disables the specific frequency value, {min|max}_freq_show() have to check this situation before showing the stored value. So, this patch revert the macro in order to add the additional codes. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 6a6f88bccdee..b6ba24e5db0d 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1124,6 +1124,12 @@ unlock:
1124 return ret; 1124 return ret;
1125} 1125}
1126 1126
1127static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr,
1128 char *buf)
1129{
1130 return sprintf(buf, "%lu\n", to_devfreq(dev)->min_freq);
1131}
1132
1127static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr, 1133static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr,
1128 const char *buf, size_t count) 1134 const char *buf, size_t count)
1129{ 1135{
@@ -1150,17 +1156,13 @@ unlock:
1150 mutex_unlock(&df->lock); 1156 mutex_unlock(&df->lock);
1151 return ret; 1157 return ret;
1152} 1158}
1159static DEVICE_ATTR_RW(min_freq);
1153 1160
1154#define show_one(name) \ 1161static ssize_t max_freq_show(struct device *dev, struct device_attribute *attr,
1155static ssize_t name##_show \ 1162 char *buf)
1156(struct device *dev, struct device_attribute *attr, char *buf) \ 1163{
1157{ \ 1164 return sprintf(buf, "%lu\n", to_devfreq(dev)->max_freq);
1158 return sprintf(buf, "%lu\n", to_devfreq(dev)->name); \
1159} 1165}
1160show_one(min_freq);
1161show_one(max_freq);
1162
1163static DEVICE_ATTR_RW(min_freq);
1164static DEVICE_ATTR_RW(max_freq); 1166static DEVICE_ATTR_RW(max_freq);
1165 1167
1166static ssize_t available_frequencies_show(struct device *d, 1168static ssize_t available_frequencies_show(struct device *d,