V4L/DVB (6965): tda18271: fix analog tuning regression caused by earlier changeset
An earlier patch, "tda18271: fail table lookups if frequency is out of range"
broke analog support on certain hardware. This patch fixes that problem, by
allowing the RF_CAL byte to be set to the maximum value, in cases of the
frequency being out of range.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
index 528a2ec..0402c7d 100644
--- a/drivers/media/dvb/frontends/tda18271-tables.c
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -1098,7 +1098,7 @@
}
while ((map[i].lomax * 1000) < *freq) {
- if (map[i].lomax == 0) {
+ if (map[i + 1].lomax == 0) {
tda_map("%s: frequency (%d) out of range\n",
map_name, *freq);
ret = -ERANGE;
@@ -1169,7 +1169,7 @@
}
while ((map[i].rfmax * 1000) < *freq) {
- if (map[i].rfmax == 0) {
+ if (map[i + 1].rfmax == 0) {
tda_map("%s: frequency (%d) out of range\n",
map_name, *freq);
ret = -ERANGE;