summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2011-09-13 12:30:11 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-21 15:09:00 +0200
commit75d404ec041ef0e036e3100f730391f6e0818019 (patch)
tree389209a5ecd407bcd4b647745a2e08f1f11d5685 /drivers/media/dvb/frontends
parent[media] em28xx: ERROR: "em28xx_add_into_devlist" [drivers/media/video/em28xx/... (diff)
downloadlinux-75d404ec041ef0e036e3100f730391f6e0818019.tar.xz
linux-75d404ec041ef0e036e3100f730391f6e0818019.zip
[media] tda10071: do not download last byte of fw
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/tda10071.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/tda10071.c b/drivers/media/dvb/frontends/tda10071.c
index 26b52cc83c61..352ddc656ad6 100644
--- a/drivers/media/dvb/frontends/tda10071.c
+++ b/drivers/media/dvb/frontends/tda10071.c
@@ -839,7 +839,7 @@ static int tda10071_init(struct dvb_frontend *fe)
{
struct tda10071_priv *priv = fe->demodulator_priv;
struct tda10071_cmd cmd;
- int ret, i, len, remaining;
+ int ret, i, len, remaining, fw_size;
const struct firmware *fw;
u8 *fw_file = TDA10071_DEFAULT_FIRMWARE;
u8 tmp, buf[4];
@@ -968,14 +968,17 @@ static int tda10071_init(struct dvb_frontend *fe)
info("downloading firmware from file '%s'", fw_file);
- for (remaining = fw->size; remaining > 0;
+ /* do not download last byte */
+ fw_size = fw->size - 1;
+
+ for (remaining = fw_size; remaining > 0;
remaining -= (priv->cfg.i2c_wr_max - 1)) {
len = remaining;
if (len > (priv->cfg.i2c_wr_max - 1))
len = (priv->cfg.i2c_wr_max - 1);
ret = tda10071_wr_regs(priv, 0xfa,
- (u8 *) &fw->data[fw->size - remaining], len);
+ (u8 *) &fw->data[fw_size - remaining], len);
if (ret) {
err("firmware download failed=%d", ret);
if (ret)