1. 09 4月, 2013 34 次提交
  2. 06 4月, 2013 6 次提交
    • V
      staging: speakup: selection.c fix typo in comment · c6ac992b
      Valentin Ilie 提交于
      Replace disallocated with deallocated
      Signed-off-by: NValentin Ilie <valentin.ilie@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6ac992b
    • I
      staging: comedi: add comedi_clear_board_dev() · db210da2
      Ian Abbott 提交于
      Add local function `comedi_clear_board_dev()` as a safer alternative to
      `comedi_clear_board_minor()` when we already have a pointer to a `struct
      comedi_device`.  It uses the board minor device number stored in the
      `struct comedi_device` (which must have already been initialized) and
      only clears the entry in `comedi_board_minor_table[]` if it points to
      the specified `struct comedi_device`.  Rather than returning the old
      table entry, it returns `true` if the entry matched (and so has just
      been cleared) and returns `false` otherwise.
      
      Call `comedi_clear_board_dev()` instead of `comedi_clear_board_minor()`
      in `comedi_unlocked_ioctl()` (in the code that frees a dynamically
      allocated comedi device detached by the `COMEDI_DEVCONFIG` ioctl).  That
      ought to return `true` but check it just in case before freeing the
      device.  There is still a race condition here which needs to be dealt
      with once we've implemented reference counting for `struct
      comedi_device`s.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      db210da2
    • I
      staging: comedi: remove struct comedi_file_info · c6f5b4d5
      Ian Abbott 提交于
      `struct comedi_file_info` is no longer used so remove it.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6f5b4d5
    • I
      staging: comedi: simplify comedi_board_minor_table[] · cb6b79de
      Ian Abbott 提交于
      `comedi_alloc_board_minor()` allocates and initializes a `struct
      comedi_file_info` and a `struct comedi_device`, and assigns a board
      minor device number (if there are any available), storing a pointer to
      the allocated `struct comedi_file_info` in
      `comedi_board_minor_table[minor]` where `minor` is the board minor
      device number.
      
      There is no longer anything useful in the `struct comedi_file_info`
      apart from the pointer to the `struct comedi_device` that was allocated,
      so the `struct comedi_file_info` is superfluous.
      
      Change `comedi_board_minor_table[]` to hold pointers to the actual
      `struct comedi_device`'s.  `comedi_alloc_board_minor()` no longer needs
      to allocate a `struct comedi_file_info`.  Replace
      `comedi_free_board_file_info()` with `comedi_free_board_dev()` with its
      parameter pointing to the `struct comedi_device` to be freed (there is
      no longer a `struct comedi_file_info` to be freed).
      
      There are consequential changes to `comedi_dev_from_board_minor()`,
      `comedi_clear_board_minor()` (which now returns a `struct comedi_device
      *`), `comedi_free_board_minor()`, `comedi_release_hardware_device()` and
      `comedi_unlocked_ioctl()` (when dealing with detachment of a dynamically
      allocated comedi device by the `COMEDI_DEVCONFIG` ioctl).
      
      `comedi_dev_from_file_info()` is no longer used as a result of the above
      changes so remove it.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb6b79de
    • I
      staging: comedi: simplify comedi_subdevice_minor_table[] · bd5b4173
      Ian Abbott 提交于
      `comedi_alloc_subdevice_minor()` allocates and initializes a `struct
      comedi_file_info` and assigns a subdevice minor device number (if there
      are any available), storing a pointer to the allocated `struct
      comedi_file_info` in `comedi_subdevice_minor_table[i]` where `i` is the
      array index corresponding to the subdevice minor device number (indexed
      by subdevice minor device number minus `COMEDI_NUM_BOARD_MINORS`).
      
      The information stored in the `struct comedi_file_info` can be derived
      from the subdevice structure (`struct comedi_subdevice`) itself, so the
      `struct comedi_file_info` is superfluous.
      
      Change `comedi_subdevice_minor_table[]` to hold pointers to the actual
      `struct comedi_subdevice`'s.  `comedi_alloc_subdevice_minor()` no longer
      needs to allocate a `struct comedi_file_info` and
      `comedi_free_subdevice_info()` no longer has a `struct comedi_file_info`
      to free.
      
      Replace `comedi_file_info_from_minor()` with
      `comedi_subdevice_from_minor()`, returning a (possibly NULL) pointer to
      a `struct comedi_subdevice` from the table.  This has knock-on effects
      for `comedi_dev_from_subdevice_minor()`, `comedi_read_subdevice()` and
      `comedi_write_subdevice()`.  In particular, `comedi_read_subdevice()`
      and `comedi_write_subdevice()` now need to check the subdevice flags to
      see if the determine whether to override the comedi device's default
      read/write subdevice.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bd5b4173
    • I
      staging: comedi: remove comedi_file_info_from_board_minor() · dac59de2
      Ian Abbott 提交于
      Merge the code from `comedi_file_info_from_board_minor()` into
      `comedi_dev_from_board_minor()` and remove it since nothing else calls
      it.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dac59de2