Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326171
b: refs/heads/master
c: a81b0f7
h: refs/heads/master
i:
  326169: c9d1eec
  326167: 925b012
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent 794f972 commit 1f9b9e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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: 05639bcb4b0d509090026e836addaa3b28a14d14
refs/heads/master: a81b0f73d10add406fca13c91c73e6a3cd505b46
10 changes: 3 additions & 7 deletions trunk/drivers/hwmon/g760a.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ static int g760a_probe(struct i2c_client *client,
I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;

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

Expand All @@ -223,7 +224,7 @@ static int g760a_probe(struct i2c_client *client,
/* Register sysfs hooks */
err = sysfs_create_group(&client->dev.kobj, &g760a_group);
if (err)
goto error_sysfs_create_group;
return err;

data->hwmon_dev = hwmon_device_register(&client->dev);
if (IS_ERR(data->hwmon_dev)) {
Expand All @@ -235,9 +236,6 @@ static int g760a_probe(struct i2c_client *client,

error_hwmon_device_register:
sysfs_remove_group(&client->dev.kobj, &g760a_group);
error_sysfs_create_group:
kfree(data);

return err;
}

Expand All @@ -246,8 +244,6 @@ static int g760a_remove(struct i2c_client *client)
struct g760a_data *data = i2c_get_clientdata(client);
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &g760a_group);
kfree(data);

return 0;
}

Expand Down

0 comments on commit 1f9b9e4

Please sign in to comment.