Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326152
b: refs/heads/master
c: be92304
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent 2e852c3 commit d5a56e5
Show file tree
Hide file tree
Showing 2 changed files with 7 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: a34c26d8e288d48e70c0e722da0c745e14d74e3a
refs/heads/master: be92304034220ee94a34df379101f14570db331b
16 changes: 6 additions & 10 deletions trunk/drivers/hwmon/ad7314.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev)
int ret;
struct ad7314_data *chip;

chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
ret = -ENOMEM;
goto error_ret;
}
chip = devm_kzalloc(&spi_dev->dev, sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;

dev_set_drvdata(&spi_dev->dev, chip);

ret = sysfs_create_group(&spi_dev->dev.kobj, &ad7314_group);
if (ret < 0)
goto error_free_chip;
return ret;

chip->hwmon_dev = hwmon_device_register(&spi_dev->dev);
if (IS_ERR(chip->hwmon_dev)) {
ret = PTR_ERR(chip->hwmon_dev);
Expand All @@ -132,9 +132,6 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev)
return 0;
error_remove_group:
sysfs_remove_group(&spi_dev->dev.kobj, &ad7314_group);
error_free_chip:
kfree(chip);
error_ret:
return ret;
}

Expand All @@ -144,7 +141,6 @@ static int __devexit ad7314_remove(struct spi_device *spi_dev)

hwmon_device_unregister(chip->hwmon_dev);
sysfs_remove_group(&spi_dev->dev.kobj, &ad7314_group);
kfree(chip);

return 0;
}
Expand Down

0 comments on commit d5a56e5

Please sign in to comment.