diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-20 06:26:18 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-04-26 02:24:48 -0400 |
commit | 35fa70dfd6e6f270d7aabb3470855208b11ac9fb (patch) | |
tree | e5bf52d2495c28e01b61642ba1ccff0cf740f6e0 | |
parent | 6272c0de13abf1480f701d38288f28a11b4301c4 (diff) |
iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
devm_iio_device_alloc() doesn't return ERR_PTRs, it returns NULLs.
Fixes: 69780a3bbc0b ("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/adc/max9611.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index ec82106480e1..dc3869bf3248 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c | |||
@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client, | |||
536 | int ret; | 536 | int ret; |
537 | 537 | ||
538 | indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); | 538 | indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); |
539 | if (IS_ERR(indio_dev)) | 539 | if (!indio_dev) |
540 | return PTR_ERR(indio_dev); | 540 | return -ENOMEM; |
541 | 541 | ||
542 | i2c_set_clientdata(client, indio_dev); | 542 | i2c_set_clientdata(client, indio_dev); |
543 | 543 | ||