Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316014
b: refs/heads/master
c: 140849e
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent dd50366 commit d122e29
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 144d2b9985d363bd330788356b4ee8ffbf6b0363
refs/heads/master: 140849e105fd0aadab035923f4cb454ce0518887
18 changes: 6 additions & 12 deletions trunk/drivers/hwmon/w83792d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,19 +1422,17 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
struct device *dev = &client->dev;
int i, val1, err;

data = kzalloc(sizeof(struct w83792d_data), GFP_KERNEL);
if (!data) {
err = -ENOMEM;
goto ERROR0;
}
data = devm_kzalloc(dev, sizeof(struct w83792d_data), GFP_KERNEL);
if (!data)
return -ENOMEM;

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

err = w83792d_detect_subclients(client);
if (err)
goto ERROR1;
return err;

/* Initialize the chip */
w83792d_init_client(client);
Expand All @@ -1448,7 +1446,7 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* Register sysfs hooks */
err = sysfs_create_group(&dev->kobj, &w83792d_group);
if (err)
goto ERROR3;
goto exit_i2c_unregister;

/*
* Read GPIO enable register to check if pins for fan 4,5 are used as
Expand Down Expand Up @@ -1493,14 +1491,11 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
sysfs_remove_group(&dev->kobj, &w83792d_group);
for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
sysfs_remove_group(&dev->kobj, &w83792d_group_fan[i]);
ERROR3:
exit_i2c_unregister:
if (data->lm75[0] != NULL)
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 @@ -1521,7 +1516,6 @@ w83792d_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 d122e29

Please sign in to comment.