iio: dac: fix an error code in probe()
Subsystems (2)
PATCH 1/1 iio: dac: 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 <[email protected]>
--- drivers/iio/dac/ti-dac5571.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/dac/ti-dac5571.c +1 -0
@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client, data->dac5571_pwrdwn = dac5571_pwrdwn_quad;break ;default : + ret = -EINVAL ; goto err; }
Signature · 1 line
2.20.1
Jonathan Cameron
maintainerQuoted 5 lines · On Mon, 16 Aug 2021 21:39:54 +0300 Dan Carpenter <[email protected]>…
If we have an unexpected number of channels then return
-EINVALinstead of returning success.Fixes df38a4a72a3b ("iio: dac: add TI DAC5571 family support")Signed-off-by Dan Carpenter <[email protected]>
Given I'm not going to be doing another fixes pull for 5.14 (bit late afterall!) I've rebased the fixes-togreg branch to match staging/staging-next which will go in during the merge window + applied this on top.
Thanks,
Jonathan
Quoted 16 lines
--- drivers/iio/dac/ti-dac5571.c | 1 + 1 file changed, 1 insertion(+)drivers/iio/dac/ti-dac5571.c +1
-0@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client, data->dac5571_pwrdwn = dac5571_pwrdwn_quad;break ;default : + ret = -EINVAL ; goto err; }