Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174320
b: refs/heads/master
c: 0f14480
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Dec 9, 2009
1 parent 81b4457 commit ec550d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 3d849981711741e76e501e4b9e3e7b792f2b0fd5
refs/heads/master: 0f14480b62235ef4fce1cd4755e1cde4c9be5f78
16 changes: 10 additions & 6 deletions trunk/drivers/hwmon/adt7475.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,14 @@ static int adt7475_detect(struct i2c_client *client, int kind,
return 0;
}

static void adt7475_remove_files(struct i2c_client *client,
struct adt7475_data *data)
{
sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group);
if (data->has_voltage & 0x39)
sysfs_remove_group(&client->dev.kobj, &adt7490_attr_group);
}

static int adt7475_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -1156,9 +1164,7 @@ static int adt7475_probe(struct i2c_client *client,
return 0;

eremove:
sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group);
if (data->has_voltage & 0x39)
sysfs_remove_group(&client->dev.kobj, &adt7490_attr_group);
adt7475_remove_files(client, data);
efree:
kfree(data);
return ret;
Expand All @@ -1169,9 +1175,7 @@ static int adt7475_remove(struct i2c_client *client)
struct adt7475_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &adt7475_attr_group);
if (data->has_voltage & 0x39)
sysfs_remove_group(&client->dev.kobj, &adt7490_attr_group);
adt7475_remove_files(client, data);
kfree(data);

return 0;
Expand Down

0 comments on commit ec550d7

Please sign in to comment.