From: H Hartley Sweeten Date: Tue, 6 Aug 2013 16:31:35 +0000 (-0700) Subject: staging: comedi: drivers: introduce comedi_dio_insn_config() X-Git-Tag: v3.12-rc1~183^2~294 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e523c6c86232eb5564662aa17199c676d127bc5e;p=pandora-kernel.git staging: comedi: drivers: introduce comedi_dio_insn_config() DIO subdevices always handle 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 a helper function to handle the (*insn_config) boilerplate for comedi DIO subdevices. This function has the same paramters as (*insn_config) functions with an additional parameter to allow the caller to pass a 'mask' value for grouped DIO channels. This function returns: 0 if the instruction was successful but requires additional handling by the caller (INSN_CONFIG_DIO_{INPUT,OUTPUT} insn->n if the instruction was handled (INSN_CONFIG_DIO_QUERY) -EINVAL for all unhandled instructions The caller is responsible for actually configuring the hardware based on the configuration (s->io_bits). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed