提交 683e98b6 编写于 作者: O Olli Salonen 提交者: Mauro Carvalho Chehab

[media] si2168: return error if set_frontend is called with invalid parameters

This patch should is based on Antti's silabs branch.

According to dvb-frontend.h set_frontend may be called with bandwidth_hz set to 0 if automatic bandwidth is required. Si2168 does not support automatic bandwidth and does not declare FE_CAN_BANDWIDTH_AUTO in caps.

This patch will change the behaviour in a way that EINVAL is returned if bandwidth_hz is 0.
Signed-off-by: NOlli Salonen <olli.salonen@iki.fi>
Reviewed-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 3656cddd
......@@ -180,7 +180,10 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
goto err;
}
if (c->bandwidth_hz <= 5000000)
if (c->bandwidth_hz == 0) {
ret = -EINVAL;
goto err;
} else if (c->bandwidth_hz <= 5000000)
bandwidth = 0x05;
else if (c->bandwidth_hz <= 6000000)
bandwidth = 0x06;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册