Commit 35fa70df authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

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: 69780a3b ("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 6272c0de
...@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client, ...@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
int ret; int ret;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
if (IS_ERR(indio_dev)) if (!indio_dev)
return PTR_ERR(indio_dev); return -ENOMEM;
i2c_set_clientdata(client, indio_dev); i2c_set_clientdata(client, indio_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment