Commit f7a28df7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: dac: ti-dac5571: fix an error code in probe()

If we have an unexpected number of channels then return -EINVAL instead
of returning success.

Fixes: df38a4a7 ("iio: dac: add TI DAC5571 family support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210816183954.GB2068@kiliSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 6880fa6c
...@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client, ...@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client,
data->dac5571_pwrdwn = dac5571_pwrdwn_quad; data->dac5571_pwrdwn = dac5571_pwrdwn_quad;
break; break;
default: default:
ret = -EINVAL;
goto err; goto err;
} }
......
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