openwrt/staging/blogic.git
11 years agostaging: comedi: ni_mio_common: needs <linux/delay.h>
H Hartley Sweeten [Wed, 24 Jul 2013 16:55:00 +0000 (09:55 -0700)]
staging: comedi: ni_mio_common: needs <linux/delay.h>

As reported by the kbuild test robot:

Commit: d92fef8d2552ffde42b6092cb467f3021ebf8b98
staging: comedi: do not include <linux/delay.h> if its not needed

Removed the include from the ni_atmio driver, which did not need it.
Unfortunately, this driver includes ni_mio_common.c, which does need
it.

Add the include of <linux/delay.h> to the ni_mio_common.c source
where it is needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_osc.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:49 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_osc.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in obd_mount.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:48 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in obd_mount.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in linux-sysctl.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:47 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in linux-sysctl.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in capa.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:46 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in capa.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_mgc.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:45 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_mgc.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_mdc.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:44 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_mdc.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lvfs_linux.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:43 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lvfs_linux.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in fsfilt_ext3.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:42 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in fsfilt_ext3.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_lov.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:41 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_lov.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_lmv.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:40 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_lmv.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in symlink.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:39 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in symlink.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in super25.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:38 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in super25.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in remote_perm.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:37 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in remote_perm.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lproc_llite.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:36 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lproc_llite.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in llite_mmap.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:35 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in llite_mmap.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in llite_lib.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:34 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in llite_lib.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in llite_capa.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:33 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in llite_capa.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in dir.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:32 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in dir.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in linux-debug.c
Sachin Kamat [Wed, 24 Jul 2013 06:36:31 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in linux-debug.c

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lustre_user.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:30 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lustre_user.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lustre_quota.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:29 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lustre_quota.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lustre_net.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:28 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lustre_net.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lustre_lite.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:27 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lustre_lite.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lustre_handles.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:26 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lustre_handles.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in lprocfs_status.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:25 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in lprocfs_status.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in socklnd_lib-linux.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:24 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in socklnd_lib-linux.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in linux-time.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:23 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in linux-time.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in linux-prim.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:22 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in linux-prim.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in linux-cpu.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:21 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in linux-cpu.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Remove version.h header inclusion in kp30.h
Sachin Kamat [Wed, 24 Jul 2013 06:36:20 +0000 (12:06 +0530)]
staging: lustre: Remove version.h header inclusion in kp30.h

version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: usbip: improve error reporting
Anthony Foiani [Mon, 8 Jul 2013 06:52:42 +0000 (00:52 -0600)]
staging: usbip: improve error reporting

Give useful error messages when we can't create server sockets.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: usbip: use local variable while setting up socket
Anthony Foiani [Mon, 8 Jul 2013 06:52:41 +0000 (00:52 -0600)]
staging: usbip: use local variable while setting up socket

Using a simple integer makes the code easier to read and removes the
need to blank out array elements in case of errors.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: usbip: clean up checkpatch warnings in usbipd.c
Anthony Foiani [Mon, 8 Jul 2013 06:52:40 +0000 (00:52 -0600)]
staging: usbip: clean up checkpatch warnings in usbipd.c

A few whitespace changes allows the file to pass checkpatch --strict
(other than ignoring the CamelCase derived from the USB standard.)

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "pVBInfo" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:30 +0000 (23:13 +0300)]
staging: xgifb: delete unused "pVBInfo" parameters

Delete unused "pVBInfo" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "RefreshRateTableIndex" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:29 +0000 (23:13 +0300)]
staging: xgifb: delete unused "RefreshRateTableIndex" parameters

Delete unused "RefreshRateTableIndex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "HwDeviceExtension" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:28 +0000 (23:13 +0300)]
staging: xgifb: delete unused "HwDeviceExtension" parameters

Delete unused "HwDeviceExtension" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "ModeIdIndex" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:27 +0000 (23:13 +0300)]
staging: xgifb: delete unused "ModeIdIndex" parameters

Delete unused "ModeIdIndex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "ModeNo" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:26 +0000 (23:13 +0300)]
staging: xgifb: delete unused "ModeNo" parameters

Delete unused "ModeNo" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: xgifb: delete unused "rateindex" parameters
Aaro Koskinen [Tue, 16 Jul 2013 20:13:25 +0000 (23:13 +0300)]
staging: xgifb: delete unused "rateindex" parameters

Delete unused "rateindex" parameters from internal functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: when dma is disabled, clear hcd->self.uses_dma
Matthijs Kooijman [Fri, 19 Jul 2013 09:34:23 +0000 (11:34 +0200)]
staging: dwc2: when dma is disabled, clear hcd->self.uses_dma

When dma is disabled inside dwc2 (because the hardware does not support
it, or the code was changed to disable it for testing), let the usb core
know about this by clearing hcd->self.uses_dma.

By default, the usb core assumes that dma is used when a dma_mask is
set, but this might not always match the dma_enable value in dwc2. To
prevent problems resulting from a mismatch, better to explicitely
disable dma in this case (though everything seemed to work with the
wrong value of uses_dma as well, probably only resulted in some unneeded
work).

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: disable dma when no dma_mask was setup
Matthijs Kooijman [Fri, 19 Jul 2013 09:34:22 +0000 (11:34 +0200)]
staging: dwc2: disable dma when no dma_mask was setup

If the platform or bus driver failed to setup a dma_mask, but the
hardware advertises support for DMA, before DMA would be enabled in
dwc2, but disabled in the usb core, making all connectivity break.

With this commit, the dwc2 driver will emit a warning and fall back to
slave mode in this case.

Note that since commit 642f2ec (staging: dwc2: Fix dma-enabled platform
devices using a default dma_mask) the platform bindings make sure a DMA
mask is always present, but having this check here anyway is probably a
good from a defensive programming standpoint (in case of changes to
platform.c or addition of new glue layers).

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: add driver parameter to set AHB config register value
Paul Zimmerman [Tue, 16 Jul 2013 19:22:12 +0000 (12:22 -0700)]
staging: dwc2: add driver parameter to set AHB config register value

The dwc2 driver sets the value of the DWC2 GAHBCFG register to 0x6,
which is GAHBCFG_HBSTLEN_INCR4. But different platforms may require
different values. In particular, the Broadcom 2835 SOC used in the
Raspberry Pi needs a value of 0x10, otherwise the DWC2 controller
stops working after a short period of heavy USB traffic.

So this patch adds another driver parameter named 'ahbcfg'. The
default value is 0x6. Any platform needing a different value should
add a DT attribute to set it.

This patch also removes the 'ahb_single' driver parameter, since
that bit can now be set using 'ahbcfg'.

This patch does not add DT support to platform.c, I will leave that
to whoever owns the first platform that needs a non-default value.
(Stephen?)

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: fix value used in dwc2_set_all_params
Julien Delacou [Thu, 11 Jul 2013 12:24:10 +0000 (14:24 +0200)]
staging: dwc2: fix value used in dwc2_set_all_params

This fix uses 'value' parameter as it should be instead
of hardcoded -1.

Signed-off-by: Julien Delacou <julien.delacou@stericsson.com>
Acked-by: Paul Zimmerman <paulz@synopys.com>
Reviewed-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: remove use of bus_to_virt()
Paul Zimmerman [Sat, 13 Jul 2013 21:53:53 +0000 (14:53 -0700)]
staging: dwc2: remove use of bus_to_virt()

Remove the use of bus_to_virt() and just fail the transfer if an
unaligned buffer with no virtual address is found. AFAIK that
can't happen anyway.

Also change setting of coherent DMA mask to the normal 32 bits.
31 bits was only needed when calling bus_to_virt() AFAICR.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: reduce noisy debug messages
Paul Zimmerman [Sat, 13 Jul 2013 21:53:52 +0000 (14:53 -0700)]
staging: dwc2: reduce noisy debug messages

Change the non-aligned buffer debug messages to dev_vdbg(). Also
remove some duplicated debug output when the driver is loaded.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: fix dwc2_hcd_qtd_add()
Paul Zimmerman [Sat, 13 Jul 2013 21:53:51 +0000 (14:53 -0700)]
staging: dwc2: fix dwc2_hcd_qtd_add()

The logic in dwc2_hcd_qtd_add() was a bit messy, and one of the
error exit paths was broken. Fix it up.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: optimize dwc2_hc_handle_tt_clear() a bit
Paul Zimmerman [Sat, 13 Jul 2013 21:53:50 +0000 (14:53 -0700)]
staging: dwc2: optimize dwc2_hc_handle_tt_clear() a bit

Make dwc2_hc_handle_tt_clear() return early if the device is
hi-speed.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: add calls to usb_hcd_link_urb_to_ep() and friends
Paul Zimmerman [Sat, 13 Jul 2013 21:53:49 +0000 (14:53 -0700)]
staging: dwc2: add calls to usb_hcd_link_urb_to_ep() and friends

The driver was lacking calls to usb_hcd_link_urb_to_ep(),
usb_hcd_unlink_urb_from_ep(), and usb_hcd_check_unlink_urb(). Add
those now.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: refactor dwc2_host_complete()
Paul Zimmerman [Sat, 13 Jul 2013 21:53:48 +0000 (14:53 -0700)]
staging: dwc2: refactor dwc2_host_complete()

The parameters to dwc2_host_complete() didn't make much sense.
The 'context' parameter always came from the ->priv member of the
'dwc2_urb' parameter, and both of those always came from a struct
dwc2_qtd. So just pass in the struct dwc2_qtd instead.

This also allows us to null out the dwc2_qtd->urb member after it
is freed, which the calling code forgot to do in several places,
causing random driver crashes from dereferencing the freed pointer.

This also requires the calls to dwc2_hc_handle_tt_clear() to be
moved before the calls to dwc2_host_complete(), otherwise that
routine would do nothing because dwc2_qtd->urb has already been
freed.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: zsmalloc: access page->private by using page_private macro
Sunghan Suh [Fri, 12 Jul 2013 07:08:13 +0000 (16:08 +0900)]
staging: zsmalloc: access page->private by using page_private macro

Signed-off-by: Sunghan Suh <sunghan.suh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8712: return MAC in standard form
Andy Shevchenko [Wed, 10 Jul 2013 14:27:21 +0000 (17:27 +0300)]
staging: rtl8712: return MAC in standard form

MAC respresentation should follow standard form.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: imx-drm: Fix typo in staging/imx-drm
Masanari Iida [Tue, 23 Jul 2013 16:05:07 +0000 (01:05 +0900)]
staging: imx-drm: Fix typo in staging/imx-drm

Correct spelling typo in staging/imx-drm

Singed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: bcm: Qos: Fix some coding style issues
Lilis Iskandar [Tue, 23 Jul 2013 11:51:02 +0000 (19:51 +0800)]
Staging: bcm: Qos: Fix some coding style issues

Fixed spacing/tabs issues that were found using checkpatch.

Signed-off-by: Lilis Iskandar <veeableful@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: remove unused macros r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:46 +0000 (04:21 +0300)]
staging: rtl8192u: remove unused macros r819xU_cmdpkt.c

This patch removes CMPK_DEBOUNCE_CNT and CMPK_PRINT()
because they are not used anywhere in the driver.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: fix line size and identation in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:45 +0000 (04:21 +0300)]
staging: rtl8192u: fix line size and identation in r819xU_cmdpkt.c

This patch limits the line size below 80 characters, when
possible, and fixes identation to meet kernel coding style
convetions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: remove unnecessary line continuations in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:44 +0000 (04:21 +0300)]
staging: rtl8192u: remove unnecessary line continuations in r819xU_cmdpkt.c

This patch fixes the following checkpatch warning:
WARNING: Avoid unnecessary line continuations

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: fix comments in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:43 +0000 (04:21 +0300)]
staging: rtl8192u: fix comments in r819xU_cmdpkt.c

This patches fixes comments by:
- replacing // comments with /**/ comments
- removing unnecessary comments (trailing comments
  with the function name, comments stating date/author
  when they are placed inside the function definition)
- fixing internal alignment

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: fix whitespace in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:42 +0000 (04:21 +0300)]
staging: rtl8192u: fix whitespace in r819xU_cmdpkt.c

This patch fixes whitespaces in r819xU_cmdpkt.c to
follow the kernel coding style and to improve code
readability.

It fixes the spaces around <,=||&&();} and adds or
removes tabs to better align variables.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: fix braces in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:41 +0000 (04:21 +0300)]
staging: rtl8192u: fix braces in r819xU_cmdpkt.c

This patch fixes the brace position according to the
linux kernel coding style and removes unnecessary braces.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8192u: remove commented-out code in r819xU_cmdpkt.c
Xenia Ragiadakou [Wed, 26 Jun 2013 01:21:40 +0000 (04:21 +0300)]
staging: rtl8192u: remove commented-out code in r819xU_cmdpkt.c

