linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hemanth V" <hemanthv@ti.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver
Date: Mon, 6 Sep 2010 14:33:51 +0530	[thread overview]
Message-ID: <018601cb4da2$6d903880$LocalHost@wipblrx0099946> (raw)
In-Reply-To: 20100903163438.GB2200@core.coreip.homeip.net

----- Original Message ----- 
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
> Hi Hemanth,
> 
> On Fri, Sep 03, 2010 at 04:02:11PM +0530, Hemanth V wrote:
>> >
>> >
>> >Do not like repeated release of resources in main and error path... Can
>> >we do it like:
>> >
>> >...
>> >disable_irq();
>> >error = cma3000_set(data, CMA3000_CTRL, ctrl, "ctrl");
>> >if (!error) {
>> >/* Settling time delay required after mode change */
>> >msleep(CMA3000_SETDELAY);
>> >}
>> >enable_irq();
>> >out:
>> >mutex_unlock();
>> >return error ? error : count;
>> 
>> I am thinking I can just add the below statement, and should be able to
>> remove repeated release.
>> 
>> return error ? error : count;
>> 
> 
> That would make us sleep for CMA3000_SETDELAY even in case of failure...
> ... But that should be OK.

I suppose it should not sleep if its the modified code segment as below

        error = CMA3000_SET(data, CMA3000_CTRL, ctrl, "ctrl");
        if (error < 0)
                goto err_op3_failed;

        /* Settling time delay required after mode change */
        msleep(CMA3000_SETDELAY);

err_op3_failed:
        enable_irq(data->client->irq);
err_op2_failed:
        mutex_unlock(&data->mutex);
err_op1_failed:
        return (error ? error : count);


> 
>> >>+
>> >>+ if (data->client->irq) {
>> >>+ ret = request_threaded_irq(data->client->irq, NULL,
>> >>+ cma3000_thread_irq,
>> >>+ irqflags | IRQF_ONESHOT,
>> >>+ data->client->name, data);
>> >>+
>> >>+ if (ret < 0) {
>> >>+ dev_err(&data->client->dev,
>> >>+ "request_threaded_irq failed\n");
>> >>+ goto err_op1_failed;
>> >>+ }
>> >>+ }
>> >
>> >What is the utility of the driver when there is no IRQ line?
>> 
>> Not sure I fully understand your comments.
>> Currently probe would return a failure.
>> 
> 
> You have a check for data->client->irq != 0 and finish probe() with
> success in case it is 0. The question is what is the use of the
> device/driver combo in case when data->client->irq == 0?

Yes agreed, will add a error scenario when data->client->irq == 0



      reply	other threads:[~2010-09-06  9:03 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21  6:52 [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver Hemanth V
2010-05-21 11:57 ` Jonathan Cameron
2010-05-21 14:13   ` Hemanth V
2010-08-13 12:47   ` Hemanth V
2010-08-13 13:34     ` Murphy, Dan
2010-08-16  9:45       ` Hemanth V
2010-08-29 18:24       ` Dmitry Torokhov
2010-08-29 18:49 ` Dmitry Torokhov
2010-08-30 16:04   ` Sensors and the input layer (was Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver) Felipe Balbi
2010-08-30 16:28     ` Dmitry Torokhov
2010-08-30 17:10       ` Felipe Balbi
2010-08-30 17:21         ` Dmitry Torokhov
2010-08-30 18:52           ` Felipe Balbi
2010-08-30 20:50             ` Dmitry Torokhov
2010-08-31  9:53               ` Alan Cox
2010-08-30 17:41         ` Jonathan Cameron
2010-08-30 20:40     ` Alan Cox
2010-08-30 20:44       ` Dmitry Torokhov
2010-08-30 21:28         ` Linus Torvalds
2010-08-30 21:43           ` Dmitry Torokhov
2010-08-30 22:05             ` Linus Torvalds
2010-08-30 22:43               ` Dmitry Torokhov
2010-08-31  5:15                 ` Felipe Balbi
2010-08-31  9:44                 ` Alan Cox
2010-08-31 12:35                   ` Jonathan Cameron
2010-08-31 16:17                   ` Dmitry Torokhov
2010-08-31 16:59                     ` Alan Cox
2010-08-31 17:09                       ` Dmitry Torokhov
2010-08-31 17:24                         ` Mohamed Ikbel Boulabiar
2010-08-31 18:14                           ` Jonathan Cameron
2010-08-31 22:21                         ` Chris Hudson
2010-09-24 13:02                         ` Pavel Machek
2010-09-24 13:26                           ` Jonathan Cameron
2010-08-31 18:03                       ` Jonathan Cameron
2010-08-31 18:20                         ` Jonathan Cameron
2010-09-14  7:12                 ` Pavel Machek
2010-08-31  9:46             ` Alan Cox
2010-08-31 12:51               ` Jonathan Cameron
2010-08-31 18:18           ` Daniel Barkalow
2010-09-03 10:32   ` [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver Hemanth V
2010-09-03 16:34     ` Dmitry Torokhov
2010-09-06  9:03       ` Hemanth V [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='018601cb4da2$6d903880$LocalHost@wipblrx0099946' \
    --to=hemanthv@ti.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /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).