Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292211
b: refs/heads/master
c: e200c14
h: refs/heads/master
i:
  292209: c50a543
  292207: 0e0766a
v: v3
  • Loading branch information
Guenter Roeck authored and Guenter Roeck committed Mar 19, 2012
1 parent 63e4828 commit 3f80014
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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: 01d9def5bae959de5d420a2fc09fcc58106513fa
refs/heads/master: e200c14f60765ee3be6517659ec8fea06e299e39
21 changes: 11 additions & 10 deletions trunk/drivers/hwmon/lm70.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ static int __devinit lm70_probe(struct spi_device *spi)
mutex_init(&p_lm70->lock);
p_lm70->chip = chip;

/* sysfs hook */
p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
if (IS_ERR(p_lm70->hwmon_dev)) {
dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
status = PTR_ERR(p_lm70->hwmon_dev);
goto out_dev_reg_failed;
}
spi_set_drvdata(spi, p_lm70);

if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input))
Expand All @@ -171,12 +164,20 @@ static int __devinit lm70_probe(struct spi_device *spi)
goto out_dev_create_file_failed;
}

/* sysfs hook */
p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
if (IS_ERR(p_lm70->hwmon_dev)) {
dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
status = PTR_ERR(p_lm70->hwmon_dev);
goto out_dev_reg_failed;
}

return 0;

out_dev_reg_failed:
device_remove_file(&spi->dev, &dev_attr_name);
out_dev_create_file_failed:
device_remove_file(&spi->dev, &dev_attr_temp1_input);
hwmon_device_unregister(p_lm70->hwmon_dev);
out_dev_reg_failed:
spi_set_drvdata(spi, NULL);
kfree(p_lm70);
return status;
Expand All @@ -186,9 +187,9 @@ static int __devexit lm70_remove(struct spi_device *spi)
{
struct lm70 *p_lm70 = spi_get_drvdata(spi);

hwmon_device_unregister(p_lm70->hwmon_dev);
device_remove_file(&spi->dev, &dev_attr_temp1_input);
device_remove_file(&spi->dev, &dev_attr_name);
hwmon_device_unregister(p_lm70->hwmon_dev);
spi_set_drvdata(spi, NULL);
kfree(p_lm70);

Expand Down

0 comments on commit 3f80014

Please sign in to comment.