Ian Abbott [Thu, 16 Aug 2012 13:38:05 +0000 (14:38 +0100)]
staging: comedi: replace printk calls in comedi core
Replace the printk() calls in the comedi core module with something more
suitable, such as dev_...() or pr_...(). Remove the ones that report a
failure to increment a module count (try_module_get() failure). Change
the printk() call in the DPRINTK() macro to pr_debug().
TODO: Most of the DPRINTK() calls need to be replaced with something
else.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>
Ian Abbott [Thu, 16 Aug 2012 11:24:10 +0000 (12:24 +0100)]
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>
Ian Abbott [Thu, 16 Aug 2012 11:24:09 +0000 (12:24 +0100)]
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>
Ian Abbott [Thu, 16 Aug 2012 11:24:08 +0000 (12:24 +0100)]
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>
The IS_ENABLED(CONFIG_COMEDI_AMPLC_PC263_ISA) and
IS_ENABLED(CONFIG_COMEDI_AMPLC_PC263_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>
Ian Abbott [Thu, 16 Aug 2012 10:14:19 +0000 (11:14 +0100)]
staging: comedi: amplc_pc263: check bus type in detach routine
When detaching the device in pc263_detach() mirror the bus type checks
performed by pc263_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>
Ian Abbott [Thu, 16 Aug 2012 10:14:18 +0000 (11:14 +0100)]
staging: comedi: amplc_pc263: 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>
staging: comedi: contec_pci_dio: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an attach_pci callback function. Since the
driver does not require any external configuration options, disable
the legacy attach by making the attach simply return -ENOSYS. This
removes the need to walk to pci bus to find the pci_dev and the
need for the pci_dev_put in the detach.
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>
staging: comedi: contec_pci_dio: define register map for board
Only one board type is supported by this driver. Instead of
passing the register offsets for the digital in/out ports in
the boardinfo, define the register map and use that to access
the ports.
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>
Devendra Naga [Wed, 15 Aug 2012 09:11:03 +0000 (14:56 +0545)]
staging: serqt_usb2: remove retval initialisation in qt_tiocmget and qt_tiocmset
in qt_tiocmset,
the retval gets assigned if we have a valid serial pointer in the critical section
(between mutex_lock and _unlock) of the code, no need to initialise this variable.
the same retval assignment follows in the qt_tiocmget function also, so remove the
initialisation here too.
Ian Abbott [Wed, 15 Aug 2012 14:31:41 +0000 (15:31 +0100)]
staging: comedi: amplc_dio200: replace macros with inline functions
Replace the IS_ISA_BOARD() and IS_PCI_BOARD() functionlike macros with
inline functions is_isa_board() and is_pci_board(). Also call
is_pci_board() in dio200_find_pci_board() instead of an explicit
comparison operator.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Wed, 15 Aug 2012 14:02:45 +0000 (15:02 +0100)]
staging: comedi: make attach handler optional
Some low-level Comedi drivers no longer support manual configuration of
devices with the COMEDI_DEVCONFIG ioctl (used by the comedi_config
program). For those drivers, the 'attach_pci' or 'attach_usb' handler
will be set in the struct comedi_driver to configure devices
automatically (via comedi_pci_auto_config() or
comedi_usb_auto_config()). Their 'attach' handlers are redundant but
the the comedi core module currently requires it to be set.
Make the 'attach' handler optional and issue a warning if something
wants to call it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dnya_pci10xx: move boardinfo values into subdevice setup
There is only one "boardtype" actually supported by this driver.
The second entry in the boardinfo is a dummy entry that would
result in an unusable device.
Remove the boardinfo fields and just use the open coded values
in the subdevice setup.
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>
staging: comedi: dnya_pci10xx: cleanup the analog output range
The analog output channels on this board only support a single
range, 0-10V unipolar. This range is available as an exported
symbol from the comedi core and "range_unipolar10". Use that
instead of duplicating the range in this driver and remove
the information from the boardinfo.
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>
staging: comedi: dnya_pci10xx: use attach_pci callback
Convert this PCI driver to use the comedi PCI auto config attach
mechanism by adding an attach_pci callback function. Since the
driver does not require any external configuration options, disable
the legacy attach by making the attach simply return -ENOSYS. This
removes the need to walk the pci bus to find the pci_dev and the
need for the pci_dev_put() in the detach.
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>
staging: comedi: dnya_pci10xx: remove thisboard and devpriv macros
These macros rely on local variables having a specific name. Replace
them with local variables where used. Use the comedi_board() helper
to get the thisboard pointer.
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>
Andre Renaud [Wed, 15 Aug 2012 20:18:02 +0000 (15:18 -0500)]
staging: omapdrm: Expose the OMAP Z-Order property through DRM
Added support for zorder changes through DRM plane properties
Signed-off-by: Andre Renaud <andre@bluewatersys.com> Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This driver uses the void *private variable in the comedi_subdevice
to pass the offset needed to read/write the appropriate register to
get/set the channels for the subdevice.
The adl_pci7x3x_do_insn_bits() and adl_pci7x3x_di_insn_bits() functions
were retrieving this offset by casting the s->private value as an
unsigned int. On 64-bit builds this results in a warning:
warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Fix these warnings by casting the void * to an unsigned long.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 14 Aug 2012 15:31:28 +0000 (16:31 +0100)]
staging: comedi: amplc_dio200: add helper macros to check bus type
Add helper macro 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>
Ian Abbott [Tue, 14 Aug 2012 15:31:29 +0000 (16:31 +0100)]
staging: comedi: amplc_dio200: check bus type in detach routine
When detaching the device in dio200_detach() mirror the bus type checks
performed by dio200_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>
The IS_ENABLED(CONFIG_COMEDI_AMPLC_DIO200_ISA) and
IS_ENABLED(CONFIG_COMEDI_AMPLC_DIO200_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>
Dan Carpenter [Tue, 14 Aug 2012 07:04:45 +0000 (10:04 +0300)]
Staging: xgifb: fix bitwise vs logical bug
This is a static checker fix and not something I can test. The intent
of the code here is to set some bit flags. For a logical OR the ">> 1"
shift wouldn't make a difference. So it should be using a bitwise OR.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jesper Juhl [Tue, 7 Aug 2012 19:44:54 +0000 (21:44 +0200)]
staging: speakup: i18n.c: Fix leak in msg_set()
If we end up returning -EINVAL from the function we will leak the
memory allocated to 'newstr' which has been allocated but not yet
assigned to anything.
Fix the leak by properly freeing the memory again before we return.
This patchset provides page mapping via the page table.
On some archs, most notably ARM, this method has been
demonstrated to be faster than copying.
The logic controlling the method selection (copy vs page table)
is controlled by the definition of USE_PGTABLE_MAPPING which
is/can be defined for any arch that performs better with page
table mapping.
staging: zsmalloc: prevent mappping in interrupt context
Because we use per-cpu mapping areas shared among the
pools/users, we can't allow mapping in interrupt context
because it can corrupt another users mappings.
staging: zsmalloc: s/firstpage/page in new copy map funcs
firstpage already has precedent and meaning the first page
of a zspage. In the case of the copy mapping functions,
it is the first of a pair of pages needing to be mapped.
This patch just renames the firstpage argument to "page" to
avoid confusion.
Larry Finger [Sat, 28 Jul 2012 16:39:48 +0000 (11:39 -0500)]
staging: r8712u: Reduce maximum receive buffer size to a more sensible value
The current value for the maximum receive buffer size is 30720, which is
too large. For long-running systems, memory fragmentation may make it
difficult to obtain the buffers of O(2) needed for aggregation. Buffers
of O(3) are even worse, particularly when not needed. The new size is set
to 9100, which will allow aggregation.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Andy Shevchenko [Thu, 2 Aug 2012 16:05:46 +0000 (19:05 +0300)]
staging: nvec: use %*ph to dump small buffers
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: ac100@lists.launchpad.net Acked-by: Julian Andres Klode <jak@jak-linux.org> Acked-By: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ben Chan [Tue, 24 Jul 2012 14:49:42 +0000 (07:49 -0700)]
staging: gdm72xx: fix reference counting in gdm_wimax_event_init
This patch fixes the commit "staging/gdm72xx: cleanup little at
gdm_wimax_event_rcv" (8df858ea76b76dde9a39d4edd9aaded983582cfe),
which mishandles the reference counting of wm_event.
Signed-off-by: Ben Chan <benchan@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The reclaim_buffers callback has already been removed by Daniel Vetter
<daniel.vetter@ffwll.ch> with his patch "drm: kill reclaim_buffers callback"
(b0071efe82). As a result the kernel compilation fails with omapdrm support
and so the callback for reclaim_buffers is being removed from omapdrm.
Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Reviewed-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Rob Clark <rob@ti.com> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: vt6656: don't leak 'param' in vt6656_hostap_ioctl() when returning -EOPNOTSUPP
Don't return -EOPNOTSUPP directly in switch case's since it'll leak
the memory allocated to 'param' when that variable goes out of scope
without having been assigned to anything.
staging: android: logger.h: Complete documentation of logger_entry
Previously, there were simply comments after each part - Now, it is
completed properly according to "Kernel doc" Sorry in advance if I made
any mistakes.
as the init and exit functions just do a platform_driver_register and
platform_driver_unregister, and nothing else, so its better to
use the module_platform_driver macro rather replicating its implementation
Devendra Naga [Sat, 4 Aug 2012 07:16:38 +0000 (13:01 +0545)]
staging/csr: clean coding style in uf_start_thread
in bh.c the function uf_start_thread needed a coding style fixes.
The following fixes:
* fix no space at the start of line
* fix over 80 character lines
* fix no brace needed for single statement blocks (if..else or for and while)
* use tabs instead of 4 spaces at the start of every line
the following warnings were fixed:
1. removed all spaces before the start of a line and used tabs
2. removed the braces around the if as it encloses only a single statement
staging: comedi: adl_pci6208: use the 'board_name' for the resource name
Use the 'dev->board_name' instead of the 'dev->driver->driver_name'
as the resource name used when requesing the pci regions in
comedi_pci_enable(). The board_name has a closer affinity to the
card.
Also, remove the dev_err() message when comedi_pci_enable() fails.
It's just noise and doesn't actually tell the real reason why the
call failed. It could have failed either the pci_enable_device()
or the pci_request_regions().
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>
staging: comedi: adl_pci6208: split the digital i/o subdevice
The PCI-6208/6216 cards have 4 digital inputs and 4 digital outputs.
These are currently being handled by an 8 channel COMEDI_SUBD_DIO
subdevice in this driver. This causes the 4 digital outputs to
appear as channels 0 thru 3 and the 4 digital inputs to appear as
channels 4 thru 7. Userspace can only work out part thisby doing the
COMEDI_INSNLIST ioctl with the INSN_CONFIG_DIO_QUERY instruction
for each channel to determine the io direction.
Make things a bit cleaner for userspace by creating two subdevices
instead. One for the 4 digital inputs and one for the 4 digital
outputs. For both subdevices the channel number indicates the
actual digital input/output signal.
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>