mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 07:02:23 +00:00
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: 69780a3bbc
("iio: adc: Add Maxim max9611 ADC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
6272c0de13
commit
35fa70dfd6
@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client,
|
||||
int ret;
|
||||
|
||||
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
|
||||
if (IS_ERR(indio_dev))
|
||||
return PTR_ERR(indio_dev);
|
||||
if (!indio_dev)
|
||||
return -ENOMEM;
|
||||
|
||||
i2c_set_clientdata(client, indio_dev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user