Commit d0e46420 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by MyungJoo Ham
Browse files

PM / devfreq: Drop custom MIN/MAX macros



Drop the custom MIN/MAX macros in favour of the standard min/max from
kernel.h

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
parent 23c7b54c
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@
#include <linux/of.h>
#include "governor.h"

#define MAX(a,b)	((a > b) ? a : b)
#define MIN(a,b)	((a < b) ? a : b)

static struct class *devfreq_class;

/*
@@ -324,8 +321,8 @@ int update_devfreq(struct devfreq *devfreq)
	 * max_freq
	 * min_freq
	 */
	max_freq = MIN(devfreq->scaling_max_freq, devfreq->max_freq);
	min_freq = MAX(devfreq->scaling_min_freq, devfreq->min_freq);
	max_freq = min(devfreq->scaling_max_freq, devfreq->max_freq);
	min_freq = max(devfreq->scaling_min_freq, devfreq->min_freq);

	if (min_freq && freq < min_freq) {
		freq = min_freq;
@@ -1197,7 +1194,7 @@ static ssize_t min_freq_show(struct device *dev, struct device_attribute *attr,
{
	struct devfreq *df = to_devfreq(dev);

	return sprintf(buf, "%lu\n", MAX(df->scaling_min_freq, df->min_freq));
	return sprintf(buf, "%lu\n", max(df->scaling_min_freq, df->min_freq));
}

static ssize_t max_freq_store(struct device *dev, struct device_attribute *attr,
@@ -1233,7 +1230,7 @@ static ssize_t max_freq_show(struct device *dev, struct device_attribute *attr,
{
	struct devfreq *df = to_devfreq(dev);

	return sprintf(buf, "%lu\n", MIN(df->scaling_max_freq, df->max_freq));
	return sprintf(buf, "%lu\n", min(df->scaling_max_freq, df->max_freq));
}
static DEVICE_ATTR_RW(max_freq);