This patch removes commented-out code and the comments
that refer to it to facilitate code review.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: silicom: Remove useless unneeded semicolons
Vladimir [Fri, 12 Jul 2013 06:58:26 +0000 (09:58 +0300)]
Staging: silicom: Remove useless unneeded semicolons

Found using coccinelle tool.
Signed-off-by: Vladimir Cernov <gg.kaspersky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: silicom: remove typedef for dev_desc_t
Chad Williamson [Tue, 25 Jun 2013 23:59:24 +0000 (18:59 -0500)]
Staging: silicom: remove typedef for dev_desc_t

Remove the dev_desc_t typedef for the dev_desc struct in bpctl_mod.c,
resolving a checkpatch.pl warning. In fact, we can use an anonymous
struct, since it's only used in the single dev_desc array of device
descriptions, whose definition follows immediately.

Signed-off-by: Chad Williamson <chad@dahc.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: silicom: remove the typedef for bpmod_info_t
Chad Williamson [Tue, 25 Jun 2013 23:59:23 +0000 (18:59 -0500)]
Staging: silicom: remove the typedef for bpmod_info_t

Remove the bpmod_info_t typedef from bpctl_mod.c, replacing it with
struct bpmod_info.

Signed-off-by: Chad Williamson <chad@dahc.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: silicom: remove the bpctl_dev_t typdef
Chad Williamson [Tue, 25 Jun 2013 23:59:22 +0000 (18:59 -0500)]
Staging: silicom: remove the bpctl_dev_t typdef

Replace the bpctl_dev_t typdef in bpctl_mod.c with struct bpctl_dev
for coding style compliance.

Signed-off-by: Chad Williamson <chad@dahc.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: fix binder interface for 64bit compat layer
Serban Constantinescu [Thu, 4 Jul 2013 09:54:48 +0000 (10:54 +0100)]
staging: android: binder: fix binder interface for 64bit compat layer

The changes in this patch will fix the binder interface for use on 64bit
machines and stand as the base of the 64bit compat support. The changes
apply to the structures that are passed between the kernel and
userspace.

Most of the  changes applied mirror the change to struct binder_version
where there is no need for a 64bit wide protocol_version(on 64bit
machines). The change inlines with the existing 32bit userspace(the
structure has the same size) and simplifies the compat layer such that
the same handler can service the BINDER_VERSION ioctl.

Other changes make use of kernel types as well as user-exportable ones
and fix format specifier issues.

The changes do not affect existing 32bit ABI.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: replace types with portable ones
Serban Constantinescu [Thu, 4 Jul 2013 09:54:47 +0000 (10:54 +0100)]
staging: android: binder: replace types with portable ones

Since this driver is meant to be used on different types of processors
and a portable driver should specify the size a variable expects to be
this patch changes the types used throughout the binder interface.

We use "userspace" types since this header will be exported and used by
the Android filesystem.

The patch does not change in any way the functionality of the binder driver.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: fix alignment issues
Serban Constantinescu [Thu, 4 Jul 2013 09:54:46 +0000 (10:54 +0100)]
staging: android: binder: fix alignment issues

The Android userspace aligns the data written to the binder buffers to
4bytes. Thus for 32bit platforms or 64bit platforms running an 32bit
Android userspace we can have a buffer looking like this:

platform    buffer(binder_cmd   pointer)      size
32/32                 32b         32b          8B
64/32                 32b         64b          12B
64/64                 32b         64b          12B

Thus the kernel needs to check that the buffer size is aligned to 4bytes
not to (void *) that will be 8bytes on 64bit machines.

The change does not affect existing 32bit ABI.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: fix BC_FREE_BUFFER ioctl declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:45 +0000 (10:54 +0100)]
staging: android: binder: fix BC_FREE_BUFFER ioctl declaration

BinderDriverCommands mirror the ioctl usage. Thus the size of the
structure passed through the interface should be used to generate the
ioctl No.

The change reflects the type being passed from the user space-a pointer
to a binder_buffer. This change should not affect the existing 32bit
user space since BC_FREE_BUFFER is computed as:

   #define _IOW(type,nr,size)         \
      ((type) << _IOC_TYPESHIFT) |    \
      ((nr)   << _IOC_NRSHIFT) |      \
      ((size) << _IOC_SIZESHIFT))

and for a 32bit compiler BC_FREE_BUFFER will have the same computed
value. This change will also ease our work in differentiating
BC_FREE_BUFFER from COMPAT_BC_FREE_BUFFER.

