Skip to contentSkip to conversation

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

PATCH In review Luis Alves 2 participants 2 messages Jul 17, 2014

Subsystems (2)
lore
Share & tools
lore

Luis Alves

author
#0 lore raw

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

---
 drivers/media/dvb-frontends/si2168.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/dvb-frontends/si2168.c +3 -1
index 7980741..3fed522 100644
@@ -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));
Signature · 1 line
1.9.1
#1 lore raw

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

Quoted 22 lines · Luis Alves
---
  drivers/media/dvb-frontends/si2168.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/dvb-frontends/si2168.c +3 -1
index 7980741..3fed522 100644
@@ -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));
Signature · 1 line
http://palosaari.fi/