From: Ian Abbott Date: Thu, 4 Apr 2013 13:59:15 +0000 (+0100) Subject: staging: comedi: simplify comedi_subdevice_minor_table[] X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~137^2~273 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd5b4173d50af86798d98b147321a92cf3a0a8ec;p=pandora-kernel.git staging: comedi: simplify comedi_subdevice_minor_table[] `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: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed