lkml.org 
[lkml]   [2006]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Apple Motion Sensor driver
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-13 16:57    [W:0.210 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site