mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Stelian Pop" <stelian@popies.net>
Cc: "Andrew Morton" <akpm@osdl.org>,
	"Michael Hanselmann" <linux-kernel@hansmi.ch>,
	"Aristeu S. Rozanski F." <aris@cathedrallabs.org>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Robert Love" <rml@novell.com>,
	"Jean Delvare" <khali@linux-fr.org>,
	"Rene Nussbaumer" <linux-kernel@killerfox.forkbomb.ch>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Apple Motion Sensor driver
Date: Mon, 13 Nov 2006 10:53:19 -0500	[thread overview]
Message-ID: <d120d5000611130753p172c2a69n260482052f623a46@mail.gmail.com> (raw)
In-Reply-To: <1163431758.23444.8.camel@localhost.localdomain>

On 11/13/06, Stelian Pop <stelian@popies.net> wrote:
> Le lundi 13 novembre 2006 à 10:04 -0500, Dmitry Torokhov a écrit :
> > Hi Stelian,
> >
> > On 11/11/06, Stelian Pop <stelian@popies.net> wrote:
> >
> >  +
> > > +       if (input_register_device(ams_info.idev)) {
> > > +               input_free_device(ams_info.idev);
> > > +               ams_info.idev = NULL;
> > > +               return;
> > > +       }
> > > +
> > > +       ams_info.kthread = kthread_run(ams_mouse_kthread, NULL, "kams");
> > > +       if (IS_ERR(ams_info.kthread)) {
> > > +               input_unregister_device(ams_info.idev);
> > > +               ams_info.idev = NULL;
> > > +               return;
> > > +       }
> > > +}
> >
> > Please consider implementing ams_mouse_start() and ams_mouse_stop()
> > methods for input_dev and start/stop polling thread there - there is
> > no reason to report input events when noone listens to them.
>
> I suppose you talk about input_dev->open() and close() ?
>

Yep.

> +
> +static int ams_mouse_open(struct input_dev *dev)
> +{
> +       ams_info.kthread = kthread_run(ams_mouse_kthread, NULL, "kams");
> +       return IS_ERR(ams_info.kthread) ? -ENODEV : 0;
> +}
> +

Is there a reason why you reporting -ENODEV instead of real error code
from kthread_run()?

-- 
Dmitry

  reply	other threads:[~2006-11-13 15:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11 21:36 Stelian Pop
2006-11-11 21:41 ` Michael Hanselmann
2006-11-11 22:00   ` Stelian Pop
2006-11-12  8:37     ` Michael Hanselmann
2006-11-12 21:38       ` Stelian Pop
2006-11-13 18:11         ` Jean Delvare
2006-11-13 18:18           ` Dmitry Torokhov
2006-11-13 15:04 ` Dmitry Torokhov
2006-11-13 15:29   ` Stelian Pop
2006-11-13 15:53     ` Dmitry Torokhov [this message]
2006-11-13 16:14       ` Stelian Pop
2006-11-13 16:20         ` Johannes Berg
2006-11-13 18:14           ` Jean Delvare
2006-11-13 18:18             ` Johannes Berg
2006-11-13 18:24               ` Michael Hanselmann
2006-11-13 20:55               ` Stelian Pop
2006-11-13 18:20         ` Dmitry Torokhov
2006-11-13 18:55           ` Robert Love
2006-11-13 20:52           ` Stelian Pop
2006-11-13 21:23             ` Johannes Berg
2006-11-13 21:39               ` Stelian Pop
2006-11-13 18:06 ` Jean Delvare
2006-11-13 18:23   ` Henrique de Moraes Holschuh
2006-11-13 20:41   ` Stelian Pop
2006-11-14  3:09     ` Henrique de Moraes Holschuh

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=d120d5000611130753p172c2a69n260482052f623a46@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=akpm@osdl.org \
    --cc=aris@cathedrallabs.org \
    --cc=benh@kernel.crashing.org \
    --cc=johannes@sipsolutions.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@hansmi.ch \
    --cc=linux-kernel@killerfox.forkbomb.ch \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=rml@novell.com \
    --cc=stelian@popies.net \
    /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

all inboxes | Powered by JetHome®