aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2013-11-27 15:17:43 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-12-04 12:24:42 -0500
commitd18a88b1f535d627412b2a265d71b2f7d464860e (patch)
treef702f8b1bae08efc3fa628315d3de895007ab155 /drivers/media
parent5264682a3cd197b79995573449249573adb8267c (diff)
[media] af9033: fix broken I2C
Driver did not work anymore since I2C has gone broken due to recent commit: commit 37ebaf6891ee81687bb558e8375c0712d8264ed8 [media] dvb-frontends: Don't use dynamic static allocation Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/af9033.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c
index 30ee59052157..65728c25ea05 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -170,18 +170,18 @@ static int af9033_rd_reg_mask(struct af9033_state *state, u32 reg, u8 *val,
170static int af9033_wr_reg_val_tab(struct af9033_state *state, 170static int af9033_wr_reg_val_tab(struct af9033_state *state,
171 const struct reg_val *tab, int tab_len) 171 const struct reg_val *tab, int tab_len)
172{ 172{
173#define MAX_TAB_LEN 212
173 int ret, i, j; 174 int ret, i, j;
174 u8 buf[MAX_XFER_SIZE]; 175 u8 buf[1 + MAX_TAB_LEN];
176
177 dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);
175 178
176 if (tab_len > sizeof(buf)) { 179 if (tab_len > sizeof(buf)) {
177 dev_warn(&state->i2c->dev, 180 dev_warn(&state->i2c->dev, "%s: tab len %d is too big\n",
178 "%s: i2c wr len=%d is too big!\n", 181 KBUILD_MODNAME, tab_len);
179 KBUILD_MODNAME, tab_len);
180 return -EINVAL; 182 return -EINVAL;
181 } 183 }
182 184
183 dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);
184
185 for (i = 0, j = 0; i < tab_len; i++) { 185 for (i = 0, j = 0; i < tab_len; i++) {
186 buf[j] = tab[i].val; 186 buf[j] = tab[i].val;
187 187