RE: [PATCH 14/14] staging: comedi: ii_pci20kc: reorder subdevices

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

 



On Thursday, July 25, 2013 7:18 AM, Ian Abbott wrote:
> On 2013-07-24 20:14, H Hartley Sweeten wrote:
>> Make the built-on dio subdevice 0 and the three add-on modules
>> subdevices 1-3. This allows the driver to consistently use the
>> ii20k_module_iobase() helper to get the base address needed to
>> access a the registers used by a given subdevice.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
>> Cc: Ian Abbott <abbotti@xxxxxxxxx>
>> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>
> It's best to avoid reordering the subdevices if you can help it to avoid 
> screwing with userspace unnecessarily.

This one can be dropped. It was added last just to make the 'iobase' use
consistent.

But...

Shouldn't the userspace be getting the subdevice using
comedi_find_subdevice_by_type()? Or can userspace directly
access a subdevice based on the index?

The original order was:
0 - AO or AI subdevice (module 1)
1 - AO or AI subdevice (module 2)
2 - AO or AI subdevice (module 3)
3 - DIO subdevice (built-in module)

The new order is:
0 - DIO subdevice (built-in module)
1 - AO or AI subdevice (module 1)
2 - AO or AI subdevice (module 2)
3 - AO or AI subdevice (module 3)

So logically the add-on modules are still in the same order. So
the first call of comedi_find_subdevice_by_type() to find the
AO or AI subdevice will still return the module 1 subdevice,
second will return module 2, and third will return module 3.
I see no functional change in the userspace interaction.

Thanks,
Hartley

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux