f57f5848f9b313889702b018220ea256284dbddf |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236, amplc_pci236: get rid of bustype The `bustype` member of `struct pc236_board` variables is initialized, but never used. Remove it along with the enumerated constants associated with it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
4cb60db2eabd275649b3305cc488a9794de8e463 |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: split into ISA, PCI and common module The "amplc_pc236" driver currently handles both ISA and PCI devices and uses a small amount of conditional compilation depending which are enabled. Move most of the functionality into a new module, "amplc_pc236_common", and split off support for PCI devices into a new module, "amplc_pci236". Retain support for ISA devices in the existing module, "amplc_pc236". Since the `detach` handler (`pc236_detach()`) in the existing module "amplc_pc236" now only needs to handle ISA devices and only calls `comedi_legacy_detach()`, just use `comedi_legacy_detach()` directly as the `detach` handler in `struct comedi_driver amplc_pc236_driver`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
55901d15b6f816af5bff9efd55b6400121dbc04a |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: add callback to check and clear interrupt Add an optional callback function pointer to the board data to be called when checking if an interrupt has occurred and to clear it if it has. Since the callback returns `bool`, change a few other `int` values to `bool` to match. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
7f526aad196da471040a30bec4c788518e450fa2 |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: combine interrupt enable/disable functions `pc236_intr_enable()` and `pc236_intr_disable()` are very similar. Combine them into a single function `pc236_intr_update()` with a parameter to indicate whether interrupts are being enabled or disabled. Change type type of the `enable_irq` member of the private data to `bool` to match the parameter. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
42b241c04e9b0cb655124fd61f729756afd21cc5 |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: add callback to enable/disable interrupt Add an optional callback function pointer to the board data to be called when interrupts are logically enabled or disabled to update the hardware registers. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
e7637a912911ae4346e19e954d9481f7a5b0e48b |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: don't disable h/w interrupt on detach() If an asynchronous command was running when the device is being detached, the comedi core would have called the subdevice `cancel` handler (`pc236_intr_cancel()`) before calling the `detach` handler (`pc236_detach()`). Since the cancel handler disables hardware interrupts (at least for the PCI236 board) by calling `pc236_disable_intr()`, there is no need for the detach handler to do so as well. Remove the call to `pc236_disable_intr()` from `pc236_detach()`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
6f929b4e5a022c3ca806c1675ccb833c42086853 |
|
28-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: move static board data Move the static board data in `pc236_isa_boards[]` and `pc236_pci_board` closer to where they are used. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
982e2bc4873415a6f94e9eab867679b358791a38 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: set board_name before common attach For PCI boards, the `auto_attach` handler, `pc236_auto_attach()`, initializes `dev->board_ptr` to point to a `struct pc236_board`, but leaves `dev->board_name` unchanged. The Comedi core will have initialized `dev->board_name` to the `driver_name` string member of `amplc_pc236_driver`. For consistency with ISA boards manually configured by the `COMEDI_DEVCONFIG` ioctl via the legacy `attach` handler, `pc236_attach()`, set `dev->board_name` to the `name` member of the `struct pc236_board` pointed to by `dev->board_ptr`. Both `pc236_attach()` and `pc236_auto_attach()` call `pc236_common_attach()`, which also sets `dev->board_name` to the `name` member of the `struct pc236_board`. Since this assignment no longer changes anything, remove it. A nice side-effect of this change is that the same owner name string is used for requesting I/O regions (before the call the `pc236_common_attach()`) as is used for requesting the IRQ handler (during the call to `pc236_common_attach()`). It was already the same for (manually configured) ISA boards, but is now the same for (automatically configured) PCI boards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
62b5e46322f1655639ae749f7f1dda1a6a5eb932 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: remove PCI device ID macros The `PCI_DEVICE_ID_AMPLICON_PCI236` macro is only used once, in the module device table, so remove it and expand the macro in the table. `The `PCI_DEVICE_ID_INVALID` macro is no longer used, so remove it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
b4eafd11351d90a652657cc2a12728c51000d5e3 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Simplify PCI board look-up Since only a single PCI board is supported by the driver, there is no need to call `pc236_find_pci_board()` to find the a board entry with matching PCI device ID in `pc236_pci_boards[]`. Just point to the entry directly and remove the look-up function. In fact, there is no reason for `pc236_pci_boards[]` to be an array, so change it to a non-array variable and rename it to `pc236_pci_board`. Also, the `devid` member of `struct pc236_board` is no longer needed as it was only used by the look-up function, so remove it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
ffe2d9fd49af6461972201eeaa8012e71fe40c97 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: don't check bus type in attach Since the legacy attach routine `pc236_attach()` is only called for board names matching an entry in our array of ISA boards `pc236_isa_boards[]`, and it is reasonable to expect all elements of `pc236_isa_boards[]` to have their `bustype` member initialized correctly to `isa_bustype`, don't bother checking the bus type in `pc236_attach()`. Add `if (!DO_ISA) return -EINVAL` to optimize out the remainder of the function if `CONFIG_COMEDI_AMPLC_PC236_ISA` is not defined. Similarly, don't bother checking the bus type in `pc236_find_pci_board()` as it is reasonable to expect all elements of `pc236_pci_boards[]` to have their `bustype` member initialized correctly to `pci_bustype`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
22c39196b661c8569d92db50459dfa3a3afd4335 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: split pc236_boards[] into ISA & PCI Split `pc236_boards[]` into `pc236_isa_boards[]` for ISA cards and `pc236_pci_boards[]` for PCI cards (there is only one of each). Only initialize the board name look-up members of `struct comedi_driver amplc_pc236_driver` if the ISA part of the driver is enabled in the kernel config (`CONFIG_COMEDI_AMPLC_PC236_ISA`) using the array of ISA boards (`pc236_isa_boards[]`). The driver doesn't allow manual configuration of PCI devices, so there is no point having the comedi core match the names of the PCI boards before it calls our driver's legacy attach routine (`pc236_attach()`). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
00afdd43db07e5093b69a5b9cca5f27f416ebfff |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: remove 'model' member The `model` member of `struct pc236_board` is no longer used since the code to remove manual configuration of PCI devices was removed. Get rid of it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
350cfc5525bb5e1cd64ba19470a6e471611d117d |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: absorb pc236_pci_common_attach() Absorb `pc236_pci_common_attach()` into `pc236_auto_attach()` since that's the only place it is called from. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a06021433074f8b5d197b552c297efd8f2155d5a |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: no need to set hw_dev The call to `comedi_set_hw_dev()` from `pc236_pci_common_attach()` is now unnecessary since `pc236_pci_common_attach()` is now only called from this driver's `auto_attach` hook `pc236_auto_attach()` and the comedi core now calls `comedi_set_hw_dev()` before calling that. Remove the unnecessary call. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
f78660123ff8e35e8098eefb8f8087a916239108 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: no need to manipulate PCI ref count Now that this driver no longer supports "manual" attachment of PCI devices in its `attach` hook (`pc236_attach()`), it no longer has code that searches for a suitable PCI device and increments its reference count. Since the driver no longer has any reason for incrementing and decrementing the PCI device's reference count, the calls to `pci_dev_get()` and `pci_dev_put()` can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
046874f7fbd1e26f8bc4dccacc40bf1c9956986c |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: remove manual configuration of PCI boards Remove the code that allows PCI boards to be manually attached by the `COMEDI_DEVCONFIG` ioctl (or the "comedi_config" application). Supported PCI boards (PCI236) will be attached automatically at probe time via `comedi_pci_auto_config()` and the `auto_attach` hook in the `struct comedi_driver`. The "wildcard" entry in `pc236_boards[]` was only used when manually attaching a PCI board using a driver name instead of a board name, so is no longer needed. Remove it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
12606fe74b90ae53c4aa03419121cd6bf786a80b |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: remove some boilerplate comments Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
8485e4f04a5dcb4d51b46f65e984ce3b22599967 |
|
25-Jul-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: reformat header comments Use preferred style for copyright and driver description comments. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
3d03cfcaf6cde186f439ca1a318423007570760a |
|
19-Jul-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: remove unnecessary DRIVER_NAME defines These defines are usually only used to initialize the driver_name member of the comedi_driver struct. Some of the drivers also use the define as part of dev_{level}() messages and/or when doing a request_irq(). The addition of the DRIVER_NAME to the messages is just added noise and the dev->board_name is typically used in the request_irq(). Just remove all the DRIVER_NAME defines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
862755ec07572036b0c69d738b88f89b6beede99 |
|
19-Jul-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: remove unnecessary *_SIZE defines Some of the legacy comedi drivers have a *_SIZE define that is only passed to comedi_request_region() to specify the size of the region. Some of the pnp drivers (pci, etc.) also have a *_SIZE define which is unused. For aesthetics, remove these defines. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
ec05d98cec4825ddede62943734d828efa530892 |
|
16-Jul-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: amplc_pc236: checkpatch.pl cleanup (missing blank line) Fix this checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
c3ba2678d01e983ab47b970bc80ea8e5b3444c54 |
|
16-Jul-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: amplc_pc236: checkpatch.pl cleanup (else after return) Fix these checkpatch.pl warnings: WARNING: else is not generally useful after a break or return Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
3672effdeae5395d661a2103f69082146ef949fc |
|
06-May-2014 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: pass subdevice to comedi_buf_put() Change the parameters of `comedi_buf_put()` to pass a pointer to the comedi subdevice instead of a pointer to the "async" structure belonging to the subdevice. The function puts a sample value in the comedi buffer, but currently only deals with 16-bit sample types. A future version could deal with 16 or 32-bit sample types depending on the value of the SDF_LSAMPL subdevice flag. The main aim at the moment is to replace all the `struct comedi_async *` parameters with `struct comedi_subdevice *` parameters in the comedi driver API. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
f50cebb9baa5fd0e561f436bd53ffa35df16edb2 |
|
17-Apr-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: properly validate cmd->scan_end_arg When the async command 'scan_end_src' is TRIG_COUNT the 'scan_end_arg' is the cmd->chanlist_len. Fix a couple open-coded drivers. Add the check to the drivers that do not validate this command argument. The core validates that the cmd->chanlist_len is <= s->len_chanlist. During the post config after the attach the core also make sure that the s->len_chanlist is initialized. For clarity, initialize the s->len_chanlist in a couple drivers that are relying on the core to initialize it to '1'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
c93999c21319439c4fe2da85f2ec40ed477379ac |
|
03-Feb-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: remove final 'attach' messages These messages are just added noise. Remove them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
46828a56f24a9121a4a3de33e1985fc4532c017c |
|
03-Feb-2014 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: amplc_pc236: remove dev_err() message due to allocation failure The subdev_8255_init() call can only fail due to the allocation of the private data. This failure will alreay have produced an error message. Remove the redundant dev_err(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
c82ea5b4a9ca1ff9c36e4f077898775d82f1dec4 |
|
05-Dec-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: amplc_pc236: use dev->read_subdev Use the dev->read_subdev that was setup in the device attach instead of accessing the dev->subdevices array directly. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
41e043fcfa2236bb2c4a8335eb09f4c8cee224b3 |
|
03-Dec-2013 |
Jingoo Han <jg1.han@samsung.com> |
staging: remove DEFINE_PCI_DEVICE_TABLE macro Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
ce157f8032bbd46d9427034c335b0afd751da25d |
|
25-Jun-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: don't rely on comedidev.h to include headers comedidev.h is the main kernel header for comedi. Every comedi driver includes this header which then includes a number of <linux/*> headers. All the drivers need <linux/module.h> and some of them need <linux/delay.h>. The rest are not needed by any of the drivers. Remove all the includes in comedidev.h except for <linux/dma-mapping.h>, which is needed to pick up the enum dma_data_direction for the comedi_subdevice definition, and "comedi.h", which is the uapi header for comedi. Add <linux/module.h> to all the comedi drivers and <linux/delay.h> to the couple that need it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
0bdab509bf9c6d838dc0a3b1d68bbf841fc20b5a |
|
25-Jun-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: use comedi_alloc_devpriv() Use the helper function to allocate memory and set the comedi_device private data pointer. This removes the dependency on slab.h from most of the drivers so remove the global #include in comedidev.h and the local #include in some of the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
588ba6dc5fb4bdca47a3da38c2718fbb82d3eee1 |
|
11-Jun-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: let core handle freeing s->private Introduce a new subdevice runflags, SRF_FREE_SPRIV, and a new helper function, comedi_set_spriv(), that the drivers can use to set the comedi_subdevice private data pointer. The helper function will also set SRF_FREE_SPRIV to allow the comedi core to automatically free the subdevice private data during the cleanup_device() stage of the detach. Currently s->private is only allocated by the 8255, addi_watchdog, amplc_dio200_common, and ni_65xx drivers. All users of those drivers can then have the comedi_spriv_free() calls removed and in many cases the (*detach) can then simply be the appropriate comedi core provided function. The ni_65xx driver uses a helper function, ni_65xx_alloc_subdevice_private(), to allocate the private data. Refactor the function to return an errno or call comedi_set_spriv() instead of returning a pointer to the private data and requiring the caller to handle it. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
641f064e5df6fb3aaeb6256031a153a5efb16ca6 |
|
25-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: remove FSF address from boilerplate text Addresses change... Remove the paragraph with the FSF address from all the comedi source files. Also, remove the paragraph about the finding the complete GPL in the COPYING file since it's unnecessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
3d1fe3f785c80e17f62acf8f92570ae9210bd588 |
|
18-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: free_irq() in comedi_legacy_detach() All the legacy comedi drivers now call comedi_legacy_detach() either directly or as part of their (*detach). Move the free_irq() into comedi_legacy_detach() so that the drivers don't have to deal with it. For drivers that then only call comedi_legacy_detach() in their private (*detach), remove the private function and use the helper directly for the (*detach). The amplc_pc236 and ni_labpc drivers are hybrid legacy/PCI drivers. In the detach of a PCI board free_irq() still needs to be handled by the driver. The pcl724 and pcl726 drivers currently have the free_irq() #ifdef'ed out. The comedi_legacy_detach() function sanity checks that the irq has been requested before freeing it so they are safe to convert. For aesthetic reasons, move the #ifdef unused chunk in the pcl816 driver up to the previous #ifdef unused block. The pcmio and pcmuio drivers request multiple irqs and handle the freeing of them. Remove the 'dev->irq = irq[0]' in those drivers so that comedi_legacy_detach() does not attempt to free the irq. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a32c6d0084992d3e58a93120c9ce9527e80c651e |
|
18-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: drivers: use comedi_legacy_detach() Use comedi_legacy_detach() to release the I/O region requested by these drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2f69915c728c3be41e12dbbbdd4eeb8d3388d58c |
|
16-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: introduce, and use, comedi_spriv_free() The comedi_subdevice 'private' variable is a void * that is available for the subdevice to use in manner. It's common in comedi drivers for the driver to allocate memory for a subdevice and store the pointer to that memory in the 'private' variable. It's then the responsibility of the driver to free that memory when the device is detached. Due to how the attach/detach works in comedi, the drivers need to do some sanity checking before they can free the allocated memory during the detach. Introduce a helper function, comedi_spriv_free(), to handle freeing the private data allocated for a subdevice. This allows moving all the sanity checks into the helper function and makes it safe to call with any context. It also allows removing some of the boilerplate code in the (*detach) functions. Remove the subdev_8255_cleanup() export in the 8255 subdevice driver as well as the addi_watchdog_cleanup() export in the addi_watchdog driver and use the new helper instead. The amplc_dio200_common driver uses a number of local helper functions to free the private data for it's subdevices. Remove those as well and use the new helper. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
926848220e601338c918bdbde1d3fe7e63c8c04d |
|
12-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: plx9052: tidy up the register defines The PLX INTCSR register defines are a bit wordy and many of them are not used anywhere. For aesthetic reasons, remove all the *_MASK and *_DISABLED defines and rename the remaining bit defines so they are not as wordy. Convert all the bit defines to bit shifts. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
d7849efa932cc1799b51542c1b1975ff799e9fe0 |
|
10-Apr-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: ampcl_pc236: use comedi_request_region() Use comedi_request_region() to request the I/O region used by this driver. Remove the noise when the board is first attached as well as the error message when the request_region() fails, comedi_request_reqion() will output the error message if necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
818f569fe930c5b8a05d1a44ece3c63c99c13c88 |
|
13-Mar-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi_pci: pass comedi_device to comedi_pci_enable() Make comedi_pci_enable() use the same parameter type as comedi_pci_disable(). This also allows comedi_pci_enable to automatically determine the resource name passed to pci_request_regions(). Make sure the errno value returned is passed on instead of assuming an errno. Also, remove any kernel noise that is generated when the call fails. The National Instruments drivers that use the mite module currently enable the PCI device in the mite module. For those drivers move the call to comedi_pci_enable into the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
7f072f54ae5dc9965cbe450419b1389d13e2b849 |
|
13-Mar-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi_pci: make comedi_pci_disable() safe to call Currently all the comedi PCI drivers need to do some checking in their (*detach) before calling comedi_pci_disable() in order to make sure the PCI device has actually be enabled. Change the parameter passed to comedi_pci_disable() from a struct pci_dev pointer to a comedi_device pointer and have comedi_pci_disable() handle all the checking. For most comedi PCI drivers this also allows removing the local variable holding the pointer to the pci_dev. For some of the drivers comedi_pci_disable can now be used directly as the (*detach) function. The National Instruments drivers that use the mite module currently enable/disable the PCI device in the mite module. For those drivers move the call to comedi_pci_disable into the driver and make sure dev->iobase is set to a non-zero value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
b8f4ac237e382accd4b30c75043939f7ed9e79a6 |
|
05-Mar-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: comedi_pci: change the comedi_pci_auto_config() 'context' The comedi_pci_auto_config() function is used to allow the PCI driver (*probe) function to automatically call the comedi driver (*auto_attach). This allows the comedi driver to be part of the PnP process when the PCI device is detected. Currently the comedi_pci_auto_config() always passes a 'context' of '0' to comedi_auto_config(). This makes the 'context' a bit useless. Modify comedi_pci_auto_config() to allow the comedi pci drivers to pass a 'context' from the PCI driver. Make all the comedi pci drivers pass the pci_device_id 'driver_data' as the 'context'. Since none of the comedi pci drivers currently set the 'driver_data' the 'context' will still be '0'. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
33782dd5edf8db3cdb7c81a3523bf743dd0209b7 |
|
30-Jan-2013 |
H Hartley Sweeten <hsweeten@visionengravers.com> |
staging: comedi: conditionally build in PCI driver support Separate the comedi_pci_* functions out of drivers.c into a new source file, comedi_pci.c. This allows conditionally building support for comedi PCI drivers into the comedi core. Fix the Kconfig and Makefile appropriately. Group all the comedi_pci_* prototypes and related defines into one place in comedidev.h. Protect these prototypes with an #ifdef and provide some dummy functions so that the mixed ISA/PCI comedi drivers will still build correctly. Remove the #include <linux/pci.h> from comedidev.h and drivers.c. This include is only needed by the comedi PCI driver support code and the PCI drivers. The include should occur in those files. Also, remove the #include <linux/pci.h> from a couple non-PCI drivers since it's not needed. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
9901a4d75d007686e8f6473189cafc4b216b7449 |
|
22-Jan-2013 |
Peter Huewe <peterhuewe@gmx.de> |
staging/comedi: Use comedi_pci_auto_unconfig directly for pci_driver.remove (Almost) all comedi pci drivers have some wrapper for their pci_driver.remove function which simply calls comedi_pci_auto_unconfig which has the same function prototype as the wrapper. -> we can remove these wrappers and call comedi_pci_auto_unconfig directly. This removes a lot some boilerplate code and saves some bytes. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
53b800198592b0ff96577ecc5f116f7d902a4362 |
|
19-Nov-2012 |
Bill Pemberton <wfp5p@virginia.edu> |
staging: comedi: remove use of __devexit CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a690b7e535f2f97a3a05ee570715abeb60a8910f |
|
19-Nov-2012 |
Bill Pemberton <wfp5p@virginia.edu> |
staging: comedi: remove use of __devinit CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a471eace7baa40cdf16d3f26b2f78ddce613ca8f |
|
19-Nov-2012 |
Bill Pemberton <wfp5p@virginia.edu> |
staging: comedi: remove use of __devexit_p CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
7efbbc37db3ced8bde7ed68b04a17fd716deb586 |
|
14-Nov-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: amplc_pc236: use cfc_check_trigger_arg_*() helpers Use the new helpers in the step 3 tests of pc236_intr_cmdtest(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
750af5e568d060ec6994cdcb4e86cdddfcd473c0 |
|
30-Oct-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi/drivers: use auto_attach instead of attach_pci Change comedi drivers for PCI boards to use the new `auto_attach()` method instead of the `attach_pci()` method. I plan to remove the `attach_pci()` and `attach_usb()` methods from `struct comedi_driver` once nothing is using them. Tag the functions with `__devinit` where they are not already so tagged, as they are only called during PCI probe. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2847ff5d1b63496c2e3eedb8efad2752cc2e195d |
|
25-Oct-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: comedidev.h: add PCI_VENDOR_ID_AMPLICON Add a define for the Amplicon Liveline Limited PCI vendor id. Remove the duplicates in the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
c34fa261b0ac3a862ccd3f71ee55a16b920dfc83 |
|
23-Oct-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: remove inline alloc_private() This inline function has a very generic name and it's only a wrapper around a simple kzalloc(). Since the inline function does not save any lines-of-code, instead of renaming it just remove it and do the kzalloc() directly. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
9a1a6cf8ae5ca58171e117335b9983e3cfa2185c |
|
15-Oct-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: drivers: remove remaining devpriv macros The remaining comedi drivers that still have a devpriv macro are all pretty straight forward for removing the devpriv macro. This macro relies on a local variable having a specific name. Remove its use by replacing it with a local variable where used. The inline function alloc_private(), used to kzalloc the dev->private memory, returns non-zero if there is an error. Fix all the alloc_private() calls accordingly and remove any kernel messages or obvious comments that still exist in the drivers. Leave a comment in the skel driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2db012bd40b889d8e5483d3daa07af04c4c109d8 |
|
03-Oct-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: fix possible NULL deref during detach `pc236_detach()` is called by the comedi core to clean up if either `pc236_attach()` or `pc236_attach_pci()` returns an error. It sets `thisboard` to the return value of `comedi_board(dev)` and assumes it is non-null. This is a valid assumption if `pc236_attach()` fails, but not if `pc236_attach_pci()` fails, leading to a possible NULL pointer dereference. Check `thisboard` at the top of `pc236_detach()` and return early if it is `NULL`. This is okay because the only other thing that could have been allocated is `dev->private` and that is freed by the comedi core, not by this function. Cc: <stable@vger.kernel.org> # 3.6.x Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
aaeb61a97b7159ebe30b18a422d04eeabfa8790b |
|
03-Oct-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: fix invalid register access during detach `pc236_detach()` is called by the comedi core if it attempted to attach a device and failed. `pc236_detach()` calls `pc236_intr_disable()` if the comedi device private data pointer (`devpriv`) is non-null. This test is insufficient as `pc236_intr_disable()` accesses hardware registers and the attach routine may have failed before it has saved their I/O base addresses. Fix it by checking `dev->iobase` is non-zero before calling `pc236_intr_disable()` as that means the I/O base addresses have been saved and the hardware registers can be accessed. It also implies the comedi device private data pointer is valid, so there is no need to check it. Cc: <stable@vger.kernel.org> # 3.5.x, 3.6.x Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
27020ffed9166d65ce1e5b523051d13bfa2329b0 |
|
26-Sep-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: drivers: use comedi_fc.h cmdtest helpers Use the cfc_check_trigger_src() helper for Step 1 in all the driver cmdtest functions. Use the cfc_check_trigger_is_unique() helper for Step 2 in all the driver cmdtest functions. Note that single source triggers do not need to be checked, they are already unique if they pass Step 1. For aesthetic reasons, change the comments in the cmdtest functions for steps 1 and 2 so that they are all the same. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
39d37be4113f8c423ab2a3a7af37cd50c802d779 |
|
06-Sep-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: amplc_pc236: remove subdevice pointer math Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
3abcfe0eeda850481143d05bdd206dd2b170d07d |
|
03-Sep-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Fix PCI ref count When attaching a PCI device manually via the comedi driver `attach` hook (`pc236_attach()`) (called by the comedi core for the `COMEDI_DEVCONFIG` ioctl), its reference count is incremented in the `for_each_pci_dev` loop (in `pc236_find_pci_dev()`). It is decremented when the `detach` hook (`pc236_detach()`) is called to detach the device. However, when the PCI device is attached automatically via the `attach_pci` hook (`pc236_attach_pci()`, called at probe time via `comedi_pci_auto_config()`) it's reference count is not incremented so there will be an unmatched decrement when detaching the device. Increment the PCI device reference count in `pc236_attach_pci()` to correct the mismatch. Once support for manual configuration has been removed from this driver, the calls to `pci_dev_get()` and `pci_dev_put()` can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
00255d194321a4800de6bd87fc5b30972d5ecbb3 |
|
16-Aug-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: abbreviate IS_ENABLED() The IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_ISA) and IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI) macro calls are a bit long-winded. Define a couple of macros DO_ISA and DO_PCI as abbreviations for them. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
15bad7b518043aa00d6220effabaf8c262a5af64 |
|
16-Aug-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: check bus type before accessing LCR The PCI-local bridge LCR registers are (assumed to be) present and used iff the board is a PCI board (a PCI236). Currently the code tests if devpriv->lcr_iobase is valid before accessing the registers. Instead, check if the board is a PCI board and assume devpriv->lcr_iobase is valid if so. (Currently, no validity check is performed as the PCI vendor and device ID ought to suffice, but simple checks could be added when attaching the device.) Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
02918c0066b1c990a4e60c0dd4702eb9639b760b |
|
16-Aug-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: check bus type in detach routine When detaching the device in pc236_detach() mirror the bus type checks performed by pc236_attach(). The existing tests are safe but rely on dev->iobase being 0 when comedi_to_pci_dev(dev) is NULL. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
409861ff73c1bde35993da3d2b976ec8b9c107ea |
|
16-Aug-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: add helper functions to check bus type Add inline helper function is_isa_board(board) to check if the driver supports ISA boards and this is an ISA board, and is_pci_board(board) to check if the driver supports PCI boards and this is a PCI board. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
b6d446b5de6139d2a5764c7568012ffa14e2aa6e |
|
19-Jul-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: amplc_pc236: store the pci_dev in the comedi_device Use the hw_dev pointer in the comedi_device struct to hold the pci_dev instead of carrying it in the private data. Since the pci_dev is no longer held in the provate data, we can also cleanup the detach a bit. Remove the IS_ENABLED() tests in the detach. If the pci_dev is non NULL it's a PCI device otherwise it's an ISA device. Using IS_ENABLED() to omit the code paths makes the code a bit confusing and doesn't save much. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
ed7fd225efef11fb8c85ec650288702af69bbe83 |
|
19-Jul-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: amplc_pc236: cleanup "find pci device" code For aesthetic reasons, rename the function and pass the comedi_devconfig struct instead of pre-parsing out the bus/slot information. Use for_each_pci_dev() instead of open-coding the loop using pci_get_device(). Consolidate the dev_err messages when a pci device is not found. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a2714e3e42e746d6c8525c35fdcc58fb60c2830d |
|
18-Jun-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: fix return value for insn_bits functions The comedi_subdevice 'insn_bits' functions return the number of data elements used to perform the command. Most of the insn_bits functions return an open coded '2' to indicate this. The same value is available as 'insn->n'. Return that instead to better indicate what the return means. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
8b6c56949ffa83dbc2a6e8fa3f98b10a19372207 |
|
12-Jun-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: propogate error code from comedi_alloc_subdevices comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it does fail make sure to pass the proper error code back. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbott@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
0e4039f3112326d73f66b00fd18468a3804ed29e |
|
12-Jun-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: remove the comed_alloc_subdevices "allocation failed" messages Remove all the "allocation failed" debug messages that are displayed when the comedi_alloc_subdevices call fails. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbot <abbott@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
2f0b9d082e5d0056a3aca4be038483a564849196 |
|
12-Jun-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: export alloc_subdevices as comedi_alloc_subdevices Move the inline alloc_subdevices() function from comedidev.h to drivers.c and rename it to comedi_alloc_subdevices(). The function is large enough to warrant being an exported symbol rather than being an inline in every driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
a46e759fc05a048530da43f241c8f07e0624232c |
|
30-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Remove most #if lines Remove most of the #if IS_ENABLED(xxx) lines, but add extra if (IS_ENABLED(xxx)) tests so the compiler can remove unreachable code. The pci_driver stuff and device table is still conditionally compiled. Also made pc236_find_pci() static as it was accidentally made non-static by an earlier patch, so the compiler wouldn't remove it when it was unreachable. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
18e41de083075b3b6a0bd55e00f1662d045efb49 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Add attach_pci() hook Implement the attach_pci() hook as function pc236_attach_pci(). This is called bu comedi_pci_auto_config() in preference to the old attach() hook (implemented by pc236_attach()) and avoids searching for the probed PCI device. Factor out code common to pc236_find_pci() and pc236_attach_pci() into new function pc236_find_pci_board(). Factor out most code common to pc236_attach() and pc236_attach_pci() into new functions pc236_pci_common_attach() and pc236_common_attach(). Also #if out member 'devid' from struct pc236_board unless PCI boards are supported as it is not used for ISA boards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
24ffe74c93ac93bae84b2e44b868bbfd2c7954c3 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Remove thisboard and devpriv macros The 'thisboard' and 'devpriv' macros rely on a local variable having a specific name and yield pointers derived from that local variable. Replace the macros with local variables wherever they occur. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
273ba547da12406d609795bc8976cb2464b15d82 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Change return type of pc236_find_pci() pc236_find_pci() finds a supported PCI device, returning 0 on success or -EIO on failure and returning the pointer to the PCI device via a struct pci_dev ** parameter. Change it to return the struct pci_dev * on success or NULL on failure. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
916d7028a91a6a0e4b76e7cfb97819f294cbd803 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Remove unused fancy_name Remove fancy_name member from struct pc236_board. It is initialized in pc235_boards[] but not used anywhere else. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
62bc23d145d636f0de2bf412dcf31a33fcf16046 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Replace printk calls Replace the printk calls with dev_info, dev_err, etc. There were some consecutive printk calls without newlines which now scnprintf into a temporary buffer and this bit of code has been factored out into new function pc236_report_attach(). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
7bd06f69f3f52fcd04999790a2a9d66f1a8cd0c9 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Remove forward function declarations Moved some functions and variables to avoid forward declarations. Moved PCI table closer to the struct pci_driver that refers to it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
c25386f5db48ee5d94b6ff3b1dc43ea6c87c9560 |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Use module_comedi_{pci,}_driver() If PCI boards are supported, use the module_comedi_pci_driver() macro to register the module as a comedi driver and a PCI driver. Otherwise, only ISA boards are supported so use the module_comedi_driver() macro to register the module as a comedi driver. Renamed 'driver_amplc_pc236' to 'amplc_pc236_driver' and removed 'driver_' prefix from PCI related functions and variables, purely for aesthetic reasons. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
1bb6dfc407b7c29d22dc9b5d21db86f50653b46e |
|
29-May-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: Use IS_ENABLED() Change conditional compilation on kernel config options to use the IS_ENABLED() macro. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
55c03cff7fd73349473cc0a964df9d55b312dbbc |
|
22-May-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: remove private header comedi_pci.h Remove the private header, comedi_pci.h, by moving the two helper functions into divers.c and providing the prototypes in comedidev.h. This allows the comedi_pci_enable/disable helper functions to be shared instead of having an inline version in every comedi pci driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
484ecc95d9cdfa8b2f7029e2f3409cf078aed4ab |
|
18-May-2012 |
H Hartley Sweeten <hartleys@visionengravers.com> |
staging: comedi: cleanup all the comedi_driver 'detach' functions 1. Change the return type from int to void All the detach functions, except for the comedi usb drivers, simply return success (0). Plus, the return code is never checked in the comedi core. The comedi usb drivers do return error codes but the conditions can never happen. The first check is: if (!dev) return -EFAULT; This checks that the passed comedi_device pointer is valid. The detach function itself is called using this pointer so it MUST always be valid or there is a bug in the core: if (dev->driver) dev->driver->detach(dev); And the second check: usb = dev->private; if (!usb) return -EFAULT; The dev->private pointer is setup in the attach function to point to the probed usb device. This value could be NULL if the attach fails. But, since the comedi core is going to unload the driver anyway and does not check for errors there is no gain by returning one. After removing these checks from the comedi usb drivers the detach functions required a bit of cleanup. 2. Remove all the printk noise in the detach functions All of the printk output is really just noise. The user did a rmmod to unload the driver, we really don't need to tell them about it. Also, some of the messages are output using: dev_dbg(dev->hw_dev, ... or dev_info(dev->hw_dev, ... Unfortunately the hw_dev value is only used by drivers that are doing DMA. For most drivers this variable is going to be NULL so the output is not going to work as expected. 3. Refactor a couple static 'free_resource' functions into the detach functions. The 'free_resource' function is only being called by the detach and it makes more sense to just absorb the code. 4. Remove a couple unnecessary braces for single statements. 5. Remove unnecessary comments. Most of the comedi drivers appear to be based on the comedi skel driver and have the comments from that driver included. These comments make sense in the skel driver for reference but they don't need to be in any of the actual drivers. 6. Remove all the extra whitespace. It's not needed to make the functions any more readable. 7. Remove the now unused 'attached_successfully' variable in the cb_pcimdda driver. This variable was only used to conditionally output some driver noise during the detach. Since all the printk's have been removed this variable is no longer necessary. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
4c093a6dc2240fd54d71a25b284e02d51509e430 |
|
30-Mar-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: pass 'struct comedi_driver *' to comedi_..._auto_config The comedi_pci_auto_config() and comedi_usb_auto_config() functions currently take a board name parameter which is actually a driver name parameter. Replace it with a pointer to the struct comedi_driver. This will allow comedi_pci_auto_config() and comedi_usb_auto_config() to call bus-type-specific auto-configuration hooks in the struct comedi_driver if they exist (they don't yet). The idea is that these bus-type-specific auto-configuration hooks won't have to search the bus for the device being auto-configured like 'attach()' hook has to. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
717ab674e261932ca642af838ef9eea111623682 |
|
26-Mar-2012 |
Ian Abbott <abbotti@mev.co.uk> |
staging: comedi: amplc_pc236: separately configure ISA and PCI The amplc_pc236 driver supports both ISA and PCI cards, but currently it is only possible to select the driver if PCI is configured. This patch splits the configuration to make the ISA and PCI parts seperately selectable, and changes the driver to only include the selected ISA and/or PCI board types. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
7b0be12b26d86ea2bd5079f0d723289e2f5a43a9 |
|
07-Nov-2011 |
Peter Huewe <peterhuewe@gmx.de> |
staging/comedi/amplc: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) This patch converts pci_table entries to use the PCI_DEVICE macro, if .subvendor and .subdevice are set to PCI_ANY_ID, and thus improves readablity. Since the driver_data field isn't used anywhere we can also drop the assignments for class, class_mask and driver_data. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
727b286b44ea359d66f47d241cc2cdad36ed7bdc |
|
06-Jun-2010 |
Arun Thomas <arun.thomas@gmail.com> |
Staging: comedi: Remove COMEDI_PCI_INITCLEANUP macro Move the PCI devinit/devexit routines to the respective C source files instead of calling COMEDI_PCI_INITCLEANUP Signed-off-by: Arun Thomas <arun.thomas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
7114a28011f9d5f3d981731ad341177c21f9d948 |
|
06-Jun-2010 |
Arun Thomas <arun.thomas@gmail.com> |
Staging: comedi: Remove COMEDI_INITCLEANUP macro Move the init/exit routines to the respective C source files instead of calling COMEDI_INITCLEANUP Signed-off-by: Arun Thomas <arun.thomas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
90f703d30dd3e0c16ff80f35e34e511385a05ad5 |
|
06-Jun-2010 |
Arun Thomas <arun.thomas@gmail.com> |
Staging: comedi: Remove COMEDI_MODULES_MACRO Add MODULE_AUTHOR, MODULE_LICENSE, and MODULE_DESCRIPTION calls to the respective C source files instead of calling COMEDI_MODULES_MACRO Signed-off-by: Arun Thomas <arun.thomas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
9f7a344b69485dc1052534a4e1b2e5a8f7de086e |
|
21-Feb-2010 |
Benjamin Adolphi <b.adolphi@googlemail.com> |
Staging: comedi: amplc_pc236: Checkpatch cleanups This fixes all checkpatch issues in the amplc_pc236 comedi driver. Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
0a85b6f0ab0d2edb0d41b32697111ce0e4f43496 |
|
08-Jun-2009 |
Mithlesh Thukral <mithlesh@linsyssoft.com> |
Staging: Comedi: Lindent changes to comdi driver in staging tree Lindent changes to comdi driver in staging tree. This patch is followed by the checkpatch.pl error fixes. Did not make them part of this patch as the patch size is already huge. Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
5f74ea14c07fee91d3bdbaad88bff6264c6200e6 |
|
27-Apr-2009 |
Greg Kroah-Hartman <gregkh@suse.de> |
Staging: comedi: remove comedi-specific wrappers There are a number of comedi "wrappers" for some RT functions that are about to go away. This patch removes all of the wrapper calls within the comedi drivers and core in order to prepare for removing the RT comedi code. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
8629efa4cbf6f89a54a85af4b8bc31762af01800 |
|
23-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: make use of ARRAY_SIZE macro Replace instances of computing number of elements in an array with sizeof(foo)/sizeof(struct footype) with the ARRAY_SIZE macro. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
814900c904140cfe7f3e48cabec06b3eec57e0ea |
|
23-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: more fix "foo * bar" should be "foo *bar" Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
68c3dbff9fc9f25872408d0e95980d41733d48d0 |
|
23-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: fix the way structs are initialized. Change from the foo: bar format to the .foo = bar format. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
c3744138715045adb316284ee7a1e608f0278f6c |
|
23-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: remove assignment in conditionals Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
53106ae68acf6eda9593150a25fc44e30fd5ff68 |
|
09-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging Comedi: fix spacing around parens Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
da91b2692e0939b307f9047192d2b9fe07793e7a |
|
09-Apr-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: fix "foo * bar" should be "foo *bar" Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
0d6e5dad12c5a2860e3d13b4d7a4702f90386003 |
|
14-Apr-2009 |
Ian Abbott <abbotti@mev.co.uk> |
Staging: comedi: amplc_pc236: Corrected documentation. Interrupt is triggered by rising edge on port C bit 3 (not bit 7). From: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
70265d24e3404fe798b6edd55a02016b1edb49d7 |
|
26-Mar-2009 |
Jiri Slaby <jirislaby@gmail.com> |
staging: comedi, remove interrupt.h Remove interrupt wraparound. Use defines from linux/interrupt.h instead. Change also parameter types of functions taking ISR to irq_handler_t. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: David Schleef <ds@schleef.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
f1ee810a1383b623ec523edd521467a7b620a09a |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove pc236_private typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
57ad869651d1d2f163a1c5ccb577ee794847fd77 |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove pc236_board typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
0707bb04be89b18ee83b5a997e36cc585f0b988d |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_devconfig typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
90035c0886b256d75bced13b3b3cea5234aff136 |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_insn typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
ea6d0d4cab4f4f2d6a88f3bce4707fe92696fd3f |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_cmd typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
139dfbdfacb02e3ef3df936d2fabd1ad5f14ea88 |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_driver typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
34c43922e62708d45e9660eee4b4f1fb7b4bf2c7 |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_subdevice typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
71b5f4f11971dea972832ad63a994c7e5b45db6b |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove comedi_device typedef Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
790c55415aa31f4c732729f94d2c3a54f7d3bfc2 |
|
17-Mar-2009 |
Bill Pemberton <wfp5p@virginia.edu> |
Staging: comedi: Remove lsampl_t and sampl_t typedefs Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
6a5c8664766b82b36ec50bd2de9e72d3eae0dfbb |
|
13-Feb-2009 |
Ian Abbott <abbotti@mev.co.uk> |
Staging: comedi: add amplc_pc236 driver for Amplicon PC36AT and PCI236 devices From: Ian Abbott <abbotti@mev.co.uk> Cc: David Schleef <ds@schleef.org> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|