Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326159
b: refs/heads/master
c: 33fd2b8
h: refs/heads/master
i:
  326157: d409d44
  326155: 90ea993
  326151: 2e852c3
  326143: 789f872
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent 7063f05 commit 62891ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 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: 34e3f7f5a283c5520e0e1a409931a632f4d2662e
refs/heads/master: 33fd2b84c94f978e661c20267548b736d84f4645
21 changes: 7 additions & 14 deletions trunk/drivers/hwmon/ads7871.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,17 @@ static int __devinit ads7871_probe(struct spi_device *spi)
* because there is no other error checking on an SPI bus
* we need to make sure we really have a chip
*/
if (val != ret) {
err = -ENODEV;
goto exit;
}
if (val != ret)
return -ENODEV;

pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL);
if (!pdata) {
err = -ENOMEM;
goto exit;
}
pdata = devm_kzalloc(&spi->dev, sizeof(struct ads7871_data),
GFP_KERNEL);
if (!pdata)
return -ENOMEM;

err = sysfs_create_group(&spi->dev.kobj, &ads7871_group);
if (err < 0)
goto error_free;
return err;

spi_set_drvdata(spi, pdata);

Expand All @@ -225,9 +222,6 @@ static int __devinit ads7871_probe(struct spi_device *spi)

error_remove:
sysfs_remove_group(&spi->dev.kobj, &ads7871_group);
error_free:
kfree(pdata);
exit:
return err;
}

Expand All @@ -237,7 +231,6 @@ static int __devexit ads7871_remove(struct spi_device *spi)

hwmon_device_unregister(pdata->hwmon_dev);
sysfs_remove_group(&spi->dev.kobj, &ads7871_group);
kfree(pdata);
return 0;
}

Expand Down

0 comments on commit 62891ce

Please sign in to comment.