mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Revert "PM / devfreq: Add show_one macro to delete the duplicate code"
This reverts commit 3104fa3081.
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 <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
This commit is contained in:
parent
ab8f58ad72
commit
1051e2c304
1 changed files with 11 additions and 9 deletions
|
|
@ -1124,6 +1124,12 @@ unlock:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%lu\n", to_devfreq(dev)->min_freq);
|
||||
}
|
||||
|
||||
static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
|
|
@ -1150,17 +1156,13 @@ unlock:
|
|||
mutex_unlock(&df->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define show_one(name) \
|
||||
static ssize_t name##_show \
|
||||
(struct device *dev, struct device_attribute *attr, char *buf) \
|
||||
{ \
|
||||
return sprintf(buf, "%lu\n", to_devfreq(dev)->name); \
|
||||
}
|
||||
show_one(min_freq);
|
||||
show_one(max_freq);
|
||||
|
||||
static DEVICE_ATTR_RW(min_freq);
|
||||
|
||||
static ssize_t max_freq_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%lu\n", to_devfreq(dev)->max_freq);
|
||||
}
|
||||
static DEVICE_ATTR_RW(max_freq);
|
||||
|
||||
static ssize_t available_frequencies_show(struct device *d,
|
||||
|
|
|
|||
Loading…
Reference in a new issue