Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316015
b: refs/heads/master
c: 6e13bb0
h: refs/heads/master
i:
  316013: dd50366
  316011: 4090686
  316007: 733c493
  315999: ed14daf
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent d122e29 commit f91c0d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: 140849e105fd0aadab035923f4cb454ce0518887
refs/heads/master: 6e13bb06f62f11797ceb5f28c392f703dc0aa548
15 changes: 5 additions & 10 deletions trunk/drivers/hwmon/w83791d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,18 +1384,17 @@ static int w83791d_probe(struct i2c_client *client,
(val1 >> 5) & 0x07, (val1 >> 1) & 0x0f, val1);
#endif

data = kzalloc(sizeof(struct w83791d_data), GFP_KERNEL);
if (!data) {
err = -ENOMEM;
goto error0;
}
data = devm_kzalloc(&client->dev, sizeof(struct w83791d_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;

i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);

err = w83791d_detect_subclients(client);
if (err)
goto error1;
return err;

/* Initialize the chip */
w83791d_init_client(client);
Expand Down Expand Up @@ -1440,9 +1439,6 @@ static int w83791d_probe(struct i2c_client *client,
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
error1:
kfree(data);
error0:
return err;
}

Expand All @@ -1458,7 +1454,6 @@ static int w83791d_remove(struct i2c_client *client)
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);

kfree(data);
return 0;
}

Expand Down

0 comments on commit f91c0d3

Please sign in to comment.