linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kwangwoo.lee@gmail.com, Trilok Soni <soni.trilok@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] tsc2007: remove HR timer
Date: Tue, 14 Jul 2009 10:00:06 +0200	[thread overview]
Message-ID: <4A5C3B06.7020207@mocean-labs.com> (raw)
In-Reply-To: <20090714070806.GA1619@avionic-design.de>

On 7/14/09 9:08 AM, Thierry Reding wrote:
> * Dmitry Torokhov wrote:
>> Hi Richard,
>>
>> On Tue, Jun 23, 2009 at 01:54:48PM +0200, Richard Röjfors wrote:
> [...]
>> +static void tsc2007_free_irq(struct tsc2007 *ts)
>> +{
>> +	free_irq(ts->irq, ts);
>> +	if (cancel_delayed_work_sync(&ts->work)) {
>> +		/*
>> +		 * Work was pending, therefore we need to enable
>> +		 * IRQ here to balance the disable_irq() done in the
>> +		 * interrupt handler.
>> +		 */
>> +		enable_irq(ts->irq);
>> +	}
>> +}
> [...]
>> -static int tsc2007_remove(struct i2c_client *client)
>> +static int __devexit tsc2007_remove(struct i2c_client *client)
>>   {
>>   	struct tsc2007	*ts = i2c_get_clientdata(client);
>> -	struct tsc2007_platform_data *pdata;
>> +	struct tsc2007_platform_data *pdata = client->dev.platform_data;
>>
>> -	cancel_delayed_work_sync(&ts->work);
>> +	free_irq(ts->irq, ts);
>> +	if (cancel_delayed_work_sync(&ts->work)) {
>> +		/*
>> +		 * Work was pending, therefore we need to enable
>> +		 * IRQ here to balance the disabel done in the
>> +		 * interrupt handler.
>> +		 */
>> +		enable_irq(ts->irq);
>> +	}
>
> Shouldn't this be tsc2007_free_irq(ts) as well?

Is this really good enough? The work function might re-enable the IRQ.

Isn't it better to look at penstate, we know that the IRQ is enabled if 
the state is UP, else the IRQ is disabled.

--Richard

  reply	other threads:[~2009-07-14  8:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 11:54 [PATCH 1/2] tsc2007: remove HR timer Richard Röjfors
2009-06-25 21:20 ` Andrew Morton
2009-07-09 16:51   ` Richard Röjfors
2009-07-14  4:59 ` Dmitry Torokhov
2009-07-14  7:08   ` Thierry Reding
2009-07-14  8:00     ` Richard Röjfors [this message]
2009-07-14  8:21       ` Dmitry Torokhov
2009-07-14  8:21     ` Dmitry Torokhov
2009-07-14  8:47   ` Richard Röjfors
2009-07-24 14:39   ` Richard Röjfors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5C3B06.7020207@mocean-labs.com \
    --to=richard.rojfors.ext@mocean-labs.com \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kwangwoo.lee@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=soni.trilok@gmail.com \
    --cc=thierry.reding@avionic-design.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).