Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209994
b: refs/heads/master
c: c12c507
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Jean Delvare committed Aug 25, 2010
1 parent 54e9c53 commit f6ee364
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 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: 45ff34d32a19e9008e7202ba2a7c0d0f40420228
refs/heads/master: c12c507d7185fe4e8ada7ed9832957576eefecf8
38 changes: 19 additions & 19 deletions trunk/drivers/hwmon/ads7871.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,30 +160,12 @@ static const struct attribute_group ads7871_group = {

static int __devinit ads7871_probe(struct spi_device *spi)
{
int status, ret, err = 0;
int ret, err;
uint8_t val;
struct ads7871_data *pdata;

dev_dbg(&spi->dev, "probe\n");

pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL);
if (!pdata) {
err = -ENOMEM;
goto exit;
}

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

pdata->hwmon_dev = hwmon_device_register(&spi->dev);
if (IS_ERR(pdata->hwmon_dev)) {
err = PTR_ERR(pdata->hwmon_dev);
goto error_remove;
}

spi_set_drvdata(spi, pdata);

/* Configure the SPI bus */
spi->mode = (SPI_MODE_0);
spi->bits_per_word = 8;
Expand All @@ -201,6 +183,24 @@ static int __devinit ads7871_probe(struct spi_device *spi)
we need to make sure we really have a chip*/
if (val != ret) {
err = -ENODEV;
goto exit;
}

pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL);
if (!pdata) {
err = -ENOMEM;
goto exit;
}

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

spi_set_drvdata(spi, pdata);

pdata->hwmon_dev = hwmon_device_register(&spi->dev);
if (IS_ERR(pdata->hwmon_dev)) {
err = PTR_ERR(pdata->hwmon_dev);
goto error_remove;
}

Expand Down

0 comments on commit f6ee364

Please sign in to comment.