Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326160
b: refs/heads/master
c: 65ec17b
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent 62891ce commit 8054b38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 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: 33fd2b84c94f978e661c20267548b736d84f4645
refs/heads/master: 65ec17b0d5a5351846e3503d5599e1630e57ffc4
9 changes: 3 additions & 6 deletions trunk/drivers/hwmon/adt7411.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static int __devinit adt7411_probe(struct i2c_client *client,
struct adt7411_data *data;
int ret;

data = kzalloc(sizeof(*data), GFP_KERNEL);
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;

Expand All @@ -294,14 +294,14 @@ static int __devinit adt7411_probe(struct i2c_client *client,
ret = adt7411_modify_bit(client, ADT7411_REG_CFG1,
ADT7411_CFG1_START_MONITOR, 1);
if (ret < 0)
goto exit_free;
return ret;

/* force update on first occasion */
data->next_update = jiffies;

ret = sysfs_create_group(&client->dev.kobj, &adt7411_attr_grp);
if (ret)
goto exit_free;
return ret;

data->hwmon_dev = hwmon_device_register(&client->dev);
if (IS_ERR(data->hwmon_dev)) {
Expand All @@ -315,8 +315,6 @@ static int __devinit adt7411_probe(struct i2c_client *client,

exit_remove:
sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp);
exit_free:
kfree(data);
return ret;
}

Expand All @@ -326,7 +324,6 @@ static int __devexit adt7411_remove(struct i2c_client *client)

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &adt7411_attr_grp);
kfree(data);
return 0;
}

Expand Down

0 comments on commit 8054b38

Please sign in to comment.