Ian Abbott [Tue, 29 Jul 2014 11:58:18 +0000 (12:58 +0100)]
staging: comedi: amplc_pci230: add whitespace to register values
Several macros are defined for bit-field values within hardware
registers. They are defined as left-shifted values. Add some
whitespace around the left-shift operator.
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>
The macro `PCI230_ADC_CONV` is never used. Just remove it. (At one
time, the value was written to the `PCI230_ADCSWTRIG` register to
trigger a conversion, but any value would do, and the driver no longer
uses that register to trigger conversions anyway.)
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>
Ian Abbott [Tue, 29 Jul 2014 11:58:14 +0000 (12:58 +0100)]
staging: comedi: amplc_pci230: usleep_range is preferred over udelay
Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt". I picked 100 us as a reasonable
upper bound, but it's not that critical.
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>
The external callers of ni_tio_acknowledge_and_confirm() only call
this function to ack any pending errors or interrupts before starting
a new async command. Only the internal code in ni_tiocmd uses the
data that is optionally returned by this function.
Remove the export from ni_tio_acknowledge_and_confirm() and introduce
a new exported function that handles passing the NULL params.
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>
staging: comedi: ni_tiocmd: tidy up ni_tio_input_cmd()
The cmd->start_src is validated in the (*do_cmdtest) before this
function is called. All valid trigger sources are handled so the
default BUG() case can never occure.
For aesthetics, refactor the switch into if/else tests and remove
the BUG().
For aesthetics, rename the local variable 'retval' to simply 'ret'.
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>
Ian Abbott [Mon, 28 Jul 2014 12:09:35 +0000 (13:09 +0100)]
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>
Ian Abbott [Mon, 28 Jul 2014 12:09:34 +0000 (13:09 +0100)]
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>
`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>
Ian Abbott [Mon, 28 Jul 2014 12:09:31 +0000 (13:09 +0100)]
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>
Ian Abbott [Mon, 28 Jul 2014 12:09:30 +0000 (13:09 +0100)]
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>
Ian Abbott [Fri, 25 Jul 2014 17:07:09 +0000 (18:07 +0100)]
staging: comedi: amplc_dio200_pci: no need to test board pointer in dio200_pci_detach()
`dio200_pci_detach()` doesn't need to check if the pointer to constant
board data (`thisboard`) and the pointer to private per-device data
(`devpriv`) are valid before calling `amplc_dio200_common_detach()`. It
has no further need to check `thisboard` so remove the variable
altogether. Move the test of `devpriv` to the first point it is needs
to be valid.
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>
Ian Abbott [Fri, 25 Jul 2014 17:07:08 +0000 (18:07 +0100)]
staging: comedi: amplc_dio200_common: remove some tests from amplc_dio200_common_detach()
`amplc_dio200_common_detach()` doesn't do much apart from freeing the
IRQ handler that was requested by `amplc_dio200_common_attach()` if
`dev->irq` is non-zero. There is no need to check if the pointer to
the constant board data or the pointer to private per-device data
exist, so remove those tests.
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>
Ian Abbott [Fri, 25 Jul 2014 17:07:07 +0000 (18:07 +0100)]
staging: comedi: amplc_dio200_common: prevent extra free_irq()
`dio200_detach()` in "amplc_dio200.c" calls
`amplc_dio200_common_detach()` in "amplc_dio200_common.c", followed by
`comedi_legacy_detach()` in "../drivers.c". Both of those functions
call `free_irq()` if `dev->irq` is non-zero. The second call produces a
warning message because the handler has already been freed. Prevent
that by setting `dev->irq = 0` in `amplc_dio200_common_detach()`.
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>
Fabian Frederick [Wed, 23 Jul 2014 19:04:38 +0000 (21:04 +0200)]
staging: ion: vm_insert_pfn and zap_page_range rely on CONFIG_MMU
Fix following sh-allmodconfig errors reported on kisskb
"
drivers/built-in.o: In function `ion_vm_fault':
ion.c:(.text+0x1f2d8f8): undefined reference to `vm_insert_pfn'
drivers/built-in.o: In function `ion_buffer_sync_for_device':
ion.c:(.text+0x1f316bc): undefined reference to `zap_page_range'
make: *** [vmlinux] Error 1
"
Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Looks like no one's working on the driver anymore, so remove it for now.
If someone wants to work on moving it out of staging, this commit can be
reverted.
Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Mark A. Allyn <mark.a.allyn@intel.com> Cc: Jayant Mangalampalli <jayant.mangalampalli@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Marc Fite [Sun, 27 Jul 2014 18:31:08 +0000 (20:31 +0200)]
staging: lustre: lov: Fix sparse warning using plain integer as NULL pointer
This patch fixes the warning generated by sparse: "Using plain integer as NULL pointer" by replacing the offending 0s with NULL.
drivers/staging/lustre/lustre/lov/lov_obd.c:902:48: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:946:54: warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/lov/lov_obd.c:2819:46: warning: Using plain integer as NULL pointer
Signed-off-by: Marc Fite <marc@fite.cat> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Igor Bezukh [Fri, 25 Jul 2014 16:05:31 +0000 (19:05 +0300)]
Staging: vt6655: removed redundant comments from desc.h
Removed redundant comments from desc.h header file.
Signed-off-by: Igor Bezukh <igbzkh@gmail.com>
C99 style comments will be fixed in further patches. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 25 Jul 2014 09:04:58 +0000 (10:04 +0100)]
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>
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>
Ian Abbott [Fri, 25 Jul 2014 09:04:55 +0000 (10:04 +0100)]
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>
Ian Abbott [Fri, 25 Jul 2014 09:04:54 +0000 (10:04 +0100)]
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>
Ian Abbott [Fri, 25 Jul 2014 09:04:51 +0000 (10:04 +0100)]
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>
Ian Abbott [Fri, 25 Jul 2014 09:04:50 +0000 (10:04 +0100)]
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>
Ian Abbott [Fri, 25 Jul 2014 09:04:49 +0000 (10:04 +0100)]
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>
The driver hasn't been cleaned up and it doesn't look like anyone is
working on it anymore (including the original author). So remove it.
If someone wants to work on cleaning the driver up and moving it out of
staging, this commit can be reverted.
In addition, since this removes the CONFIG_NET_VENDOR_SILICOM config
symbol, remove the symbol from all defconfig files that reference it.