Commit 212fa081 authored by Olli Salonen's avatar Olli Salonen Committed by Mauro Carvalho Chehab

[media] ds3000: return error if invalid symbol rate is set

Return -EINVAL if ds3000_set_frontend is called with invalid parameters.

v1 of the patch series got incorrect subject lines.
Signed-off-by: default avatarOlli Salonen <olli.salonen@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 155af08b
......@@ -959,6 +959,15 @@ static int ds3000_set_frontend(struct dvb_frontend *fe)
/* enable ac coupling */
ds3000_writereg(state, 0x25, 0x8a);
if ((c->symbol_rate < ds3000_ops.info.symbol_rate_min) ||
(c->symbol_rate > ds3000_ops.info.symbol_rate_max)) {
dprintk("%s() symbol_rate %u out of range (%u ... %u)\n",
__func__, c->symbol_rate,
ds3000_ops.info.symbol_rate_min,
ds3000_ops.info.symbol_rate_max);
return -EINVAL;
}
/* enhance symbol rate performance */
if ((c->symbol_rate / 1000) <= 5000) {
value = 29777 / (c->symbol_rate / 1000) + 1;
......
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