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

Commit dc9ca2af authored by Michael Krufky's avatar Michael Krufky Committed by Linus Torvalds
Browse files

[PATCH] DVB: lgdt330x check callback fix



Most of the patch is whitespace cleanup, but more importantly, this patch
checks to see whether a callback is set before calling it.  On cx88 boards
(currently the only boards using lgdt330x in 2.6.13) every callback is set.
However, newer drivers currently in development leave a callback undefined,
and lgdt330x must not call it if it isn't defined.

Signed-off-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Signed-off-by: default avatarMichael Krufky <mkrufky@m1k.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2684f5c7
Loading
Loading
Loading
Loading
+25 −25
Original line number Original line Diff line number Diff line
@@ -172,7 +172,6 @@ static int lgdt330x_SwReset(struct lgdt330x_state* state)
	}
	}
}
}



static int lgdt330x_init(struct dvb_frontend* fe)
static int lgdt330x_init(struct dvb_frontend* fe)
{
{
	/* Hardware reset is done using gpio[0] of cx23880x chip.
	/* Hardware reset is done using gpio[0] of cx23880x chip.
@@ -379,17 +378,18 @@ static int lgdt330x_set_parameters(struct dvb_frontend* fe,
		/* Select the requested mode */
		/* Select the requested mode */
		i2c_write_demod_bytes(state, top_ctrl_cfg,
		i2c_write_demod_bytes(state, top_ctrl_cfg,
				      sizeof(top_ctrl_cfg));
				      sizeof(top_ctrl_cfg));
		if (state->config->set_ts_params)
			state->config->set_ts_params(fe, 0);
			state->config->set_ts_params(fe, 0);
		state->current_modulation = param->u.vsb.modulation;
		state->current_modulation = param->u.vsb.modulation;
	}
	}


	/* Change only if we are actually changing the channel */
	/* Tune to the specified frequency */
	if (state->current_frequency != param->frequency) {
	if (state->config->pll_set)
		/* Tune to the new frequency */
		state->config->pll_set(fe, param);
		state->config->pll_set(fe, param);

	/* Keep track of the new frequency */
	/* Keep track of the new frequency */
	state->current_frequency = param->frequency;
	state->current_frequency = param->frequency;
	}

	lgdt330x_SwReset(state);
	lgdt330x_SwReset(state);
	return 0;
	return 0;
}
}