diff mbox series

iio: dac: fix an error code in probe()

Message ID 20210816183954.GB2068@kili (mailing list archive)
State Accepted
Headers show
Series iio: dac: fix an error code in probe() | expand

Commit Message

Dan Carpenter Aug. 16, 2021, 6:39 p.m. UTC
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>
---
 drivers/iio/dac/ti-dac5571.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jonathan Cameron Aug. 29, 2021, 3:56 p.m. UTC | #1
On Mon, 16 Aug 2021 21:39:54 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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>
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

> ---
>  drivers/iio/dac/ti-dac5571.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  	}
>
diff mbox series

Patch

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;
 	}