[RFC] ftdi_sio driver: use altsetting or cur_altsetting?

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

 



Hello esteemed linux-usb folks,

While I am trying to get a little quirk for my custom hardware device
added to the ftdi_sio driver, I noticed an inconsistency between use
of interface->altsetting vs. interface->cur_altsetting in the existing
driver code.  Specifically:

* ftdi_determine_type() function uses this construct to get the number
  of the interface it is operating on:

  inter = serial->interface->altsetting->desc.bInterfaceNumber;

* ftdi_set_max_packet_size() uses interface->cur_altsetting to get to
  desc.bNumEndpoints and endpoint[i].desc

* The JTAG cleanup patch which Johan just applied uses
  intf->cur_altsetting->desc.bInterfaceNumber

So which is the right one to use, intf->altsetting or intf->cur_altsetting?
The comments in include/linux/usb.h say that the altsetting member
points to an array of struct usb_host_interface stored in no particular
order, so using that pointer in ftdi_determine_type() seems wrong -
but then I am a total novice in this area, hence I am hoping that
someone more knowledgeable could confirm.

The most recent version of my DUART28C quirk adding patch uses
serial->interface->altsetting, copied from ftdi_determine_type() -
should I change my proposed patch to use cur_altsetting instead?
Should I also make a patch to ftdi_determine_type() changing it to use
cur_altsetting as well?

TIA,
Mychaela
she/her/hers



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

  Powered by Linux