Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab6cb71d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM / devfreq: bw_hwmon: Fix parsing of mbps_zones" into msm-4.9

parents 8ad1baef fe241a08
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -143,25 +143,27 @@ static ssize_t store_list_##name(struct device *dev, \
{									\
	struct devfreq *df = to_devfreq(dev);				\
	struct hwmon_node *hw = df->data;				\
	int ret;							\
	int ret, numvals;						\
	unsigned int i = 0, val;					\
	char **strlist;							\
									\
	do {								\
		ret = kstrtoint(buf, 10, &val);				\
	strlist = argv_split(GFP_KERNEL, buf, &numvals);		\
	if (!strlist)							\
		return -ENOMEM;						\
	numvals = min(numvals, n - 1);					\
	for (i = 0; i < numvals; i++) {					\
		ret = kstrtouint(strlist[i], 10, &val);			\
		if (ret)						\
			break;						\
		buf = strnchr(buf, PAGE_SIZE, ' ');			\
		if (buf)						\
			buf++;						\
			goto out;					\
		val = max(val, _min);					\
		val = min(val, _max);					\
		hw->name[i] = val;					\
		i++;							\
	} while (buf && i < n - 1);					\
	if (i < 1)							\
		return -EINVAL;						\
	}								\
	ret = count;							\
out:									\
	argv_free(strlist);						\
	hw->name[i] = 0;						\
	return count;							\
	return ret;							\
}

#define gov_list_attr(__attr, n, min, max)	\