Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292223
b: refs/heads/master
c: b8a5a7c
h: refs/heads/master
i:
  292221: 1740c55
  292219: 9e505df
  292215: ce9518d
  292207: 0e0766a
  292191: 76e385e
  292159: a3012b7
  292095: a23760d
v: v3
  • Loading branch information
Guenter Roeck authored and Guenter Roeck committed Mar 19, 2012
1 parent dfcd7b4 commit 8e37959
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 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: 36839287204f1c419907d3873f1e45062000e8a2
refs/heads/master: b8a5a7cebded23eb311b8db73a11ed23b4135170
12 changes: 3 additions & 9 deletions trunk/drivers/hwmon/smm665.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,9 @@ static int smm665_probe(struct i2c_client *client,
if (i2c_smbus_read_byte_data(client, SMM665_ADOC_ENABLE) < 0)
return -ENODEV;

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

i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);
Expand All @@ -596,7 +595,7 @@ static int smm665_probe(struct i2c_client *client,
data->cmdreg = i2c_new_dummy(adapter, (client->addr & ~SMM665_REGMASK)
| SMM665_CMDREG_BASE);
if (!data->cmdreg)
goto out_kfree;
return -ENOMEM;

switch (data->type) {
case smm465:
Expand Down Expand Up @@ -679,9 +678,6 @@ static int smm665_probe(struct i2c_client *client,
sysfs_remove_group(&client->dev.kobj, &smm665_group);
out_unregister:
i2c_unregister_device(data->cmdreg);
out_kfree:
kfree(data);
out_return:
return ret;
}

Expand All @@ -693,8 +689,6 @@ static int smm665_remove(struct i2c_client *client)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &smm665_group);

kfree(data);

return 0;
}

Expand Down

0 comments on commit 8e37959

Please sign in to comment.