Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326164
b: refs/heads/master
c: 64adf39
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent 7402210 commit 2aeed88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: f9286434ea64803b673bb4ec0dd7084b13c2d90b
refs/heads/master: 64adf39837c7cf744161b18598577cbe2467a01d
17 changes: 5 additions & 12 deletions trunk/drivers/hwmon/asb100.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,10 @@ static int asb100_probe(struct i2c_client *client,
int err;
struct asb100_data *data;

data = kzalloc(sizeof(struct asb100_data), GFP_KERNEL);
if (!data) {
pr_debug("probe failed, kzalloc failed!\n");
err = -ENOMEM;
goto ERROR0;
}
data = devm_kzalloc(&client->dev, sizeof(struct asb100_data),
GFP_KERNEL);
if (!data)
return -ENOMEM;

i2c_set_clientdata(client, data);
mutex_init(&data->lock);
Expand All @@ -801,7 +799,7 @@ static int asb100_probe(struct i2c_client *client,
/* Attach secondary lm75 clients */
err = asb100_detect_subclients(client);
if (err)
goto ERROR1;
return err;

/* Initialize the chip */
asb100_init_client(client);
Expand Down Expand Up @@ -829,9 +827,6 @@ static int asb100_probe(struct i2c_client *client,
ERROR3:
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);
ERROR1:
kfree(data);
ERROR0:
return err;
}

Expand All @@ -845,8 +840,6 @@ static int asb100_remove(struct i2c_client *client)
i2c_unregister_device(data->lm75[1]);
i2c_unregister_device(data->lm75[0]);

kfree(data);

return 0;
}

Expand Down

0 comments on commit 2aeed88

Please sign in to comment.