]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agostaging: dwc2: interpret all hwcfg and related register at init time
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:21 +0000 (18:45 +0200)]
staging: dwc2: interpret all hwcfg and related register at init time

Before, the hwcfg registers were read at device init time, but
interpreted at various parts in the code. This commit unpacks the hwcfg
register values into a struct with properly labeled variables at init
time, which makes all the other code using these values more consise and
easier to read. Some values that were previously stored in the hsotg
struct are now moved into this new struct as well.

In addition to the hwcfg registers, the contents of some fifo size
registers are also unpacked. The hwcfg registers are read-only, so they
can be safely stored. The fifo size registers are read-write registers,
but their power-on values are significant: they give the maximum depth
of the fifo they describe.

This commit mostly moves code, but also attempts to simplify some
expressions from (val >> shift) & (mask >> shift) to
(val & mask) >> shift.

Finally, all of the parameters read from the hardware are debug printed
after unpacking them, so a bunch of debug prints can be removed from
other places.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: properly mask the GRXFSIZ register
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:20 +0000 (18:45 +0200)]
staging: dwc2: properly mask the GRXFSIZ register

Bits 16-31 are reserved, so the old code just reads the whole register to
get bits 0-15, assuming the reserved bits would be 0 (which seems true
on current hardware, but who knows...).

This commit properly masks out the reserved bits when reading and
doesn't touch the reserved bits while writing.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: remove redundant register reads
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:19 +0000 (18:45 +0200)]
staging: dwc2: remove redundant register reads

For calculating FIFO offsets, the sizes of preceding fifos need to be
known. For filling the GDFIFOCFG register, these fifo sizes were read
from hardware registers. However, these values were written to these
registers just a few lines before, so we can just use the values written
instead.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: re-use hptxfsiz variable
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:18 +0000 (18:45 +0200)]
staging: dwc2: re-use hptxfsiz variable

For some reason, the value of the HPTXFSIZ register was built in the
ptxfsiz variable, while there was also a hptxfsiz variable availble.
Better just use that and remove the (now unused) ptxfsiz variable.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: simplify debug output in dwc_hc_init
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:17 +0000 (18:45 +0200)]
staging: dwc2: simplify debug output in dwc_hc_init

The value of the hcchar register is built from individual values by
shifting and masking. Before, the debug output extracted the individual
values out of the complete hcchar register again by doing the reverse.
This commit makes the debug output use the original values instead.

One debug message got removed, since it would always print a fixed value
of zero.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: add missing shift
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:16 +0000 (18:45 +0200)]
staging: dwc2: add missing shift

This line extracted the available queue space without properly shifting
it. Since the code only cared wether it was zero or not, it worked as
expected without the shift, but adding shift makes the code cleaner.

While we're here, store the result in a helper variable that was already
declared to increase readability a bit more.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: simplify register shift expressions
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:15 +0000 (18:45 +0200)]
staging: dwc2: simplify register shift expressions

This commit changes expressions from (val >> shift) & (mask >> shift) to
(val & mask) >> shift.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: only read the snpsid register once
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:14 +0000 (18:45 +0200)]
staging: dwc2: only read the snpsid register once

This (read-only) register was read twice, storing it for later use the
second time. Now it is only read once, storing it right away.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: unshift non-bool register value constants
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:13 +0000 (18:45 +0200)]
staging: dwc2: unshift non-bool register value constants

Various register fields wider than one bit have constants defined for
their value. Previously, these registers would define the values as they
appear in the register, so shifted to the right to the position the
value appears in the register.

This commit changes those constants to their natural values (e.g, 0, 1,
2, etc.), as they are after shifting the register value to the right.
This also changes all relevant code to shift the values before comparing
them with constants.

This has the advantage that the values can be stored in smaller
variables (now they always require a u32) and makes the handling of
these values more consistent with other register fields that represent
natural numbers instead of enumerations (e.g., number of host channels).

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: fix off-by-one in check for max_packet_count parameter
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:12 +0000 (18:45 +0200)]
staging: dwc2: fix off-by-one in check for max_packet_count parameter

Previously, the max_packet_count could be set to 1 << x, where x is the
number of bits available (width + 4 in the code). Since 1 << x requires
x + 1 bits to represent, this will not work. The real maximum value is
(1 << x) - 1. This value is already used the default when the set value
is invalid, but the upper limit for the set value was off-by-one.

This change makes the check the same as the one for max_transfer_size,
which was already correct.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dwc2: remove specific fifo size constants
Matthijs Kooijman [Fri, 30 Aug 2013 16:45:11 +0000 (18:45 +0200)]
staging: dwc2: remove specific fifo size constants

A generic set of FIFOSIZE_* constants is defined which applies to all
fifo size and offset registers. It is already used for both the
GNPTXFSIZ and HPTXFSIZ registers, but it applies to DPTXFSIZN as well.
Some of these also had specific constants defined. This patch removes
the specific constants and documents to use the generic constants.

Note that the removed constants weren't actually used. Instead, most of
the related code uses hardcoded masks and shifts. But given that
subsequent patches will be moving that code around and introducing the
constants in the process, this patch leaves those untouched.

Also note that the GRXFSIZ register also contains a fifo size, but
there is no corresponding start address register (it is always the first
fifo in memory), the layout of the GRXFSIZ register is different and
cannot use the same constants.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging:BCM:DDRInit.c:Renaming __FUNCTION__
Paul McQuade [Thu, 15 Aug 2013 19:00:50 +0000 (20:00 +0100)]
Staging:BCM:DDRInit.c:Renaming __FUNCTION__

__Function__ gets renamed with __func__

Signed-Off-By: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: bcm: remove Version.h file.
navin patidar [Fri, 30 Aug 2013 07:01:51 +0000 (12:31 +0530)]
staging: bcm: remove Version.h file.

many of the macros defined in Version.h are not being used,
so we can remove the file.

Signed-off-by: navin patidar <navinp@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: off by one in rtw_set_802_11_add_wep()
Dan Carpenter [Thu, 29 Aug 2013 21:45:42 +0000 (00:45 +0300)]
staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()

"keyid" is used as an offset into the ->dot11DefKey[] array.  The array
has 4 elements.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: r8188eu: copying one byte too much
Dan Carpenter [Thu, 29 Aug 2013 21:47:01 +0000 (00:47 +0300)]
staging: r8188eu: copying one byte too much

There is a copy and paste bug here so we copy 4 bytes instead of 3.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: || vs && typo
Dan Carpenter [Thu, 29 Aug 2013 21:46:14 +0000 (00:46 +0300)]
staging: rtl8188eu: || vs && typo

Obviously it's impossible for ->KeyLength to be both 5 and 13.  I assume
that && was intended here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: r8188eu: off by one bugs
Dan Carpenter [Thu, 29 Aug 2013 21:45:06 +0000 (00:45 +0300)]
staging: r8188eu: off by one bugs

These should be "<" instead of "<=".  Also we can use the ARRAY_SIZE()
macro.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: crystalhd: Resolve sparse 'different base types' warnings.
Shaun Laing [Thu, 29 Aug 2013 14:27:22 +0000 (08:27 -0600)]
staging: crystalhd: Resolve sparse 'different base types' warnings.

The result from crystalhd_get_sgle_paddr and crystalhd_get_sgle_len are later
used in calculations, so the result should be in CPU byte ordering.

Signed-off-by: Shaun Laing <shaun@xresource.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: r8188eu: Fix compiler warnings in os_dep/ioctl_linux.c
Larry Finger [Thu, 29 Aug 2013 02:12:25 +0000 (21:12 -0500)]
staging: r8188eu: Fix compiler warnings in os_dep/ioctl_linux.c

The 0-DAY kernel build testing backend reports the following compiler
warnings not shown on my compiler version/options:

   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_mp_efuse_get':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5836:65: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
                                                                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5830:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6042:69: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s %02X", extra, pEfuseHal->fakeEfuseModifiedMap[i+j]);
                                                                        ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6036:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^

The problem is due to improper settings for some of the EFUSE_XXX defines such that
EFUSE_MAP_SIZE was larger than the sizes of the marked arrays. Thanks to
Fengguang Wu for helping me understand the root cause.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgap: Add missing #include <linux/slab.h>
Geert Uytterhoeven [Thu, 29 Aug 2013 20:53:25 +0000 (22:53 +0200)]
staging: dgap: Add missing #include <linux/slab.h>

drivers/staging/dgap/dgap_driver.c: In function ‘dgap_cleanup_module’:
drivers/staging/dgap/dgap_driver.c:423: error: implicit declaration of function ‘kfree’
drivers/staging/dgap/dgap_driver.c: In function ‘dgap_driver_kzmalloc’:
drivers/staging/dgap/dgap_driver.c:940: error: implicit declaration of function ‘kmalloc’
drivers/staging/dgap/dgap_driver.c:940: warning: initialization makes pointer from integer without a cast

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: adds TODO
Lidza Louina [Thu, 29 Aug 2013 23:00:37 +0000 (19:00 -0400)]
staging: dgnc: adds TODO

This patchs adds a TODO for the driver.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoMerge tag 'iio-for-3.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Thu, 29 Aug 2013 21:33:17 +0000 (14:33 -0700)]
Merge tag 'iio-for-3.12c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new drivers, cleanups and features for IIO in the 3.12 cycle.

New drivers

1) Bosh BMA180 accelerometer + a new sysfs abi element, power_mode to
   allow for device that trade off accuracy and power usage.

Cleanups

1) Another lot of devm_iio_device_alloc patches
2) An code ordering bug in the twl6030 driver introduced earlier in this
   cycle.

New features

1) at91 adc driver rework to support a wider range of parts and drop
   the necessity for some of the current device tree elements.  This is
   a precursor to introducing input support which is still under review.

11 years agoiio: at91: Use different prescal, startup mask in MR for different IP
Josh Wu [Tue, 27 Aug 2013 11:28:00 +0000 (12:28 +0100)]
iio: at91: Use different prescal, startup mask in MR for different IP

For at91 boards, there are different IPs for adc. Different IPs has different
STARTUP & PRESCAL mask in ADC_MR.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: at91: introduce the multiple compatible string for different IPs.
Josh Wu [Tue, 27 Aug 2013 11:28:00 +0000 (12:28 +0100)]
iio: at91: introduce the multiple compatible string for different IPs.

As use the multiple compatible string, we can remove hardware register in dt.

CC: devicetree@vger.kernel.org
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: vt6656: device.h Replace typedef struct _RCB
Malcolm Priestley [Wed, 28 Aug 2013 20:12:35 +0000 (21:12 +0100)]
staging: vt6656: device.h Replace typedef struct _RCB

Replace with struct vnt_rcb

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoStaging: crystalhd: fixed whitespace and string style issues
Robert Foss [Wed, 28 Aug 2013 18:51:47 +0000 (20:51 +0200)]
Staging: crystalhd: fixed whitespace and string style issues

Fixed 3 instances of user-visible string being broken into two string.
Fixed 2 instances of illegal whitespace.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: baseband.h re: baseband.c:877:26: sparse: incorrect type in assignme...
Malcolm Priestley [Wed, 28 Aug 2013 19:52:23 +0000 (20:52 +0100)]
staging: vt6656: baseband.h re: baseband.c:877:26: sparse: incorrect type in assignment (different base types)

sparse warnings: (new ones prefixed by >>)
...
>> drivers/staging/vt6656/baseband.c:877:26: sparse: incorrect type in assignment (different base types)
   drivers/staging/vt6656/baseband.c:877:26:    expected unsigned short [unsigned] [usertype] len
   drivers/staging/vt6656/baseband.c:877:26:    got restricted __le16 [usertype] <noident>
>> drivers/staging/vt6656/baseband.c:880:26: sparse: incorrect type in assignment (different base types)
   drivers/staging/vt6656/baseband.c:880:26:    expected unsigned short [unsigned] [usertype] len
   drivers/staging/vt6656/baseband.c:880:26:    got restricted __le16 [usertype] <noident>

vnt_phy_field member len should be __le16.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Return error, if PD is not connected.
Rupesh Gujare [Wed, 28 Aug 2013 11:43:16 +0000 (12:43 +0100)]
staging: ozwpan: Return error, if PD is not connected.

Return error if we receive write(), while PD is not connected.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Change error number.
Rupesh Gujare [Wed, 28 Aug 2013 11:43:15 +0000 (12:43 +0100)]
staging: ozwpan: Change error number.

Incorrect error number was returned here (EPERM), ENXIO is more
appropriate.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Increase ISOC IN buffer depth
Rupesh Gujare [Wed, 28 Aug 2013 11:43:14 +0000 (12:43 +0100)]
staging: ozwpan: Increase ISOC IN buffer depth

Buffer depth of 50 units is not sufficient when there is considerable delay
occuring on air due to interference, increase ISOC IN buffer depth to 100 units.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: Remove duplicate header inclusion in ioctl_linux.c
Sachin Kamat [Wed, 28 Aug 2013 05:55:02 +0000 (11:25 +0530)]
staging: rtl8188eu: Remove duplicate header inclusion in ioctl_linux.c

Removed the header files included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: Remove duplicate incusion in drv_types.h
Sachin Kamat [Wed, 28 Aug 2013 05:55:01 +0000 (11:25 +0530)]
staging: rtl8188eu: Remove duplicate incusion in drv_types.h

wlan_bssdef.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: Include version.h in usb_ops.h
Sachin Kamat [Wed, 28 Aug 2013 05:35:20 +0000 (11:05 +0530)]
staging: rtl8188eu: Include version.h in usb_ops.h

Include version.h header file as detected by versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: Include version.h header in xmit_linux.c
Sachin Kamat [Wed, 28 Aug 2013 05:35:21 +0000 (11:05 +0530)]
staging: rtl8188eu: Include version.h header in xmit_linux.c

Include version.h header file as detected by versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: rtl8188eu: Remove version.h inclusion in osdep_service.h
Sachin Kamat [Wed, 28 Aug 2013 05:35:19 +0000 (11:05 +0530)]
staging: rtl8188eu: Remove version.h inclusion in osdep_service.h

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

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgap: Remove version.h header inclusion in dgap_trace.c
Sachin Kamat [Wed, 28 Aug 2013 05:05:49 +0000 (10:35 +0530)]
staging: dgap: Remove version.h header inclusion in dgap_trace.c

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

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgap: Remove version.h header inclusion in dgap_sysfs.c
Sachin Kamat [Wed, 28 Aug 2013 05:05:48 +0000 (10:35 +0530)]
staging: dgap: Remove version.h header inclusion in dgap_sysfs.c

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

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgap: Remove version.h header inclusion in dgap_parse.c
Sachin Kamat [Wed, 28 Aug 2013 05:05:47 +0000 (10:35 +0530)]
staging: dgap: Remove version.h header inclusion in dgap_parse.c

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

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agoiio: adc: twl6030-gpadc: fix error return code in twl6030_gpadc_read_raw()
Wei Yongjun [Fri, 23 Aug 2013 02:47:00 +0000 (03:47 +0100)]
iio: adc: twl6030-gpadc: fix error return code in twl6030_gpadc_read_raw()

Fix to return -EINTR in the error handling case instead
of 0 (ret is assigned after goto, which has no effect),
as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: ad7746: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 19:24:00 +0000 (20:24 +0100)]
staging: iio: ad7746: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: ad7152: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 19:24:00 +0000 (20:24 +0100)]
staging: iio: ad7152: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: ad7150: Use devm_* APIs
Sachin Kamat [Sat, 24 Aug 2013 19:24:00 +0000 (20:24 +0100)]
staging: iio: ad7150: Use devm_* APIs

devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: sca3000: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: sca3000: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: lis3l02dq: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: lis3l02dq: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16240: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16240: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16220: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16220: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16209: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16209: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16204: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16204: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16203: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16203: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: adis16201: Use devm_iio_device_alloc
Sachin Kamat [Sat, 24 Aug 2013 18:48:00 +0000 (19:48 +0100)]
staging: iio: adis16201: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: add Bosch BMA180 acceleration sensor driver
Oleksandr Kravchenko [Wed, 28 Aug 2013 11:01:00 +0000 (12:01 +0100)]
iio: add Bosch BMA180 acceleration sensor driver

This patch adds IIO driver for Bosch BMA180 triaxial
acceleration sensor.
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/
Sensors/Accelerometers/BST-BMA180-DS000-07_2.pdf

Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: iio: Documentation sysfs-bus-iio add power_mode
Oleksandr Kravchenko [Wed, 28 Aug 2013 11:01:00 +0000 (12:01 +0100)]
staging: iio: Documentation sysfs-bus-iio add power_mode

Add description about in_accelX_power_mode and
in_accel_power_mode_available.

Signed-off-by: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: gdm724x: Remove version.h header inclusion in netlink_k.c
Sachin Kamat [Wed, 28 Aug 2013 05:23:49 +0000 (10:53 +0530)]
staging: gdm724x: Remove version.h header inclusion in netlink_k.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: Update e-mail address for Andrea Merello
Andrea Merello [Mon, 26 Aug 2013 11:53:30 +0000 (13:53 +0200)]
staging: Update e-mail address for Andrea Merello

A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: driver.c and .h: removes dgnc_driver_kzmalloc func
Lidza Louina [Wed, 28 Aug 2013 02:13:28 +0000 (22:13 -0400)]
staging: dgnc: driver.c and .h: removes dgnc_driver_kzmalloc func

This patch removes the dgnc_driver_kzmalloc function from
driver.c and driver.h. A previous patch replaced all
dgnc_driver_kzmalloc function calls with kzalloc.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
Lidza Louina [Wed, 28 Aug 2013 02:13:27 +0000 (22:13 -0400)]
staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc

This patch replaces dgnc_driver_kzmalloc with kzalloc.
A patch that follows removes the dgnc_driver_kzmalloc
function.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: tty.c: updates uart_struct declaration for sparse
Lidza Louina [Wed, 28 Aug 2013 02:13:26 +0000 (22:13 -0400)]
staging: dgnc: tty.c: updates uart_struct declaration for sparse

This patch edits the type casts neo_uart_struct and
cls_uart_struct. A previous patch added the marker __iomem
to these structs. This patch ensures that the change to
the marker is consistent. This also removes these
sparse warnings:

warning: incorrect type in assignment (different address spaces)
  expected struct neo_uart_struct [noderef] <asn:2>*ch_neo_uart
  got struct neo_uart_struct *<noident>
warning: incorrect type in assignment (different address spaces)
  expected struct cls_uart_struct [noderef] <asn:2>*ch_cls_uart
  got struct cls_uart_struct *<noident>

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: oz_pd_free() can be static
Fengguang Wu [Wed, 28 Aug 2013 00:36:16 +0000 (17:36 -0700)]
staging: ozwpan: oz_pd_free() can be static

Cc: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: gdm7240: gdm_driver[] can be static
Fengguang Wu [Wed, 28 Aug 2013 00:08:16 +0000 (17:08 -0700)]
staging: gdm7240: gdm_driver[] can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: r8188eu: Fix build error with random configuration
Larry Finger [Tue, 27 Aug 2013 22:12:36 +0000 (17:12 -0500)]
staging: r8188eu: Fix build error with random configuration

The kbuild test robot reports the following error:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e4a745f9519ef2bbb9d75212ae1cca7582d76266
commit: b63c05394f3fe9ae547e1fa9df30f1ba0bcdabb4 [7011/7939] staging: r8188eu: Turn on build of new driver
config: x86_64-randconfig-x0-0828 (attached as .config)

All error/warnings:

   drivers/staging/rtl8188eu/core/rtw_p2p.c: In function 'go_add_group_info_attr':
