Re: [PATCH 2.6.14.2] Updated itmtouch kernel usb input driver (1/1)

From: Dmitry Torokhov
Date: Wed Nov 23 2005 - 21:01:17 EST


On Wednesday 23 November 2005 11:58, Vojtech Pavlik wrote:
> >  static int itmtouch_open(struct input_dev *input)
> >  {
> >       struct itmtouch_dev *itmtouch = input->private;
> >  
> > +     if (itmtouch->users++)
> > +             return 0;
> > +

Why are you adding this? input_open/close are serialized and called
only once when needed.

> >       itmtouch->readurb->dev = itmtouch->usbdev;
> >  
> >       if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL))
> > +     {
> > +             itmtouch->users--;
> >               return -EIO;
> > +     }
> >  

Brace should go on the same line with "if".

> > -     usb_to_input_id(udev, &itmtouch->inputdev.id);
> > +     itmtouch->inputdev.id.bustype = BUS_USB;
> > +     itmtouch->inputdev.id.vendor = udev->descriptor.idVendor;
> > +     itmtouch->inputdev.id.product = udev->descriptor.idProduct;
> > +     itmtouch->inputdev.id.version = udev->descriptor.bcdDevice;
> >       itmtouch->inputdev.dev = &intf->dev;

Why are you replacing perfectly good code with incorrect one (endianess
issues)?

Plus you need to convert it to dynamic input_dev allocation for newer
kernels.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/