summaryrefslogtreecommitdiff
path: root/drivers/iio/dac/ti-dac5571.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-08-16 21:39:54 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-09-14 12:02:08 +0100
commitf7a28df7db84eb3410e9eca37832efa5aed93338 (patch)
tree2593efdf941021a4160537fcfe50cd90ec5ad450 /drivers/iio/dac/ti-dac5571.c
parent6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f (diff)
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: df38a4a72a3b ("iio: dac: add TI DAC5571 family support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20210816183954.GB2068@kili Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/dac/ti-dac5571.c')
-rw-r--r--drivers/iio/dac/ti-dac5571.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
index 2a5ba1b08a1d..546a4cf6c5ef 100644
--- a/drivers/iio/dac/ti-dac5571.c
+++ b/drivers/iio/dac/ti-dac5571.c
@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client,
data->dac5571_pwrdwn = dac5571_pwrdwn_quad;
break;
default:
+ ret = -EINVAL;
goto err;
}