Commit 7b7a3c01 authored by Yuanjun Gong's avatar Yuanjun Gong Committed by Mauro Carvalho Chehab

media: dvb: mb86a16: check the return value of mb86a16_read()

return an error code if mb86a16_read() gets an unexpected return
value.
Signed-off-by: default avatarYuanjun Gong <ruc_gongyuanjun@163.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: add {} around the else statement]
parent 992ba89d
......@@ -1487,10 +1487,12 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
}
}
mb86a16_read(state, 0x15, &agcval);
mb86a16_read(state, 0x26, &cnmval);
dprintk(verbose, MB86A16_INFO, 1, "AGC = %02x CNM = %02x", agcval, cnmval);
if (mb86a16_read(state, 0x15, &agcval) != 2 || mb86a16_read(state, 0x26, &cnmval) != 2) {
dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
ret = -EREMOTEIO;
} else {
dprintk(verbose, MB86A16_INFO, 1, "AGC = %02x CNM = %02x", agcval, cnmval);
}
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment