From a4f263b587573f47cc6bc7ad85e5f650169d48f6 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 6 Jan 2008 15:52:56 -0300 Subject: V4L/DVB (6986): tda18271: share state between analog and digital tuner instances Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda8290.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/media/video') diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index eab530708a49..4ac7c0438896 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c @@ -502,8 +502,13 @@ static void tda8290_init_tuner(struct dvb_frontend *fe) static void tda829x_release(struct dvb_frontend *fe) { - if (fe->ops.tuner_ops.release) - fe->ops.tuner_ops.release(fe); + struct tda8290_priv *priv = fe->analog_demod_priv; + + /* dont try to release the tuner + * if we didn't attach it from this module */ + if ((priv->ver > TDA8290) && (priv->ver > TDA8295)) + if (fe->ops.tuner_ops.release) + fe->ops.tuner_ops.release(fe); kfree(fe->analog_demod_priv); fe->analog_demod_priv = NULL; -- cgit v1.2.3