From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.kapsi.fi ([217.30.184.167]:58147 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753254Ab1CEKto (ORCPT ); Sat, 5 Mar 2011 05:49:44 -0500 Message-ID: <4D721546.3090904@iki.fi> Date: Sat, 05 Mar 2011 12:49:42 +0200 From: Antti Palosaari MIME-Version: 1.0 To: adq CC: linux-media@vger.kernel.org Subject: Re: [patch] Fix AF9015 Dual tuner i2c write failures References: <4D7163FD.9030604@iki.fi> <4D716ECA.4060900@iki.fi> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-ID: Sender: On 03/05/2011 03:43 AM, adq wrote: > +static int af9015_lock_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) > +{ > + int result; > + struct dvb_usb_adapter *adap = fe->dvb->priv; > + struct af9015_state *state = adap->dev->priv; > + > + if (enable) > + if (mutex_lock_interruptible(&adap->dev->usb_mutex)) > + return -EAGAIN; > + > + result = state->i2c_gate_ctrl[adap->id](fe, enable); > + > + if (!enable) > + mutex_unlock(&adap->dev->usb_mutex); > + > + return result; > +} I think this will cause problems in case of tuner driver calls more than one time gate close or gate enable one after the other. Antti -- http://palosaari.fi/