Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292109
b: refs/heads/master
c: e91aef2
h: refs/heads/master
i:
  292107: 70c5c37
v: v3
  • Loading branch information
Frans Meulenbroeks authored and Guenter Roeck committed Mar 19, 2012
1 parent b55c21c commit 9fd46d6
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 599654255d4a933e71641b5e3cb8ceb753830c5f
refs/heads/master: e91aef22cdb9ca12099d6d21f88de5036fe26fb5
12 changes: 9 additions & 3 deletions trunk/drivers/hwmon/ad7418.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i2c_client *client = to_i2c_client(dev);
struct ad7418_data *data = i2c_get_clientdata(client);
long temp = simple_strtol(buf, NULL, 10);
long temp;
int ret = kstrtol(buf, 10, &temp);

if (ret < 0)
return ret;

mutex_lock(&data->lock);
data->temp[attr->index] = LM75_TEMP_TO_REG(temp);
Expand Down Expand Up @@ -228,7 +232,8 @@ static int ad7418_probe(struct i2c_client *client,
goto exit;
}

if (!(data = kzalloc(sizeof(struct ad7418_data), GFP_KERNEL))) {
data = kzalloc(sizeof(struct ad7418_data), GFP_KERNEL);
if (!data) {
err = -ENOMEM;
goto exit;
}
Expand Down Expand Up @@ -261,7 +266,8 @@ static int ad7418_probe(struct i2c_client *client,
ad7418_init_client(client);

/* Register sysfs hooks */
if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))
err = sysfs_create_group(&client->dev.kobj, &data->attrs);
if (err)
goto exit_free;

data->hwmon_dev = hwmon_device_register(&client->dev);
Expand Down

0 comments on commit 9fd46d6

Please sign in to comment.