All the comedi drivers that have DIO subdevices implement a (*insn_config) callback. This callback always handles the INSN_CONFIG_DIO_{INPUT,OUTPUT} instructions to configure the DIO channels. They also always handle the INSN_CONFIG_DIO_QUERY instruction to query the configuration of a DIO channel. Introduce, and use, a new exported function in the comedi core to handle this boilerplate. v2: Patches 1, 2, and 4: Add Reviewed-by signoff from Ian Abbott. Patch 3: Drop changes to comedi_bond and ni_65xx drivers as suggested by Ian. Add comment back in ssv_dnp driver about the mysterious multiplication by 2 for port C. H Hartley Sweeten (4): staging: comedi: drivers: introduce comedi_dio_insn_config() staging: comedi: skel: use comedi_dio_insn_config() staging: comedi: drivers: use comedi_dio_insn_config() for simple cases staging: comedi: drivers: use comedi_dio_insn_config() for complex cases drivers/staging/comedi/comedidev.h | 4 + drivers/staging/comedi/drivers.c | 40 +++++++ drivers/staging/comedi/drivers/8255.c | 42 +++---- drivers/staging/comedi/drivers/addi_apci_16xx.c | 42 +++---- drivers/staging/comedi/drivers/addi_apci_3xxx.c | 36 +++--- drivers/staging/comedi/drivers/adv_pci1723.c | 43 +++---- .../staging/comedi/drivers/amplc_dio200_common.c | 42 +++---- drivers/staging/comedi/drivers/cb_das16_cs.c | 31 ++---- drivers/staging/comedi/drivers/cb_pcidas64.c | 25 ++--- drivers/staging/comedi/drivers/dt2801.c | 31 ++---- drivers/staging/comedi/drivers/dt3000.c | 41 +++---- drivers/staging/comedi/drivers/gsc_hpdi.c | 33 ++---- drivers/staging/comedi/drivers/ii_pci20kc.c | 37 +++---- drivers/staging/comedi/drivers/me4000.c | 123 +++++++-------------- drivers/staging/comedi/drivers/me_daq.c | 50 ++++----- drivers/staging/comedi/drivers/ni_670x.c | 25 ++--- drivers/staging/comedi/drivers/ni_at_ao.c | 55 ++++----- drivers/staging/comedi/drivers/ni_daq_700.c | 24 ++-- drivers/staging/comedi/drivers/ni_mio_common.c | 57 ++-------- drivers/staging/comedi/drivers/ni_pcidio.c | 29 ++--- drivers/staging/comedi/drivers/pcm3724.c | 45 +++----- drivers/staging/comedi/drivers/pcmmio.c | 71 +++--------- drivers/staging/comedi/drivers/pcmuio.c | 24 ++-- drivers/staging/comedi/drivers/rtd520.c | 20 +--- drivers/staging/comedi/drivers/s526.c | 45 ++++---- drivers/staging/comedi/drivers/s626.c | 22 +--- drivers/staging/comedi/drivers/skel.c | 42 ++++--- drivers/staging/comedi/drivers/ssv_dnp.c | 78 +++++-------- drivers/staging/comedi/drivers/usbdux.c | 19 +--- drivers/staging/comedi/drivers/usbduxsigma.c | 20 +--- 30 files changed, 439 insertions(+), 757 deletions(-) -- 1.8.3.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel