aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2012-01-08 13:34:20 -0500
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-03-18 21:26:30 -0400
commit7b102ed66030a454eac1afce3af89eb3d03b0ce4 (patch)
tree864f56541714d3e2b17204f5f49012eab663a80d
parent600151b9de97bd580f9dc09199a10f0c2b65cb97 (diff)
hwmon: (i5k_amb) fix checkpatch issues
fixed: WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; WARNING: simple_strtoul is obsolete, use kstrtoul instead + unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
-rw-r--r--drivers/hwmon/i5k_amb.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
index d22f241b6a67..a18882cc073d 100644
--- a/drivers/hwmon/i5k_amb.c
+++ b/drivers/hwmon/i5k_amb.c
@@ -159,8 +159,12 @@ static ssize_t store_amb_min(struct device *dev,
159{ 159{
160 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 160 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
161 struct i5k_amb_data *data = dev_get_drvdata(dev); 161 struct i5k_amb_data *data = dev_get_drvdata(dev);
162 unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; 162 unsigned long temp;
163 int ret = kstrtoul(buf, 10, &temp);
164 if (ret < 0)
165 return ret;
163 166
167 temp = temp / 500;
164 if (temp > 255) 168 if (temp > 255)
165 temp = 255; 169 temp = 255;
166 170
@@ -175,8 +179,12 @@ static ssize_t store_amb_mid(struct device *dev,
175{ 179{
176 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 180 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
177 struct i5k_amb_data *data = dev_get_drvdata(dev); 181 struct i5k_amb_data *data = dev_get_drvdata(dev);
178 unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; 182 unsigned long temp;
183 int ret = kstrtoul(buf, 10, &temp);
184 if (ret < 0)
185 return ret;
179 186
187 temp = temp / 500;
180 if (temp > 255) 188 if (temp > 255)
181 temp = 255; 189 temp = 255;
182 190
@@ -191,8 +199,12 @@ static ssize_t store_amb_max(struct device *dev,
191{ 199{
192 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); 200 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
193 struct i5k_amb_data *data = dev_get_drvdata(dev); 201 struct i5k_amb_data *data = dev_get_drvdata(dev);
194 unsigned long temp = simple_strtoul(buf, NULL, 10) / 500; 202 unsigned long temp;
203 int ret = kstrtoul(buf, 10, &temp);
204 if (ret < 0)
205 return ret;
195 206
207 temp = temp / 500;
196 if (temp > 255) 208 if (temp > 255)
197 temp = 255; 209 temp = 255;
198 210