Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220457
b: refs/heads/master
c: b6fc1ba
h: refs/heads/master
i:
  220455: 226a4d6
v: v3
  • Loading branch information
Guenter Roeck authored and Jean Delvare committed Oct 28, 2010
1 parent 4abd047 commit b68aae2
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 88073bb1ba969d4e3c41dc5f35c902c6b7dab0a7
refs/heads/master: b6fc1bacc7eae99d276d096fe0c702b1e13e4499
18 changes: 11 additions & 7 deletions trunk/drivers/hwmon/lm90.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,15 @@ static int lm90_detect(struct i2c_client *new_client,
return 0;
}

static void lm90_remove_files(struct i2c_client *client, struct lm90_data *data)
{
if (data->flags & LM90_HAVE_OFFSET)
device_remove_file(&client->dev,
&sensor_dev_attr_temp2_offset.dev_attr);
device_remove_file(&client->dev, &dev_attr_pec);
sysfs_remove_group(&client->dev.kobj, &lm90_group);
}

static int lm90_probe(struct i2c_client *new_client,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -889,8 +898,7 @@ static int lm90_probe(struct i2c_client *new_client,
return 0;

exit_remove_files:
sysfs_remove_group(&new_client->dev.kobj, &lm90_group);
device_remove_file(&new_client->dev, &dev_attr_pec);
lm90_remove_files(new_client, data);
exit_free:
kfree(data);
exit:
Expand Down Expand Up @@ -937,11 +945,7 @@ static int lm90_remove(struct i2c_client *client)
struct lm90_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &lm90_group);
device_remove_file(&client->dev, &dev_attr_pec);
if (data->flags & LM90_HAVE_OFFSET)
device_remove_file(&client->dev,
&sensor_dev_attr_temp2_offset.dev_attr);
lm90_remove_files(client, data);

/* Restore initial configuration */
i2c_smbus_write_byte_data(client, LM90_REG_W_CONFIG1,
Expand Down

0 comments on commit b68aae2

Please sign in to comment.