The change does not affect existing 32bit ABI.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: fix BINDER_SET_MAX_THREADS declaration
Serban Constantinescu [Thu, 4 Jul 2013 09:54:44 +0000 (10:54 +0100)]
staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

This change will fix the BINDER_SET_MAX_THREADS ioctl to use __u32
instead of size_t for setting the max threads. Thus using the same
handler for 32 and 64bit kernels.

This value is stored internally in struct binder_proc and set to 15
on open_binder() in the libbinder API(thus no need for a 64bit size_t
on 64bit platforms).

The change does not affect existing 32bit ABI.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: android: binder: modify struct binder_write_read to use size_t
Serban Constantinescu [Thu, 4 Jul 2013 09:54:43 +0000 (10:54 +0100)]
staging: android: binder: modify struct binder_write_read to use size_t

This change mirrors the userspace operation where struct binder_write_read
members that specify the buffer size and consumed size are size_t elements.

The patch also fixes the binder_thread_write() and binder_thread_read()
functions prototypes to conform with the definition of binder_write_read.

The changes do not affect existing 32bit ABI.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Rename Kbuild to Makefile
Joe Perches [Tue, 23 Jul 2013 12:45:03 +0000 (13:45 +0100)]
staging: ozwpan: Rename Kbuild to Makefile

Rename Kbuild to usual Makefile, consistent with
Kernel build structure.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Convert macro to function.
Joe Perches [Tue, 23 Jul 2013 12:45:02 +0000 (13:45 +0100)]
staging: ozwpan: Convert macro to function.

Replace macro with inline function.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Remove old debug macro.
Joe Perches [Tue, 23 Jul 2013 12:45:01 +0000 (13:45 +0100)]
staging: ozwpan: Remove old debug macro.

Remove old oz_trace & oz_trace2 macro & related header files.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Replace oz_trace with oz_dbg
Joe Perches [Tue, 23 Jul 2013 12:45:00 +0000 (13:45 +0100)]
staging: ozwpan: Replace oz_trace with oz_dbg

Introduce new debug macros: oz_dbg, oz_cdev_dbg, oz_pd_dbg
and then replace old oz_trace & oz_trace2 with new macro.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Remove extra debug logs.
Joe Perches [Tue, 23 Jul 2013 12:44:59 +0000 (13:44 +0100)]
staging: ozwpan: Remove extra debug logs.

Remove unnecessary debug logs. Most of these logs
print function name at the start of function, which
are not really required.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: COMEDI_NI_LABPC_ISA no longer depends on VIRT_TO_BUS
Ian Abbott [Fri, 28 Jun 2013 16:09:28 +0000 (17:09 +0100)]
staging: comedi: COMEDI_NI_LABPC_ISA no longer depends on VIRT_TO_BUS

After migrating ISA DMA support from the "ni_labpc" module to the new
"ni_labpc_isadma" module, the `COMEDI_NI_LABPC_ISA` configuration option
no longer depends on `VIRT_TO_BUS`, so remove the dependency.

(The new `COMEDI_NI_LABPC_ISADMA` option does depend on `VIRT_TO_BUS`
but is not configured manually and is only selected automatically if the
`VIRT_TO_BUS` and `ISA_DMA_API` options are set.)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: tidy up after DMA code migration
Ian Abbott [Fri, 28 Jun 2013 16:09:27 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: tidy up after DMA code migration

After migrating the ISA DMA handling code to the "ni_labpc_isadma"
module, get rid of an unneeded `#include` and a couple of unused
static variables.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: migrate DMA status handling
Ian Abbott [Fri, 28 Jun 2013 16:09:26 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: migrate DMA status handling

Migrate the code for checking and handling the interrupt status handling
for ISA DMA transfers into new a new function
`labpc_handle_dma_status()` in the "ni_labpc_isadma" module.  Provide a
dummy inline function in "ni_labpc_isadma.h" if the "ni_labpc_isadma"
module is not being built.

The static function `handle_isa_dma()` also needs to move across to the
new module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: migrate labpc_drain_dma()
Ian Abbott [Fri, 28 Jun 2013 16:09:25 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: migrate labpc_drain_dma()

Move `labpc_drain_dma()` into the "ni_labpc_isadma" module.  Provide a
dummy inline function in "ni_labpc_isadma.h" if the module is not being
built.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: migrate DMA transfer set-up
Ian Abbott [Fri, 28 Jun 2013 16:09:24 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: migrate DMA transfer set-up

Migrate the code for setting up an ISA DMA transfer into a new function
`labpc_setup_dma()` in the "ni_labpc_isadma" module.  Provide a dummy
inline function in "ni_labpc_isadma.h" if the "ni_labpc_isadma" module
is not being built.

The static function `labpc_suggest_transfer_size()` also needs to move
across to the new module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: move register defs to new file
Ian Abbott [Fri, 28 Jun 2013 16:09:23 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: move register defs to new file

The new "ni_labpc_isadma" module will need to access some register
definitions from "ni_labpc.c", which is not part of the module's source.
Move all the register definitions into a new, common header file
"ni_labpc_regs.h".

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: use labpc_have_dma_chan()
Ian Abbott [Fri, 28 Jun 2013 16:09:22 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: use labpc_have_dma_chan()

Call the new static inline function `labpc_have_dma_chan()` from
`labpc_ai_cmd()` to check if the ISA DMA channel has been initialized,
tidying up the surrounding code and removing an `#ifdef`.  If the
"ni_labpc_isadma" module is not being built, `labpc_have_dma_chan()`
doesn't bother checking the DMA channel and just returns `false`,
allowing the compiler to optimize out a small amount of code.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_isadma: add labpc_have_dma_chan()
Ian Abbott [Fri, 28 Jun 2013 16:09:21 +0000 (17:09 +0100)]
staging: comedi: ni_labpc_isadma: add labpc_have_dma_chan()

Add a static inline function to "ni_labpc_isadma.h" to test if a DMA
channel has been set-up, in which case `devpriv->dma_chan` will be
non-zero (where `devpriv` point to the private data for the comedi
device).  If the "ni_labpc_isadma" module is not being built, don't
bother checking `devpriv->dma_chan`; just return `false` as this may
help the compiler to optimize out some unreachable code.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: migrate DMA channel init & free
Ian Abbott [Fri, 28 Jun 2013 16:09:20 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: migrate DMA channel init & free

Migrate the code for requesting an ISA DMA channel and a DMA buffer, and
the code for freeing them into two new functions in the
"ni_labpc_isadma" module: `labpc_init_dma_chan()` and
`labpc_free_dma_chan()`.  Dummy inline functions are provided in
"ni_labpc_isadma.h" if the "ni_labpc_isadma" module is not being built.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc_isadma: new module for ISA DMA support
Ian Abbott [Fri, 28 Jun 2013 16:09:19 +0000 (17:09 +0100)]
staging: comedi: ni_labpc_isadma: new module for ISA DMA support

It's just an empty module at the moment, selected by COMEDI_NI_LABPC_ISA
&& ISA_DMA_API && VIRT_TO_BUS, but will be populated by later patches to
migrate ISA DMA support for NI Lab-PC cards out of the "ni_labpc"
module.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: don't clear cmd3 bits explicitly in labpc_ai_cmd()
Ian Abbott [Fri, 28 Jun 2013 16:09:18 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: don't clear cmd3 bits explicitly in labpc_ai_cmd()

`labpc_ai_cmd()` calls `labpc_cancel()` which already sets
`devpriv->cmd3` to 0.  Remove the lines from `labpc_ai_cmd()` that clear
specific bits in `devpriv->cmd3` explicitly as they have no effect.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_labpc: fix possible double-free of dma_buffer
Ian Abbott [Fri, 28 Jun 2013 16:09:17 +0000 (17:09 +0100)]
staging: comedi: ni_labpc: fix possible double-free of dma_buffer

If `labpc_attach()` allocates memory for `devpriv->dma_buffer` but fails
to request a DMA channel, it frees `devpriv->dma_buffer` but leaves the
pointer set.  Later, `labpc_detach()` frees `devpriv->dma_buffer` again,
which means it has been freed twice in this case.

Fix it by only setting `devpriv->dma_buffer` in `labpc_attach()` if the
DMA channel was requested successfully.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: use a mutex when accessing driver list
Ian Abbott [Thu, 27 Jun 2013 13:50:58 +0000 (14:50 +0100)]
staging: comedi: use a mutex when accessing driver list

Low-level comedi drivers registered with the comedi core by
`comedi_driver_register()` are linked together into a simple linked list
headed by the `comedi_drivers` variable and chained by the `next` member
of `struct comedi_driver`.  A driver is removed from the list by
`comedi_driver_unregister()`.  The driver list is iterated through by
`comedi_device_attach()` when the `COMEDI_DEVCONFIG` ioctl is used to
attach a "legacy" device to a driver, and is also iterated through by
`comedi_read()` in "proc.c" when reading "/proc/comedi".

There is currently no protection against items being added or removed
from the list while it is being iterated.  Add a mutex
`comedi_drivers_list_lock` to be locked while adding or removing an item
on the list, or when iterating through the list.

`comedi_driver_unregister()` also checks for and detaches any devices
using the driver.  This is currently done before unlinking the driver
from the list, but it makes more sense to unlink the driver from the
list first to prevent `comedi_device_attach()` attempting to use it, so
move the unlinking part to the start of the function.  Also, in
`comedi_device_attach()` hold on to the mutex until we've finished
attempting to attach the device to avoid it interfering with the
detachment in `comedi_driver_unregister()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: return void from comedi_driver_unregister()
Ian Abbott [Thu, 27 Jun 2013 13:50:57 +0000 (14:50 +0100)]
staging: comedi: return void from comedi_driver_unregister()

'Unregister' functions generally return `void`.
`comedi_driver_unregister()` currently returns an `int` errno value.
Nothing looks at the return value.  Change the return type to `void`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: pcl724: add support for the PCM-IO48 PC/104 board
H Hartley Sweeten [Tue, 25 Jun 2013 00:09:20 +0000 (17:09 -0700)]
staging: comedi: pcl724: add support for the PCM-IO48 PC/104 board

This driver can support the WinSystems PCM-IO48 PC/104 board. That
board has two 8255 devices providing 48 digital I/O channels.

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>
11 years agostaging: comedi: ii_pci20kc: this is an ISA board not a PCI board
H Hartley Sweeten [Tue, 25 Jun 2013 00:07:28 +0000 (17:07 -0700)]
staging: comedi: ii_pci20kc: this is an ISA board not a PCI board

The Intelligent Instrumentation PCI-20001C board is a legacy PC/XT/AT
8-bit ISA board not a PCI board.  The "PCI" appears to mean "Personal
Computer Instrumentation".

Move the Kconfig option into the COMEDI_ISA group.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: do not include <linux/delay.h> if its not needed
H Hartley Sweeten [Tue, 25 Jun 2013 00:05:31 +0000 (17:05 -0700)]
staging: comedi: do not include <linux/delay.h> if its not needed

Some of the comedi files include this header but don't 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>
11 years agostaging: comedi: drivers do not need <linux/ioport.h>
H Hartley Sweeten [Tue, 25 Jun 2013 00:05:07 +0000 (17:05 -0700)]
staging: comedi: drivers do not need <linux/ioport.h>

All the ioport resources are managed by the comedi core. None of
the drivers depend on <linux/ioport.h>. Remove the includes.

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>
11 years agostaging: comedi: don't rely on comedidev.h to include headers
H Hartley Sweeten [Tue, 25 Jun 2013 00:04:43 +0000 (17:04 -0700)]
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>
11 years agostaging: comedi: use comedi_alloc_devpriv()
H Hartley Sweeten [Mon, 24 Jun 2013 23:55:44 +0000 (16:55 -0700)]
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>
11 years agostaging: comedi: drivers: introduce comedi_alloc_devpriv()
H Hartley Sweeten [Mon, 24 Jun 2013 23:55:14 +0000 (16:55 -0700)]
staging: comedi: drivers: introduce comedi_alloc_devpriv()

Introduce a helper function to allocate memory and set the
comedi_device private data pointer.

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>
11 years agostaging: lustre: remove unused "helper" macros
Greg Kroah-Hartman [Tue, 23 Jul 2013 21:02:13 +0000 (14:02 -0700)]
staging: lustre: remove unused "helper" macros

This removes a bunch of unused helper macros in the kp30.h file as they
were not being used anywhere, and they better not be used in the future.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: use ERR_CAST() function
Laurent Navet [Fri, 5 Jul 2013 12:26:33 +0000 (14:26 +0200)]
staging: lustre: use ERR_CAST() function

use ERR_CAST() function instead of ERR_PTR() and PTR_ERR()
found using coccinelle and err_cast.cocci

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Fix typo in printk
Masanari Iida [Sat, 20 Jul 2013 18:38:08 +0000 (03:38 +0900)]
staging: lustre: Fix typo in printk

Correct spelling typo in printk within staging/lustre

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>