linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, michael.hennerich@analog.com,
	cooloney@kernel.org
Subject: Re: [PATCH 1/1] input: AD7879 Touchscreen driver
Date: Thu, 16 Oct 2008 16:32:40 -0700	[thread overview]
Message-ID: <20081016163240.ee06818b.akpm@linux-foundation.org> (raw)
In-Reply-To: <1224179836-14639-1-git-send-email-cooloney@kernel.org>

On Fri, 17 Oct 2008 01:57:16 +0800
Bryan Wu <cooloney@kernel.org> wrote:

a little thing..

> +static void ad7879_disable(struct ad7879 *ts)
> +{
> +	unsigned long flags;
> +
> +	if (ts->disabled)
> +		return;
> +
> +	spin_lock_irqsave(&ts->lock, flags);
> +	ts->disabled = 1;
> +	disable_irq(ts->bus->irq);
> +	spin_unlock_irqrestore(&ts->lock, flags);
> +
> +	cancel_work_sync(&ts->work);
> +
> +	if (del_timer_sync(&ts->timer))
> +		ad7879_ts_event_release(ts);
> +
> +	/* we know the chip's in lowpower mode since we always
> +	 * leave it that way after every request
> +	 */
> +}
> +
> +static void ad7879_enable(struct ad7879 *ts)
> +{
> +	unsigned long flags;
> +
> +	if (!ts->disabled)
> +		return;
> +
> +	spin_lock_irqsave(&ts->lock, flags);
> +	ts->disabled = 0;
> +	enable_irq(ts->bus->irq);
> +	spin_unlock_irqrestore(&ts->lock, flags);
> +}

It would looks less racy if ts->disabled was tested while the lock was held.

Also, it would be more grammatically pleasing if ad7879_destruct() was
called ad7879_destroy(), but the current spelling will still compile
and run :)



      reply	other threads:[~2008-10-16 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 17:57 [PATCH 1/1] input: AD7879 Touchscreen driver Bryan Wu
2008-10-16 23:32 ` Andrew Morton [this message]

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=20081016163240.ee06818b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    /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).