>> drivers/staging/rtl8188eu/core/rtw_p2p.c:70:11: error: 'struct sta_info' has no member named 'is_p2p_device'
      if (psta->is_p2p_device) {

This and the following errors were caused by an incorrect nesting of
conditional compilation directives.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Reset PORT_ENABLE bit.
Rupesh Gujare [Tue, 27 Aug 2013 15:53:41 +0000 (16:53 +0100)]
staging: ozwpan: Reset PORT_ENABLE bit.

Reset PORT_ENABLE bit of port status on loosing PD.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: ozwpan: Add debounce time before unregistering.
Rupesh Gujare [Tue, 27 Aug 2013 15:53:42 +0000 (16:53 +0100)]
staging: ozwpan: Add debounce time before unregistering.

Fixes following error caused during unloading driver.

[ 1127.542888] usb 5-1: USB disconnect, device number 2
[ 1127.542909] ozwpan ozwpan: remove, state 1
[ 1127.542933] usb usb5: USB disconnect, device number 1
[ 1127.618634] hub 5-0:1.0: hub_port_status failed (err = -19)
[ 1127.618647] hub_port_connect_change: 45 callbacks suppressed
[ 1127.618657] hub 5-0:1.0: connect-debounce failed, port 1 disabled
[ 1127.618668] hub 5-0:1.0: cannot disable port 1 (err = -19)

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: ni_atmio16d: fix atmio16d_dio_insn_config()
H Hartley Sweeten [Mon, 26 Aug 2013 22:29:33 +0000 (15:29 -0700)]
staging: comedi: ni_atmio16d: fix atmio16d_dio_insn_config()

This is the (*insn_config) function for a DIO subdevice. It should be
using the data[0] value as the "instruction" to perform on the subdevice.

Use the comedi_dio_insn_config() helper to properly handle instructions.

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: dmm32at: fix dmm32at_dio_insn_config()
H Hartley Sweeten [Mon, 26 Aug 2013 22:29:10 +0000 (15:29 -0700)]
staging: comedi: dmm32at: fix dmm32at_dio_insn_config()

This is the (*insn_config) function for a DIO subdevice. It should be
using the data[0] value as the "instruction" to perform on the subdevice.

Use the comedi_dio_insn_config() helper to properly handle instructions.

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: dt282x: fix dt282x_dio_insn_config()
H Hartley Sweeten [Mon, 26 Aug 2013 22:28:51 +0000 (15:28 -0700)]
staging: comedi: dt282x: fix dt282x_dio_insn_config()

This is the (*insn_config) function for a DIO subdevice. It should be
using the data[0] value as the "instruction" to perform on the subdevice.

Use the comedi_dio_insn_config() helper to properly handle instructions.

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: dt2817: fix dt2817_dio_insn_config()
H Hartley Sweeten [Mon, 26 Aug 2013 22:28:32 +0000 (15:28 -0700)]
staging: comedi: dt2817: fix dt2817_dio_insn_config()

This is the (*insn_config) function for a DIO subdevice. It should be
using the data[0] value as the "instruction" to perform on the subdevice.

Use the comedi_dio_insn_config() helper to properly handle instructions.

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: vt6656: device.h replace typedef struct _USB_SEND_CONTEXT.
Malcolm Priestley [Tue, 27 Aug 2013 11:41:50 +0000 (12:41 +0100)]
staging: vt6656: device.h replace typedef struct _USB_SEND_CONTEXT.

Replace with struct vnt_usb_send_context.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vFillTxKey use switch for pTransmitKey->byCipherSuite
Malcolm Priestley [Tue, 27 Aug 2013 11:32:01 +0000 (12:32 +0100)]
staging: vt6656: rxtx.c s_vFillTxKey use switch for pTransmitKey->byCipherSuite

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vFillTxKey clean up format and white space.
Malcolm Priestley [Tue, 27 Aug 2013 11:29:10 +0000 (12:29 +0100)]
staging: vt6656: rxtx.c s_vFillTxKey clean up format and white space.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vFillRTSHead/s_vFillCTSHead move union vnt_tx_data_head...
Malcolm Priestley [Tue, 27 Aug 2013 11:07:58 +0000 (12:07 +0100)]
staging: vt6656: rxtx.c s_vFillRTSHead/s_vFillCTSHead move union vnt_tx_data_head up one level.

Move
s_vFillRTSHead union vnt_tx_data_head to void *pvRTS argument.
s_vFillCTSHead union vnt_tx_data_head to void *pvCTS argument.

In s_vGenerateTxParameter create union vnt_tx_data_head
pointing to rts_cts;

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c merge pvRTS and pvCTS/pCTS void pointers
Malcolm Priestley [Tue, 27 Aug 2013 11:02:54 +0000 (12:02 +0100)]
staging: vt6656: rxtx.c merge pvRTS and pvCTS/pCTS void pointers

As result of patch
rxtx.c s_vGenerateTxParameter create argument bool need rts

RTS and CTS void pointers can be merged.

Create new pointer rts_cts so that unions in s_vFillCTSHead/s_vFillRTSHead
can be joined.

If rts_cts is NULL neither exist.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vGenerateTxParameter create argument bool need rts
Malcolm Priestley [Tue, 27 Aug 2013 10:56:33 +0000 (11:56 +0100)]
staging: vt6656: rxtx.c s_vGenerateTxParameter create argument bool need rts

Allow conditional statements to be based on true/false instead of
NULL or not pointer pvRTS.

Harmonise all call functions will bool type.

If need_rts is true then rts is needed.

If need_rts is false then
cts is needed only when byPktType == PK_TYPE_11GB || PK_TYPE_11GA.
none no rts/cts other byPktTypes.

This allow the joining of pointers pvRTS/pvCTS in to single pointer.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: s_vFillCTSHead join structures of vnt_cts* to union vnt_tx_data_head
Malcolm Priestley [Tue, 27 Aug 2013 10:48:34 +0000 (11:48 +0100)]
staging: vt6656: s_vFillCTSHead join structures of vnt_cts* to union vnt_tx_data_head

Only one of vnt_rts*/vnt_cts* structures are accessed at any one time.

structures vnt_cts and vnt_cts_fb are members of union vnt_tx_data_head.

Create pointer union head and point structures to the correct member.

Point the union to pvCTS.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vFillCTSHead Remove byPktType if
Malcolm Priestley [Tue, 27 Aug 2013 10:46:17 +0000 (11:46 +0100)]
staging: vt6656: rxtx.c s_vFillCTSHead Remove byPktType if

s_vFillCTSHead is only called when byPktType == PK_TYPE_11GB ||
byPktType == PK_TYPE_11GA so remove unnecessary if on byPktType.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c s_vFillRTSHead PK_TYPE_11A allow fall through AUTO_FB_NONE
Malcolm Priestley [Tue, 27 Aug 2013 08:58:21 +0000 (09:58 +0100)]
staging: vt6656: rxtx.c s_vFillRTSHead PK_TYPE_11A allow fall through AUTO_FB_NONE

byFBOption == AUTO_FB_NONE (0) is the same as PK_TYPE_11B

Reverse if condition to break and allow fall through.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: vt6656: rxtx.c: s_vFillRTSHead change if/else to switch on byPktype
Malcolm Priestley [Tue, 27 Aug 2013 08:56:50 +0000 (09:56 +0100)]
staging: vt6656: rxtx.c: s_vFillRTSHead change if/else to switch on byPktype

Allowing fall through where necessary.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: tty.c: edits var in init func for sparse
Lidza Louina [Mon, 26 Aug 2013 18:04:59 +0000 (14:04 -0400)]
staging: dgnc: tty.c: edits var in init func for sparse

This patch edits the vaddr variable in dgnc_tty_init.
The variable gets set to board_t->re_map_membase. A
previous patch changed the re_map_membase variable's
marker and type. This patch makes sure that the
changes are consistent and that it doesn't cause
sparse warnings.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: neo.c: changes param in neo_read_eeprom function for sparse
Lidza Louina [Mon, 26 Aug 2013 17:56:11 +0000 (13:56 -0400)]
staging: dgnc: neo.c: changes param in neo_read_eeprom function for sparse

This patch adds a marker to neo_read_eeprom function's
base parameter.

It removes these warnings found in neo.c:

warning: incorrect type in argument 1 (different address spaces)
  expected unsigned char *base
  got unsigned char [noderef] [usertype] <asn:2>*re_map_membase
warning: incorrect type in argument 2 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char *

These warnings happen because this function gets
called with a board_t->re_map_base variable. A previous
patch added the __iomem marker to this variable. This
patch ensures that the changes are consistent.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: cls.c: changes var in cls_vpd function for sparse
Lidza Louina [Mon, 26 Aug 2013 17:05:49 +0000 (13:05 -0400)]
staging: dgnc: cls.c: changes var in cls_vpd function for sparse

This patch changes cls_vpd function's re_map_vpdbase variable
type and marker.

It removes these warnings found in cls.c:

warning: incorrect type in assignment (different address spaces)
  expected unsigned char [usertype] *re_map_vpdbase
  got void [noderef] <asn:2>*
warning: incorrect type in argument 1 (different address spaces)
  expected void const volatile [noderef] <asn:2>*addr
  got unsigned char [usertype] *
warning: incorrect type in argument 1 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char [usertype] *re_map_vpdbase

The variables passed to readb needs to be of type u8
with a __iomem marker. re_map_vpdbase is passed into
readb in the code.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: driver.h: changes a struct board_t var's type and marker for sparse
Lidza Louina [Mon, 26 Aug 2013 16:49:31 +0000 (12:49 -0400)]
staging: dgnc: driver.h: changes a struct board_t var's type and marker for sparse

This patch changes the board_t->re_map_membase variable
type and marker.

It removes these warnings found in the neo.c,
driver.c and cls.c files:

warning: incorrect type in argument 1 (different address spaces)
  expected void const volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>
warning: incorrect type in argument 2 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a
board_t->re_map_membase variable.

The change made to the driver.h file adds the marker
and changes the variable type.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: neo_uart_struct: adds marker and changes vars' types for sparse
Lidza Louina [Mon, 26 Aug 2013 15:08:02 +0000 (11:08 -0400)]
staging: dgnc: neo_uart_struct: adds marker and changes vars' types for sparse

This patch fixes these warnings found in the neo.c file:

warning: incorrect type in argument 1 (different address spaces)
  expected void const volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>
warning: incorrect type in argument 2 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a neo_uart_struct variable.

The change made to the driver.h file adds the marker
to the neo_uart_struct and the changes in neo.h
changes the variables' types.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse
Lidza Louina [Mon, 26 Aug 2013 14:53:09 +0000 (10:53 -0400)]
staging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse

This patch removes these sparse warnings found in the cls.c file:

warning: incorrect type in argument 1 (different address spaces)
  expected void const volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>
warning: incorrect type in argument 2 (different address spaces)
  expected void volatile [noderef] <asn:2>*addr
  got unsigned char volatile *<noident>

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a cls_uart_struct variable.

The change made to the driver.h file adds the marker
to the cls_uart_struct and the changes in cls.h
changes its variables' types.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: usbip: use DEVICE_ATTR_RO/RW for sysfs attributes
Greg Kroah-Hartman [Mon, 26 Aug 2013 19:02:54 +0000 (12:02 -0700)]
staging: usbip: use DEVICE_ATTR_RO/RW for sysfs attributes

It's easier to audit the sysfs files if they use the RO/RW macros, so
convert the usbip code to them.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: use correct minor device numbers in name
Ian Abbott [Fri, 23 Aug 2013 13:45:10 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: use correct minor device numbers in name

The board name for "comedi_bond" is constructed from a space-separated
list of items of the form "minor:subdevice" where "minor" is a minor
device number and "subdevice" is a subdevice number.  Currently, all the
"minor" device numbers are for the "comedi_bond" device itself and the
"subdevice" numbers are for the bonded devices.  It makes makes more
sense for the "minor" device numbers to come from the bonded devices as
well so that the string is a list of bonded "minor:subdevice" pairs.
Fix it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: use krealloc() and fix memory leak
Ian Abbott [Fri, 23 Aug 2013 13:45:09 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: use krealloc() and fix memory leak

`do_dev_config()` is called from the comedi 'attach' handler,
`bonding_attach()`.  The device private data structure contains a
dynamically allocated array of pointers to "bonded" device structures
which grows during the `do_dev_config()` call.  The length of this array
is in `devpriv->ndevs`.  It currently uses a local function `realloc()`
to allocate a new array, copy the old contents over and free the old
array.  It should be more efficient to use `krealloc()` as it may be
able to use slack space at the end of the previous array and avoid a
copy.

The old `realloc()` function always freed the old buffer which meant
that if it failed to allocate the new buffer it would lose the contents
of the old buffer.  Unfortunately, that contained pointers to more
dynamically allocated memory, leading to a memory leak.  If `krealloc()`
fails, keep the old buffer and avoid the memory leak.  The
aforementioned pointers to more dynamically allocated memory will be
cleaned up by the 'detach' handler, `bonding_detach()` which will be
called by the comedi core as a consequence of `krealloc()` failing in
`do_dev_config()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: handle base channel for insn_bits
Ian Abbott [Fri, 23 Aug 2013 13:45:08 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: handle base channel for insn_bits

If a DIO subdevice has more than 32 channels, its 'insn_bits' handler is
supposed to take account of the base channel from
`CR_CHAN(insn->chanspec)`.  (The comedi core will adjust the base
channel to 0 and shift the mask and data to compensate if the subdevice
has less than or equal to 32 channels.)  The "comedi_bond" driver
currently ignores the base channel and assumes it is 0.

Replace `comedi_dio_bitfield()` in the "kcomedilib" module with
`comedi_dio_bitfield2()` that takes account of the base channel, and
rewrite the "comedi_bond" driver's 'insn_bits' handler
(`bonding_dio_insn_bits()`) to take account of the base channel and use
the new function.

No other modules use `comedi_dio_bitfield()` so it is safe to replace it
with `comedi_dio_bitfield2()`.  The name follows that of the equivalent
function in the user-space comedilib.  If the base channel is non-zero
and the subdevice has less than or equal to 32 channels it needs to
adjust things in the same way as the comedi core (same as `parse_insn()`
in "comedi_fops.c") due to most drivers ignoring the base channel.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: get INSN_CONFIG_DIO_QUERY info from horse's mouth
Ian Abbott [Fri, 23 Aug 2013 13:45:07 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: get INSN_CONFIG_DIO_QUERY info from horse's mouth

The DIO subdevice of the "comedi_bond" device attempts to remember the
directions of DIO channels itself in the `io_bits` member of the
subdevice, but that is only large enough for the first 32 channels and
it might not be accurate anyway as changing the direction of one channel
may have affected a whole group of channels and we have no idea of the
initial directions before the "bonded" device was linked to the the
"comedi_bond" device.  It would be better to ask the bonded device for
this information when handling a `INSN_CONFIG_DIO_QUERY` configuration
instruction.  Add new function `comedi_dio_get_config()` to the
"kcomedilib" module to allow us to get the DIO direction of a channel
and use it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: just check devprivs->devs once on detach
Ian Abbott [Fri, 23 Aug 2013 13:45:06 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: just check devprivs->devs once on detach

The `while` loop in `bonding_detach()` doesn't need to check
`devpriv->devs` each time round the loop.  Move the test outside the
loop.  The enclosing `if (devpriv)` can be changed to `if (devpriv &&
devpriv->devs)` as everything in this `if` statement is associated with
`devpriv->devs` anyway.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: no need to free dev->private on detach
Ian Abbott [Fri, 23 Aug 2013 13:45:05 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: no need to free dev->private on detach

The comedi core will free `dev->private` if it is non-NULL after calling
the "detach" handler (`bonding_detach()`), so don't bother freeing it in
`bonding_detach()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: remove unused subdev_type
Ian Abbott [Fri, 23 Aug 2013 13:45:04 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: remove unused subdev_type

The `subdev_type` member of `struct bonded_device` is set but not used.
Remove it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: don't map channels individually
Ian Abbott [Fri, 23 Aug 2013 13:45:03 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: don't map channels individually

The private data structure (`struct comedi_bond_private`) for the
overall "comedi_bond" device maps each channel individually to a pointer
to the `struct bonded_device` it belongs to via array member
`chan_id_dev_map[MAX_CHANS]`. This speeds up look-ups from channel
number to bonded device a bit, but the length of the array used to look
this up is currently fixed at `MAX_CHANS` (256) and there are no
overflow checks when filling the array.

In practice, there will only be a few bonded devices (actually bonded
subdevices) and it is practical to just skip through the list until we
reach the one containing the desired channel.

The only place where the bonded device is looked up from the channel
number is in `bonding_dio_insn_config()`.  Change it to do the look-up
by skipping through the list of bonded devices and remove the
`chan_id_dev_map[]` member.  The `chanid_offset` member of `struct
bonded_device` is also no longer needed as the value can be derived
while skipping through the list of bonded devices, so remove that member
as well.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: use bitmap to record opened/closed minors
Ian Abbott [Fri, 23 Aug 2013 13:45:02 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: use bitmap to record opened/closed minors

`do_dev_config()` currently records the comedi minor devices it has
opened by setting `devs_opened[minor]` to the pointer returned by
`comedi_open()`.  This is checked to avoid opening the same minor device
twice.  The pointer values in `devs_opened[]` aren't needed; we only
need to record which minor device numbers are being used.  Change
`devs_opened` to a bitmap (declared with `DECLARE_BITMAP()`) of length
`COMEDI_NUM_BOARD_MINORS` as the minor device numbers are range-checked
to fit in a bitmap of this length.  Use `test_and_set_bit()` to record
the minor device numbers we attempt to open with `comedi_open()`.

`bonding_detach()` calls `comedi_close()` to close the comedi minor
devices.  Since the minor device numbers may be repeated in its list of
bonded subdevices, it currently uses a simple `unsigned long
devs_closed` variable as a bitmap to keep track of which minor device
numbers it has already closed to avoid closing them twice.  As a single
`unsigned long` consists of less than `COMEDI_NUM_BOARD_MINORS` bits on
a 32-bit machine, change `devs_closed to a bitmap of this length using
`DECLARE_BITMAP()` and use `test_and_set_bit()` to avoid calling
`comedi_close()` more than once for each minor device number in use.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: change return value of bonding_attach()
Ian Abbott [Fri, 23 Aug 2013 13:45:01 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: change return value of bonding_attach()

`bonding_attach()` is the comedi "attach" handler for the driver.  Any
non-negative return value is treated as successful, but 0 is the
preferred return value on success.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: return error code in do_dev_config()
Ian Abbott [Fri, 23 Aug 2013 13:45:00 +0000 (14:45 +0100)]
staging: comedi: comedi_bond: return error code in do_dev_config()

Change `do_dev_config()` to return an error code on failure and 0 on
success, instead of 0 on failure and 1 on success.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: no need to initialize file[]
Ian Abbott [Fri, 23 Aug 2013 13:44:59 +0000 (14:44 +0100)]
staging: comedi: comedi_bond: no need to initialize file[]

The `char file[]` variable in `do_dev_config()` doesn't need to be
initialized as it gets overwritten with a `snprintf()`.  It just needs
to be long enough.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: rename CamelCase identifiers
Ian Abbott [Fri, 23 Aug 2013 13:44:58 +0000 (14:44 +0100)]
staging: comedi: comedi_bond: rename CamelCase identifiers

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: shorten module description
Ian Abbott [Fri, 23 Aug 2013 13:44:57 +0000 (14:44 +0100)]
staging: comedi: comedi_bond: shorten module description

Omit the fanciful prose from the MODULE_DESCRIPTION() line and combine
concantenated string literals.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: comedi: comedi_bond: reformat some comments
Ian Abbott [Fri, 23 Aug 2013 13:44:56 +0000 (14:44 +0100)]
staging: comedi: comedi_bond: reformat some comments

Reformat some comments according to CodingStyle and remove some comments
inherited from the comedi 'skel' example driver.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: dgnc: Kconfig: add dependency PCI for it
Chen Gang [Mon, 26 Aug 2013 03:55:50 +0000 (11:55 +0800)]
staging: dgnc: Kconfig: add dependency PCI for it

DGNC is based on PCI, so need add related dependency, or when compiled
with PCI disabled, it will be fail.

The related error (randconfig for PCI disabled under s390):

  drivers/staging/dgnc/dgnc_cls.c:1394:2: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration]
  drivers/staging/dgnc/dgnc_cls.c:1407:3: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: lustre: Fix typo in lustre/lnet
Masanari Iida [Sun, 25 Aug 2013 01:10:14 +0000 (10:10 +0900)]
staging: lustre: Fix typo in lustre/lnet

Correct spelling typo in comments and debug messages.

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