Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292103
b: refs/heads/master
c: 7b102ed
h: refs/heads/master
i:
  292101: 8d7be10
  292099: bccf473
  292095: a23760d
v: v3
  • Loading branch information
Frans Meulenbroeks authored and Guenter Roeck committed Mar 19, 2012
1 parent 4860324 commit 9c9934f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 600151b9de97bd580f9dc09199a10f0c2b65cb97
refs/heads/master: 7b102ed66030a454eac1afce3af89eb3d03b0ce4
18 changes: 15 additions & 3 deletions trunk/drivers/hwmon/i5k_amb.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ static ssize_t store_amb_min(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
unsigned long temp;
int ret = kstrtoul(buf, 10, &temp);
if (ret < 0)
return ret;

temp = temp / 500;
if (temp > 255)
temp = 255;

Expand All @@ -175,8 +179,12 @@ static ssize_t store_amb_mid(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
unsigned long temp;
int ret = kstrtoul(buf, 10, &temp);
if (ret < 0)
return ret;

temp = temp / 500;
if (temp > 255)
temp = 255;

Expand All @@ -191,8 +199,12 @@ static ssize_t store_amb_max(struct device *dev,
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i5k_amb_data *data = dev_get_drvdata(dev);
unsigned long temp = simple_strtoul(buf, NULL, 10) / 500;
unsigned long temp;
int ret = kstrtoul(buf, 10, &temp);
if (ret < 0)
return ret;

temp = temp / 500;
if (temp > 255)
temp = 255;

Expand Down

0 comments on commit 9c9934f

Please sign in to comment.