[PATCH 07/11] staging: comedi: drivers: use comedi_dio_insn_bits() for DIO subdevices

Hartley Sweeten HartleyS at visionengravers.com
Thu Aug 29 16:53:13 UTC 2013


On Thursday, August 29, 2013 5:52 AM, Ian Abbott wrote:
> On 2013-08-28 21:29, H Hartley Sweeten wrote:
>> Use comedi_dio_insn_bits() to handle the boilerplate code to update
>> the subdevice s->state for DIO subdevices.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
>> Cc: Ian Abbott <abbotti at mev.co.uk>
>> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
>
>  [snip]
> diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
> index 40e8d56..f3b8514 100644

[snip]

> Since I was noting drivers that filtered register writes depending on 
> the mask in the earlier patches, addi_apci_3xxx is one of those.

Noted.

> [snip]
>> diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c
>> index 5c3a318..a2e38fe 100644

[snip]

> ii_pci20k is another.

> [snip]
>> diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c
>> index 8f4afad..1c385e3 100644

[snip]

> me4000 is another.  The error returned when attempting to write to lines 
> configured as inputs was a little unusual!

I though the error was a bit odd also. I don't think the (*insn_bits) functions should
fail for this situation. If the user attempts to change the output state of a channel
configured as an input it should just be ignored.

> [snip]
>> diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c
>> index 00ebf4d..d29416b 100644

[snip[

> me_daq is another.

Ok.

So far these have been identified as doing conditional updates of the
state based on the mask:

8255
dt2817
ni_6527
pcl711
pcl726
addi_apci_3xxx
ii_pci20kc
me4000
me_daq

It could a argued that some of these only have the conditional update
because the driver was based on a previous driver that also had it. There
is a lot of cut-and-paste in the comedi drivers.

Regards,
Hartley



More information about the devel mailing list