Re: [PATCH] new driver for ITM Touch touchscreen

Dmitry Torokhov
2005-03-04T14:53:55Z

On Fri, 4 Mar 2005 14:03:37 +0200, Alexey Dobriyan <adobriyan@mail.ru> wrote:
> On Friday 04 March 2005 12:30, Hans-Christian Egtvedt wrote:
>
> > I've ported the works from Chris Collins so the drivers compiles without
> > warnings and works (for me) with Linux 2.6.10 and 2.6.11.
>
> > Any comments on the driver would be much appreciated.
>
> > +struct itmtouch_dev {
>
> > + int refcount; //
>
> There is already generic interface for reference-counted objects. See
> lib/kref.c and kref documentation at:
>
> http://marc.theaimsgroup.com/?l=linux-kernel&m=110987233406767&w=2
>

... which is absolutely unusable for this particular purpose - the
touchscreen object is not going away when refcount is 0. The variable
shoudl be renamed to "users" or something. Moreover it needs locking.

Anyway, all of this will be handled by the input core very shortly so
it can be left as is for now.

As far as the driver goes:

- yes, it does need input_sync;
- I prefer using input_set_abs_params instead of setting mix, max,
flat and fuzz for each axis manually;
- I believe "/* .. */" is preferred over "//"
- kill the commented out bad prototypes.

Also, is there a way to query the screen for actual size?

--
Dmitry