Re: [PATCH] usb: add driver for xsens motion trackers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 24, 2013 at 08:56:58PM +0100, Frans Klaver wrote:
> Op 24 jan. 2013 17:38 schreef "Greg KH" <gregkh@xxxxxxxxxxxxxxxxxxx> het
> volgende:
> >
> > > +{
> > > +     if ((serial->num_bulk_in == 0) ||
> > > +         (serial->num_bulk_out == 0)) {
> > > +             dev_err(&serial->dev->dev,
> > > +                     "%s - missing endpoint - "
> > > +                     "bulk in: %d, bulk out: %d\n",
> >
> > These two lines should be on the same line, don't split strings, it's ok
> > to go over 80 columns with them, and in fact, you will not even get
> > there with this string.
> >
> > > +                     KBUILD_MODNAME,
> > > +                     serial->num_bulk_in,
> > > +                     serial->num_bulk_out);
> > > +             return -EINVAL;
> >
> > My question is why have this function at all?  What happens if a user
> > ends up with a "broken" device like this?  How can that happen?  What
> > are they supposed to do now?
> >
> > Or is this left over from debugging some other hardware?
> 
> Actually this device sports two usb interfaces, of which one only contains an
> interrupt endpoint and the other two bulk endpoints. We'd get two ttyUSB nodes
> if I didn't have this filter. The error report is probably misleading though,
> as well as the EINVAL return value, since we know we'll have to reject one
> interface. Would there be a more subtle way of ignoring the unused interface?

Return -ENODEV for the interface without the endpoints, and don't print
out an error, otherwise you will start to get lots of bug reports from
users :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux