Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d18a88b1 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab
Browse files

[media] af9033: fix broken I2C



Driver did not work anymore since I2C has gone broken due
to recent commit:
commit 37ebaf68
[media] dvb-frontends: Don't use dynamic static allocation

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Cc: stable@vger.kernel.org
parent 5264682a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -170,18 +170,18 @@ static int af9033_rd_reg_mask(struct af9033_state *state, u32 reg, u8 *val,
static int af9033_wr_reg_val_tab(struct af9033_state *state,
		const struct reg_val *tab, int tab_len)
{
#define MAX_TAB_LEN 212
	int ret, i, j;
	u8 buf[MAX_XFER_SIZE];
	u8 buf[1 + MAX_TAB_LEN];

	dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);

	if (tab_len > sizeof(buf)) {
		dev_warn(&state->i2c->dev,
			 "%s: i2c wr len=%d is too big!\n",
		dev_warn(&state->i2c->dev, "%s: tab len %d is too big\n",
				KBUILD_MODNAME, tab_len);
		return -EINVAL;
	}

	dev_dbg(&state->i2c->dev, "%s: tab_len=%d\n", __func__, tab_len);

	for (i = 0, j = 0; i < tab_len; i++) {
		buf[j] = tab[i].val;