diff mbox

[1/1] si2168: Fix i2c_add_mux_adapter return value in probe function. In case it failed the return value was always 0.

Message ID 1405625888-9056-1-git-send-email-ljalvs@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Luis Alves July 17, 2014, 7:38 p.m. UTC
Signed-off-by: Luis Alves <ljalvs@gmail.com>
---
 drivers/media/dvb-frontends/si2168.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Antti Palosaari July 17, 2014, 9:34 p.m. UTC | #1
Gah, there was a bug. Will apply that. Have to check if there is same 
mistake on other drivers I have used I2C mux.

regards
Antti

On 07/17/2014 10:38 PM, Luis Alves wrote:
> Signed-off-by: Luis Alves <ljalvs@gmail.com>
> ---
>   drivers/media/dvb-frontends/si2168.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> index 7980741..3fed522 100644
> --- a/drivers/media/dvb-frontends/si2168.c
> +++ b/drivers/media/dvb-frontends/si2168.c
> @@ -619,8 +619,10 @@ static int si2168_probe(struct i2c_client *client,
>   	/* create mux i2c adapter for tuner */
>   	s->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, s,
>   			0, 0, 0, si2168_select, si2168_deselect);
> -	if (s->adapter == NULL)
> +	if (s->adapter == NULL) {
> +		ret = -ENODEV;
>   		goto err;
> +	}
>
>   	/* create dvb_frontend */
>   	memcpy(&s->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));
>
diff mbox

Patch

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 7980741..3fed522 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -619,8 +619,10 @@  static int si2168_probe(struct i2c_client *client,
 	/* create mux i2c adapter for tuner */
 	s->adapter = i2c_add_mux_adapter(client->adapter, &client->dev, s,
 			0, 0, 0, si2168_select, si2168_deselect);
-	if (s->adapter == NULL)
+	if (s->adapter == NULL) {
+		ret = -ENODEV;
 		goto err;
+	}
 
 	/* create dvb_frontend */
 	memcpy(&s->fe.ops, &si2168_ops, sizeof(struct dvb_frontend_ops));