Commit Graph

16699 Commits (93e562141ac58452bcea48718af92cc62a20669d)

Author SHA1 Message Date
Peter Huewe 9388ad9c6a staging/xgifb: Remove unnecessary casts
Both functions xgifb_reg_get and inb return an u8 value, so we don't
need to cast their return value to unsigned char.

-> remove the cast

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 15:12:40 -08:00
Peter Huewe 66b43eb257 staging/xgifb: Consolidate if/else if with identical code branches
Both branches of this if statement execute the same code.
Thus we can || them together and remove code duplication

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 15:12:39 -08:00
Andres More 4e9b5e2b8b staging: vt6656: replaced custom TRUE definition with true
Checkpatch findings were not resolved, just direct replacement.

sed -i 's/\bTRUE\b/true/g' drivers/staging/vt6656/*.[ch]

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:48:24 -08:00
Andres More e269fc2d12 staging: vt6656: replaced custom FALSE definition with false
Checkpatch findings were not resolved, just direct replacement.

sed -i 's/\bFALSE\b/false/g' drivers/staging/vt6656/*.[ch]

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:47:52 -08:00
Andres More dfdcc42597 staging: vt6656: replace custom BOOL definition with bool
Checkpatch findings were not resolved, just make direct replacement
plus a couple of conflicting types in declarations.

sed -i 's/\bBOOL\b/bool/g' drivers/staging/vt6656/*.[ch]

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:46:44 -08:00
Peter Huewe b6592810e4 staging/rtl8187se: Mark functions as static to silence sparse
Sparse complains that some functions can be declared as static:
123:6: warning: symbol 'PlatformIOWrite1Byte' was not declared. Should it be static?
129:6: warning: symbol 'PlatformIOWrite2Byte' was not declared. Should it be static?
135:6: warning: symbol 'PlatformIOWrite4Byte' was not declared. Should it be static?
178:6: warning: symbol 'SetOutputEnableOfRfPins' was not declared.  Should it be static?
354:6: warning: symbol 'ZEBRA_Config_85BASIC_HardCode' was not declared.  Should it be static?
655:6: warning: symbol 'InitTxPwrTracking87SE' was not declared. Should it be static?
665:6: warning: symbol 'PhyConfig8185' was not declared. Should it be static?
692:6: warning: symbol 'HwConfigureRTL8185' was not declared. Should it be static?
817:4: warning: symbol 'GetSupportedWirelessMode8185' was not declared.  Should it be static?
822:6: warning: symbol 'ActUpdateChannelAccessSetting' was not declared.  Should it be static?
857:6: warning: symbol 'ActSetWirelessMode8185' was not declared. Should it be static?
914:6: warning: symbol 'MgntDisconnectIBSS' was not declared. Should it be static?
940:6: warning: symbol 'MlmeDisassociateRequest' was not declared.  Should it be static?
957:6: warning: symbol 'MgntDisconnectAP' was not declared. Should it be static?
975:6: warning: symbol 'MgntDisconnect' was not declared. Should it be static?
1011:6: warning: symbol 'SetRFPowerState' was not declared. Should it be static?
1115:6: warning: symbol 'InactivePowerSave' was not declared. Should it be static?

-> Add the static keyword.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:37 -08:00
Peter Huewe 7f0cb0a05d staging/rtl8187se: Remove duplicated code by using an offset
In SetAntennaConfig87SE both branches of if (bAntDiversity) do exactly
the same, except that there is an offset of 0x80 for the register values
if bAntDiversity is true.

-> Consolidate both branches and assign the offset if necessary.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:37 -08:00
Peter Huewe a638d6afbc staging/rtl8187se: Remove unused functions PlatformIORead2Byte / PlatformIORead4Byte
These two functions PlatformIORead2Byte and PlatformIORead4Byte are
unused and thus can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:37 -08:00
Peter Huewe aa341b6afa staging/rtl8187se: Remove temporary variable for return value
The simple PlatformIORead1Byte function doesn't need to store its return
value in a temporary variable; rather simply return the value directly.

By moving the function to the top we can also get rid of the forward
declaration.

The wrapper functions could be easily replaced by direct calls to
read_nic_byte but is kept for readability.

Since this functions is local only we can mark it as static.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:37 -08:00
Peter Huewe 2c370d9512 staging/rtl8187se: Reuse ReadBBPortUchar to avoid duplicated code
WriteBBPortUchar reimplements ReadBBPortUchar in its body, so we can
remove the duplicated code by calling ReadBBPortUchar directly.

Unfortunately we have to move ReadBBPortUchar around; while at it we can
also get rid of the temporary variable for the return value.

Also we can remove the local variables UCharData and RegisterContent in
WriteBBPortUchar as they are not used / without effect.

Both functions are only 'local' so we can mark them as static.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:36 -08:00
Peter Huewe 8a26aefda1 staging/rtl8187se: Remove unused/unnecessary variables
The local variables priv and ieee are not used and thus can be removed.
The local variable u1bAIFS is not used/read after assignment and thus
can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:28:36 -08:00
Peter Huewe b926050cb1 staging/rtl8187se: Remove code without effect
The local variable AcParam is only assigned to but not read/used
afterwards, thus it and all related code can be removed.

The bFollowLegacySetting variable and check can also be removed as it is
always true.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:26:02 -08:00
Peter Huewe 2578180858 staging/rtl8187se: Remove code without effect
The local variable u4bAcParam is never read/used after assignment,
thus we can remove the declaration, assignment and any related code.

-> the local variables u1bAIFS, eACI and pAcParam can also be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:26:02 -08:00
Peter Huewe e9d077bd2a staging/rtl8187se: Remove code without effect
Local variable AcmCtrl is never read/used after assignment so we can remove
all assignments to it and the related code around the assignments.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:26:02 -08:00
Peter Huewe 7be7d6def3 staging/ozwpan: Fix NULL vs zero in ozhcd.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe ba346a4367 staging/ozwpan: Fix NULL vs zero in ozusbsvc.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe bc501c551c staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe 41ebb8a1c5 staging/ozwpan: Fix NULL vs zero in ozproto.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe 953b19013a staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:23:50 -08:00
Peter Huewe 4d1b2fbbaf staging/ozwpan: Fix NULL vs zero in ozusbsvc1.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:23:50 -08:00
Peter Huewe 86b02be043 staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)
This patch fixes the warning "Using plain integer as NULL pointer",
generated by sparse, by replacing the offending 0s with NULL.

If the initialization with NULL was unnecessary (due to unconditional
assignment before first use) it was removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:23:49 -08:00
Peter Huewe 36d2041a3d staging/panel: Mark local functions/structs static and add const if applicable (fix sparse warnings)
sparse complains about the following functions:
panel.c:188:1: warning: symbol 'logical_inputs' was not declared. Should it be static?
panel.c:569:6: warning: symbol 'old_keypad_profile' was not declared. Should it be static?
panel.c:580:6: warning: symbol 'new_keypad_profile' was not declared. Should it be static?
panel.c:593:6: warning: symbol 'nexcom_keypad_profile' was not declared. Should it be static?
panel.c:672:6: warning: symbol 'pin_to_bits' was not declared. Should it be static?
panel.c:1375:6: warning: symbol 'panel_lcd_print' was not declared. Should it be static?
panel.c:1382:6: warning: symbol 'lcd_init' was not declared. Should it be static?
panel.c:2181:5: warning: symbol 'panel_init' was not declared. Should it be static?

Add the static keyword to silence these warnings and make sparse happy.

If structs or function parameters are used readonly they are also marked
as const.

CC: David Howells <dhowells@redhat.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:20:14 -08:00
Peter Huewe a81875dd7a staging/comedi: Remove if(); statement without effect
Smatch warns about:
staging/comedi/drivers/cb_pcidas64.c:3304 prep_ao_dma() warn: if();

So the check currently does nothing and can be removed, as indicated by
Ian.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:20:14 -08:00
Peter Huewe 8289ad0578 staging/comedi: Use && instead of & for logical comparision
sparse complains that:
drivers/staging/comedi/drivers/adl_pci9118.c:813 pci9118_calc_divisors()
warn: maybe use && instead of &

usessh is used as a boolean flag (0 and 1) and is compared to a boolean
value so we should use && here.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:20:14 -08:00
Ian Abbott f06a23c93b staging: comedi: vmk80xx: initialize K8055 outputs to known state
vmk8055_reset_device() is called during initialization of a Velleman
K8055 (aka VM110) to send a reset command to the hardware.  I don't know
what this does, but I know that it doesn't reset the digital outputs as
I've tried it.  Since the hardware does not have any way to query the
current output values and there is only the one command to update all
the analog and digital outputs simultaneously (VMK8055_CMD_WRT_AD), send
this command during initialization to set all the analog and digital
outputs to a known state.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:17:55 -08:00
Ian Abbott e8f311a5b6 staging: comedi: vmk80xx: simplify vmk80xx_reset_device()
vmk80xx_reset_device() is called during initialization of a Velleman
K8055 (aka VM110) to send a reset command to the hardware.  The current
function is a bit long-winded and doesn't set the TRANS_OUT_BUSY flag to
prevent re-use of the transmit buffer while the URB is in progress.

Rewrite the function to use vmk80xx_write_packet() to send the command.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:17:55 -08:00
Ian Abbott 0cbfc8269b staging: comedi: vmk80xx: zero buffers on allocation
Zero out `devpriv->usb_tx_buf` and `devpriv->usb_rx_buf` on allocation.
When sending data to the USB device, this ensures any unused part of the
buffer will not contain random crap.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:17:55 -08:00
Konrad Rzeszutek Wilk d489082ac6 zcache/zbud: Fix __init mismatch
We get:
WARNING: drivers/staging/zcache/zcache.o(.text+0x13a1): Section mismatch
in reference from the function zcache_init() to the function
.init.text:zbud_init()
The function zcache_init() references
the function __init zbud_init().
This is often because zcache_init lacks a __init
annotation or the annotation of zbud_init is wrong.

And this fixes it.

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:16:11 -08:00
Konrad Rzeszutek Wilk feb897e1f4 zbud: Fix compile warnings due to usage of debugfs_create_size_t
.
drivers/staging/zcache/zbud.c:336: warning: passing argument 4 of ‘debugfs_create_size_t’ from incompatible pointer type
include/linux/debugfs.h:80: note: expected ‘size_t *’ but argument is of type ‘long unsigned int *’
..

which is b/c we end up using 'unsigned' or 'unsigned long' instead
of 'ssize_t'. So lets fix this up and use the proper type.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:16:11 -08:00
Konrad Rzeszutek Wilk 80e9fc9af4 ramster: Fix compile warnings due to usage of debugfs_create_size_t
We get tons of "note: expected ‘size_t *’ but argument is of type ‘long
int *’" warnings. This fixes it.

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:16:11 -08:00
Konrad Rzeszutek Wilk 291131cba1 zcache: Fix compile warnings due to usage of debugfs_create_size_t
When we compile we get tons of:
include/linux/debugfs.h:80:16: note: expected ‘size_t *’ but argument is
of type ‘long int *’
drivers/staging/zcache/zcache-main.c:279:2: warning: passing argument 4
of ‘debugfs_create_size_t’ from incompatible pointer type [enabled by d
efault]

which is b/c we end up using 'unsigned' or 'unsigned long' instead
of 'ssize_t'. So lets fix this up and use the proper type.

[v2: Rebased directly on staging]
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:16:10 -08:00
Arnd Bergmann acb7452369 Linux 3.8-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQEcBAABAgAGBQJRAuO3AAoJEHm+PkMAQRiGbfAH/1C3QQKB11aBpYLAw7qijAze
 yOui26UCnwRryxsO8zBCQjGoByy5DvY/Q0zyUCWUE6nf/JFSoKGUHzfJ1ATyzGll
 3vENP6Fnmq0Hgc4t8/gXtXrZ1k/c43cYA2XEhDnEsJlFNmNj2wCQQj9njTNn2cl1
 k6XhZ9U1V2hGYpLL5bmsZiLVI6dIpkCVw8d4GZ8BKxSLUacVKMS7ml2kZqxBTMgt
 AF6T2SPagBBxxNq8q87x4b7vyHYchZmk+9tAV8UMs1ecimasLK8vrRAJvkXXaH1t
 xgtR0sfIp5raEjoFYswCK+cf5NEusLZDKOEvoABFfEgL4/RKFZ8w7MMsmG8m0rk=
 =m68Y
 -----END PGP SIGNATURE-----

Merge branch 'omap/multiplatform-fixes', tag 'v3.8-rc5' into next/multiplatform

The omap multiplatform support uncovered a bug in the cwdavinci_cpdma
code and was missing two drivers that are enabled now but are not
quite ready for multiplatform, as found by allyesconfig builds.

There is also a conflict generated by automated merge in
arch/arm/mach-omap2/drm.c between a bug fix that went into v3.8-rc5
and a different version of the same fix that went into the
omap/multiplatform branch. This merge removes the extraneous
 #include that was causing build errors.

* omap/multiplatform-fixes:
  net: cwdavinci_cpdma: export symbols for cpsw
  remoteproc: omap: depend on OMAP_MBOX_FWK
  [media] davinci: do not include mach/hardware.h

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-02-15 13:31:52 +01:00
Peter Huewe 67a88e6390 staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c
Clang/scan-build complains about a possible buffer overflow in
ieee80211_wx_get_name:

.../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:499:3:
warning: String copy function overflows destination buffer
	strcat(wrqu->name," link..");

.../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:497:3:
warning: String copy function overflows destination buffer
	strcat(wrqu->name," linked");

The buffer wrqu->name is only IFNAMSIZ bytes big (currently 16),
so if we have a "802.11b/g/n linked" device we overrun the buffer by 3
bytes.

-> Use strlcopy / strlcat to populate the name.
This is done in a similar fashion in
staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c

While at it cleaned some whitespace issues.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-14 09:26:23 -08:00
Peter Huewe fae7e4d393 staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c
clang/scan-build complains that:
p80211netdev.c:451:6: warning: Branch condition evaluates to a garbage
value
        if ((p80211_wep.data) && (p80211_wep.data != skb->data))
	            ^~~~~~~~~~~~~~~~~

This can happen in p80211knetdev_hard_start_xmit if
- if (wlandev->state != WLAN_DEVICE_OPEN) evaluates to true.
the execution flow then continues at the 'failed' label where
p80211_wep.data is used without being initialized first.

-> Initialize the data field to NULL to fix this issue.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-14 09:26:23 -08:00
Tomi Valkeinen 91e83ffd6d omapdrm: fix the dependency to omapdss
omapdrm uses "select" in Kconfig to enable omapdss. This doesn't work
correctly, as "select" forces omapdss to be enabled in the config even
if it normally could not be enabled because of missing Kconfig
dependencies.

This causes a build break on ARM, when using allyesconfig:

drivers/video/omap2/dss/dss.c: In function 'dss_calc_clock_div':
drivers/video/omap2/dss/dss.c:572:20: error: 'CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK' undeclared (first use in this function)
drivers/video/omap2/dss/dss.c:572:20: note: each undeclared identifier is reported only once for each function it appears in

Instead of using select, this patch changes omapdrm to use "depend
on".

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-02-14 13:08:29 +02:00
Daniel Vetter cd5428a544 drm/<drivers>: simplify ->fb_probe callback
The fb helper lost its support for reallocating an fb completely, so
no need to return special success values any more.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-02-14 00:07:58 +01:00
Daniel Vetter 76a39dbfb2 drm/fb-helper: don't disable everything in initial_config
This should be done in the drivers for two reasons:
- it gets in the way of fastboot efforts
- it links the fb helpers with the crtc helpers instead of going
  through the real interface vfuncs, forcing i915 to fake all the
  ->disable callbacks used by the crtc helper to avoid ugly Oopsen

v2: Resolve conflicts since drivers still call
drm_fb_helper_single_add_all_connectors.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-02-14 00:07:53 +01:00
Joe Perches 535ec049e8 [media] staging: media: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-13 17:32:46 -02:00
Dan Magenheimer 0bcc0429bd staging: zcache: add TODO file
Add zcache TODO file

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-13 10:22:12 -08:00
George Spelvin 593fb1ae45 pps: Move timestamp read into PPS code proper
The PPS (Pulse-Per-Second) line discipline has developed a number of
unhealthy attachments to core tty data and functions, ultimately leading
to its breakage.

The previous patches fixed the crashing.  This one reduces coupling further
by eliminating the timestamp parameter from the dcd_change ldisc method.
This reduces header file linkage and makes the extension more generic,
and the timestamp read is delayed only slightly, from just before the
ldisc->ops->dcd_change method call to just after.

Fix attendant build breakage in
    drivers/tty/n_tty.c
    drivers/tty/tty_buffer.c
    drivers/staging/speakup/selection.c
    drivers/staging/dgrp/dgrp_*.c

Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@braille.uwo.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: George Spelvin <linux@horizon.com>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-13 10:13:58 -08:00
Peter Huewe fc9ca48eb6 staging/comedi: Fix undefined array subscript
In vmk80xx_do_insn_bits the local variable reg, which is used as an
index to the tx_buf array, can be used uninitialized if
- data[0] == 0
and
- devpriv->model != VMK8061_MODEL
-> we get into the else branch without having reg initialized.

Since the driver usually differentiates between VMK8061_MODEL and
VMK8055_MODEL it's safe to assume that VMK8055_DO_REG was meant as an
initial value.

And to avoid duplication we can move the assignments to the top.

Acked-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-13 09:33:38 -08:00
Cyril Roelandt b7e6724238 staging: tidspbridge: remove redundant NULL check before delete_msg_mgr().
delete_msg_mgr on a NULL pointer is a no-op, so the NULL check in
bridge_msg_delete can be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-13 08:46:48 -08:00
Cyril Roelandt ae87d63664 staging: dgrp: remove redundant NULL check before unregister_dgrp_device().
unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in
dgrp_remove_nd() can be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-13 08:46:48 -08:00
Dan Magenheimer 76426daf50 staging/zcache: Fix/improve zcache writeback code, tie to a config option
It was observed by Andrea Arcangeli in 2011 that zcache can get "full"
and there must be some way for compressed swap pages to be (uncompressed
and then) sent through to the backing swap disk.  A prototype of this
functionality, called "unuse", was added in 2012 as part of a major update
to zcache (aka "zcache2"), but was left unfinished due to the unfortunate
temporary fork of zcache.

This earlier version of the code had an unresolved memory leak
and was anyway dependent on not-yet-upstream frontswap and mm changes.
The code was meanwhile adapted by Seth Jennings for similar
functionality in zswap (which he calls "flush").  Seth also made some
clever simplifications which are herein ported back to zcache.  As a
result of those simplifications, the frontswap changes are no longer
necessary, but a slightly different (and simpler) set of mm changes are
still required [1].  The memory leak is also fixed.

Due to feedback from akpm in a zswap thread, this functionality in zcache
has now been renamed from "unuse" to "writeback".

Although this zcache writeback code now works, there are open questions
as how best to handle the policy that drives it.  As a result, this
patch also ties writeback to a new config option.  And, since the
code still depends on not-yet-upstreamed mm patches, to avoid build
problems, the config option added by this patch temporarily depends
on "BROKEN"; this config dependency can be removed in trees that
contain the necessary mm patches.

[1] https://lkml.org/lkml/2013/1/29/540/ https://lkml.org/lkml/2013/1/29/539/

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11 14:58:56 -08:00
Joe Perches 78110bb8dc staging: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11 10:10:33 -08:00
Greg Kroah-Hartman ad463ac427 4th set of IIO new drivers cleanups and fixes for the 3.9 cycle
+ a new spi helper function.
 
 1) Introduce spi_sync_transfer and use it within IIO.  Originally
    it was envisioned that this nice little boilerplate replacement
    would go through the spi tree, but Grant Likely stated he'd
    prefer we take it through IIO as the example usecases were all
    in IIO (and are also in this pull request).  Note that given
    their may have been some unresolved elements related to the
    coccinelle element of the patch, that has been stripped out
    and will doubtlessly follow at a later date (along with
    lots of other patches for drivers elsewhere in the tree).
 
 2) New Invensense MPU6050 driver.  This is stripped down to pretty
    much the basics from the original submission with the intent
    to build up all the fancy bits in an incremental (and hence
    reviewable fashion). It's been through a good few revisions
    so nice to finally merge this.
 
 3) Change to iio_channel_get api to simplify device tree based
    mappings.  The actual mappings are currently under review.
 
 4) Build fixes for !CONFIG_IIO_TRIGGER in the st_sensors driver.
    This one snuck past during review and testing but got picked
    up by Randy Dunlap in a randconfig build.
 
 5) Some max1363 cleanups and enhancements.
 
 6) Some comment fixes to make them coherent and comprehensible.
 
 7) Trivial build warning fix in mxs-lradc
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRF9/7AAoJEFSFNJnE9BaIYJgP+gMbD+knXpWm6o9VSO/mZ2O6
 TfpoZsLr8pZIXDbzqrNdO0lC8EYYzyukV3leCJAXhtVSZ3cvdWgjN99rouRcngKP
 0CchGTAzK9IpbyHzwG+Yjv5kkwTqF1u5OZmQDSdvTqvoKCIRgSYmS8MleOwJVWmR
 x9yO3ogmoPQQiPuFq8D/jm+0v3PfcepSjnTY3d24uNpbLqUjQ1vMLDNKf4Ipb+XD
 jykWVVxYet3+om6PuRLEHs7PeLoIsCY79xdh+43m00eoYel65rrqFzVeuEGUYgzl
 EMhiaZ4GU2EKe3xAgDLykYp2PO/WlvDrhlAfuCXnuuMBsAMl8aZ+da4cwT57Agd8
 D2XNvmLyPeLuHyQWtT68LqPsoXBCs1ZosfdHslJ2MbQcB6JSPvFShhUKmw3rL8wY
 ksp8sU37ouGpWLV2anGxMtVJHaglFrpt4TYO1QWfbRcKfsYJ2l28YJ0JtgJVF7D+
 G3GDOSsUtJNLSgc7WxbONw6BWeWq34nGQPRmHAgKOQkjLxzcK5WTu7GAs7gCpCLW
 JrK1bJ8+ai6HdVPKFzgLgRTi5IdUCLLFr19cQDnPoPViB0krv+58jtglpxF0ZbUH
 fK0OUh/F4CO2SX/bYCxqLPZ0TkUTwpxSF5+5rMcEtKW5FXMfvY6+rOLaHhJX5mu6
 q37/4gygKhbVdZVl1RO8
 =htuw
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-3.9d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

"4th set of IIO new drivers cleanups and fixes for the 3.9 cycle
+ a new spi helper function.

1) Introduce spi_sync_transfer and use it within IIO.  Originally
   it was envisioned that this nice little boilerplate replacement
   would go through the spi tree, but Grant Likely stated he'd
   prefer we take it through IIO as the example usecases were all
   in IIO (and are also in this pull request).  Note that given
   their may have been some unresolved elements related to the
   coccinelle element of the patch, that has been stripped out
   and will doubtlessly follow at a later date (along with
   lots of other patches for drivers elsewhere in the tree).

2) New Invensense MPU6050 driver.  This is stripped down to pretty
   much the basics from the original submission with the intent
   to build up all the fancy bits in an incremental (and hence
   reviewable fashion). It's been through a good few revisions
   so nice to finally merge this.

3) Change to iio_channel_get api to simplify device tree based
   mappings.  The actual mappings are currently under review.

4) Build fixes for !CONFIG_IIO_TRIGGER in the st_sensors driver.
   This one snuck past during review and testing but got picked
   up by Randy Dunlap in a randconfig build.

5) Some max1363 cleanups and enhancements.

6) Some comment fixes to make them coherent and comprehensible.

7) Trivial build warning fix in mxs-lradc"
2013-02-11 09:58:02 -08:00
Johannes Berg 5b112d3d09 cfg80211: pass wiphy to cfg80211_ref_bss/put_bss
This prepares for using the spinlock instead of krefs
which is needed in the next patch to track the refs
of combined BSSes correctly.

Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-11 18:44:52 +01:00
Lars-Peter Clausen ad6c46b0c7 staging:iio: Use spi_sync_transfer()
Use the new spi_sync_transfer() helper function instead of open-coding it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-09 11:10:43 +00:00
Fabio Estevam ad76fda783 iio: mxs-lradc: Fix 'duplicate const' warning
The following warning is generated by sparse:

drivers/staging/iio/adc/mxs-lradc.c:118:47: warning: duplicate const

Remove the duplicate const.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-09 10:52:31 +00:00
Aaro Koskinen 5305d74605 staging: xgifb: XGI_SetDelayComp(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:58 -08:00
Aaro Koskinen 22006839a2 staging: xgifb: XGI_GetCRT2ResInfo(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:58 -08:00
Aaro Koskinen 718e715d1a staging: xgifb: XGI_GetLCDInfo(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:58 -08:00
Aaro Koskinen a8b3529037 staging: xgifb: XGI_GetTVInfo(): delete IF_DEF_LVDS checks
This function is never called when pVBInfo->IF_DEF_LVDS is true, so we
can remove checks and reduce complexity.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:58 -08:00
Aaro Koskinen 1b149edfa3 staging: xgifb: XGI_GetVBInfo(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:57 -08:00
Aaro Koskinen 7ac54d0392 staging: xgifb: XGI_GetVCLK2Ptr(): delete IF_DEF_LVDS check
Delete IF_DEF_LVDS check, this function is never called when it's true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 15:39:57 -08:00
Fengguang Wu 1e927711c5 staging: zram: __zram_reset_device() can be static
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 12:20:22 -08:00
Tommi Rantala 900a72a6f2 staging: dgrp: prefix function names with dgrp_ in dgrp_specproc.c
Prefix the functions in dgrp_specproc.c to avoid ambiguity in backtraces, such
as the "info_proc_open" in this one:

unreferenced object 0xffff88003b6696e0 (size 32):
  comm "cat", pid 2321, jiffies 4294705179 (age 29.434s)
  hex dump (first 32 bytes):
    40 79 1c 81 ff ff ff ff 60 79 1c 81 ff ff ff ff  @y......`y......
    50 79 1c 81 ff ff ff ff b0 62 89 81 ff ff ff ff  Py.......b......
  backtrace:
    [<ffffffff81c7e3b1>] kmemleak_alloc+0x21/0x50
    [<ffffffff811955cb>] kmem_cache_alloc_trace+0x11b/0x190
    [<ffffffff811c87dc>] single_open+0x3c/0xc0
    [<ffffffff81896495>] info_proc_open+0x15/0x20
    [<ffffffff8120c6d7>] proc_reg_open+0xb7/0x160
    [<ffffffff811a1a5c>] do_dentry_open+0x1cc/0x280
    [<ffffffff811a296a>] finish_open+0x4a/0x60
    [<ffffffff811b14d7>] do_last+0xb07/0xdb0
    [<ffffffff811b1842>] path_openat+0xc2/0x4f0
    [<ffffffff811b1cac>] do_filp_open+0x3c/0xa0
    [<ffffffff811a2dcc>] do_sys_open+0x11c/0x1c0
    [<ffffffff811a2e8c>] sys_open+0x1c/0x20
    [<ffffffff81ca3d69>] system_call_fastpath+0x16/0x1b
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 12:17:52 -08:00
Tommi Rantala 69a7c50369 staging: dgrp: use correct release op for /proc/dgrp/info
Trinity (the syscall fuzzer) discovered that reading /proc/dgrp/info was
leaking some memory. Fix by using the correct release op in info_proc_file_ops.

unreferenced object 0xffff88003b6696e0 (size 32):
  comm "cat", pid 2321, jiffies 4294705179 (age 29.434s)
  hex dump (first 32 bytes):
    40 79 1c 81 ff ff ff ff 60 79 1c 81 ff ff ff ff  @y......`y......
    50 79 1c 81 ff ff ff ff b0 62 89 81 ff ff ff ff  Py.......b......
  backtrace:
    [<ffffffff81c7e3b1>] kmemleak_alloc+0x21/0x50
    [<ffffffff811955cb>] kmem_cache_alloc_trace+0x11b/0x190
    [<ffffffff811c87dc>] single_open+0x3c/0xc0
    [<ffffffff81896495>] info_proc_open+0x15/0x20
    [<ffffffff8120c6d7>] proc_reg_open+0xb7/0x160
    [<ffffffff811a1a5c>] do_dentry_open+0x1cc/0x280
    [<ffffffff811a296a>] finish_open+0x4a/0x60
    [<ffffffff811b14d7>] do_last+0xb07/0xdb0
    [<ffffffff811b1842>] path_openat+0xc2/0x4f0
    [<ffffffff811b1cac>] do_filp_open+0x3c/0xa0
    [<ffffffff811a2dcc>] do_sys_open+0x11c/0x1c0
    [<ffffffff811a2e8c>] sys_open+0x1c/0x20
    [<ffffffff81ca3d69>] system_call_fastpath+0x16/0x1b
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-08 12:17:52 -08:00
Peter Huewe 7d0ee461fd [media] staging/media/solo6x10: Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR
Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/ptr_ret.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-08 13:02:50 -02:00
Dave Airlie 6dc1c49da6 Merge branch 'fbcon-locking-fixes' of ssh://people.freedesktop.org/~airlied/linux into drm-next
This pulls in most of Linus tree up to -rc6, this fixes the worst lockdep
reported issues and re-enables fbcon lockdep.

(not the fbcon maintainer)
* 'fbcon-locking-fixes' of ssh://people.freedesktop.org/~airlied/linux: (529 commits)
  Revert "Revert "console: implement lockdep support for console_lock""
  fbcon: fix locking harder
  fb: Yet another band-aid for fixing lockdep mess
  fb: rework locking to fix lock ordering on takeover
2013-02-08 12:10:18 +10:00
Ian Abbott b12da2e433 staging: comedi: correct error message in comedi_alloc_subdevice_minor()
`comedi_alloc_subdevice_minors()` currently prints a message about
running out of minor numbers board device files if it runs out of minor
device numbers.  Change it to complain about running out of minor device
numbers for subdevice files as these are in a different range, not
shared with those for board device files.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 17:17:17 -08:00
Ian Abbott da7185462e staging: comedi: don't return minor from comedi_alloc_subdevice_minor()
`comedi_alloc_subdevice_minor()` currently returns the allocated minor
device number on success.  This is not really of any interest to the
caller (in fact the return value is not even checked), so just return 0
on success.  If the caller really needs to know the allocated minor
device number it can look in `s->minor`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 17:17:16 -08:00
Peter Huewe f6fcf7f79b staging/goldfish: Add MTD dependency to KCONFIG
If CONFIG_MTD is not set goldfish_nand fails to compile with the
following linker warnings:

drivers/built-in.o: In function `goldfish_nand_remove':
goldfish_nand.c:(.text+0x6e7d0e): undefined reference to
`mtd_device_unregister'
drivers/built-in.o: In function `goldfish_nand_erase':
goldfish_nand.c:(.text+0x6e8ba2): undefined reference to
`mtd_erase_callback'
drivers/built-in.o: In function `goldfish_nand_init_device':
goldfish_nand.c:(.text+0x6e8eba): undefined reference to
`mtd_device_parse_register'

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 17:16:07 -08:00
Peter Huewe b4fcf48a74 staging/goldfish: Use %zx for printing size_t variables
When building the driver, gcc emits the following warnings:
.../drivers/staging/goldfish/goldfish_nand.c:
In function 'goldfish_nand_read_oob':
goldfish_nand.c:159:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
goldfish_nand.c:159:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 4 has type 'size_t' [-Wformat]

In function 'goldfish_nand_write_oob':
goldfish_nand.c:191:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
goldfish_nand.c:191:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 4 has type 'size_t' [-Wformat]

In function 'goldfish_nand_read':
goldfish_nand.c:215:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]

In function 'goldfish_nand_write':
goldfish_nand.c:239:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]

-> As defined in the printk-formats use %zx for size_t variables

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 17:16:07 -08:00
H Hartley Sweeten 37fa328f06 staging: comedi: ni_daq_dio24: add back missing 'if (ret)'
The 'if (ret)' after calling comedi_pcmcia_enable() was accidentally
removed in:

Commit: 573a964882
staging: comedi: ni_daq_dio24: use comedi_pcmcia_{enable,disable}

Put if back so that dio24_auto_attach() can finish attaching to
the board after enabling the pcmcia device.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 13:59:26 -08:00
Aaro Koskinen d51d45da3e staging: xgifb: initialize register 3cc address
Commit 56810a92c6 (staging: xgifb: use
XGIRegInit()) left 3cc uninitialized, and it may trigger a panic during
probe. Fix this.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-07 13:59:25 -08:00
Clark Williams 8bd75c77b7 sched/rt: Move rt specific bits into new header file
Move rt scheduler definitions out of include/linux/sched.h into
new file include/linux/sched/rt.h

Signed-off-by: Clark Williams <williams@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20130207094707.7b9f825f@riff.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-02-07 20:51:08 +01:00
H Hartley Sweeten a9d50943b8 staging: comedi: quatech_daqp_cs: fix build error
The kbuild test robot reported a build error in this driver caused by:

commit: a3ac95195b
staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()

This commit changed the comedi_pcmcia_enable() function so that it now
takes two arguments. The new argument is an optional (*conf_check)
function that is passed to pcmcia_loop_config().

This driver uses the default (*conf_check) in comedi_pcmcia.c so just
pass a NULL as the second arg.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-06 13:39:38 -08:00
Dan Carpenter fb1e7b053a [media] staging: go7007: fix test for V4L2_STD_SECAM
The current test doesn't make a lot of sense.  It's likely to be true,
which is what we would want in most cases.  From looking at how this is
handled in other drivers,  I think "&" was intended instead of "*".
It's an easy mistake to make because they are next to each other on the
keyboard.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 09:05:30 -02:00
Peter Huewe 42f9de6eab [media] staging/media/go7007: Use kmemdup rather than duplicating its implementation
Found with coccicheck.
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 09:05:07 -02:00
Volokh Konstantin 0a147c3bf7 [media] staging: media: go7007: call_all stream stuff Some Additional stuff for v4l2_subdev stream events partial need for new style framework. Also need for wis_tw2804 notification stuff
Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 09:03:49 -02:00
Volokh Konstantin d18b6acfe2 [media] staging: media: go7007: i2c GPIO initialization Reset i2c stuff for GO7007_BOARDID_ADLINK_MPG24 need reset GPIO always when encoder initialize
Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 09:02:59 -02:00
Volokh Konstantin 7a295d1289 [media] staging: media: go7007: firmware protection Protection for unfirmware load
If no firmware was loaded (no exists,wrong or some error) then rmmod
fails with OOPS, so need some protection stuff.

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 09:01:11 -02:00
Volokh Konstantin 61a2353c70 [media] staging: media: go7007: memory clear fix memory clearing for v4l2_subdev allocation
Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 08:58:38 -02:00
H Hartley Sweeten 82e9ee616a staging: comedi: ni_mio_cs: use pcmcia_request_irq()
Use pcmcia_request_irq() instead of request_irq() to request the
shared irq for the PCMCIA device. This allows the PCMCIA core to
clean up the registration in pcmcia_disable_device().

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>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten 5cd8e85262 staging: comedi: ni_mio_cs: use comedi_pcmcia_{enable, disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver uses a local (*conf_check) to check the pcmcia_device
configuration.

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>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten a3ac95195b staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()
Allow comedi pcmcia drivers to use a custom conf_check() when calling
comedi_pcmcia_enable() to enable the pcmcia device. If a conf_check()
is not passed the internal comedi_pcmcia_conf_check() will be used.

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>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten 4f60f6b69c staging: comedi: ni_labpc_cs: use comedi_pcmcia_{enable,disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver is not an audio device, remove CONF_AUTO_AUDIO from
the link->config_flags.

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>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten 573a964882 staging: comedi: ni_daq_dio24: use comedi_pcmcia_{enable,disable}
Use the comedi_pcmcia_{enable,disable} helpers to enable/disable
the PCMCIA device.

This driver does not use interrupts and is not an audio device, remove
CONF_ENABLE_IRQ and CONF_AUTO_AUDIO from the link->config_flags.

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>
2013-02-05 18:16:19 -08:00
H Hartley Sweeten 66dbc7b1b0 staging: comedi: vmk80xx: rename vmk80xx_attach_common()
In comedi drivers typically *_attach_common() is used as the 'common'
part of the comedi_driver attach code for drivers that support various
bus types (ISA, PCI, etc.). This driver is specific to a USB device.

To avoid confusion when grepping, rename this function to something
more appropriate.

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>
2013-02-05 18:07:13 -08:00
H Hartley Sweeten 6dcbe00df7 staging: comedi: vmk80xx: remove the 'Changelog' comments
git history provides a better Changelog for the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:07:13 -08:00
H Hartley Sweeten f45787c687 staging: comedi: vmk80xx: cleanup the comedi_lrange tables
The vmk8055_range table is a duplicate of the comedi core provided
range_unipolar5 table. Use that instead.

For aesthetic reasons, clean up the formating of the vmk8061_range
table.

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>
2013-02-05 18:07:13 -08:00
H Hartley Sweeten 4c56a2b639 staging: comedi: vmk80xx: remove CONFIG_COMEDI_DEBUG code
If CONFIG_COMEDI_DEBUG is defined a macro is enabled to output some
printk(KERN_REBUG ...) messages. These are just added noise. Remove
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>
2013-02-05 18:07:13 -08:00
H Hartley Sweeten 6f25a527ea staging: comedi: vmk80xx: remove unused #define
This define is no longer used by the driver. Remove 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>
2013-02-05 18:07:13 -08:00
H Hartley Sweeten 0f97889c19 staging: comedi: vmk80xx: remove digital input (*insn_read)
The comedi core can use the (*insn_bits) function to emulate the
(*insn_read) function. Remove the unnecessary (*insn_read) function.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten a348b72eae staging: comedi: vmk80xx: remove digital output (*insn_write)
The comedi core can use the (*insn_bits) function to emulate the
(*insn_write) function. Remove the unnecessary (*insn_read)
function.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten 03754bdbb1 staging: comedi: vmk80xx: remove digital output (*insn_read)
The comedi core can use the (*insn_bits) function to emulate the
(*insn_read) function.

The digital output (*insn_bits) function properly handles the
VMK8061_MODEL to read the digital output states before returning.

Remove the unnecessary (*insn_read) function. It's also not
necessary to set the SDF_READABLE flag so remove the entire
conditional in the attach.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten 9a23a7481e staging: comedi: vmk80xx: cleanup pwm subdevice init
Change the 'pwm_bits' in the boardinfo to 'pwm_maxdata' so that the
calculation of s->maxdata can be removed. Also, change the type to
match the comedi_subdevice type. For aesthetic reasons, rename the
'pwm_chans' boardinfo and change its type also.

Remove the '0' values in the boardinfo.

Rename the (*insn_read) and (*insn_write) functions for the pwm
subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten 75a45d924d staging: comedi: vmk80xx: cleanup counter subdevice init
Change the 'cnt_bits' in the boardinfo to 'cnt_maxdata' so that the
calculation of s->maxdata can be removed. Also, change the type to
match the comedi_subdevice type. Add a comment about the '0' value
for DEVICE_VMK8061.

The s->maxdata should always be set for the subdevice. Move it out
of the conditional.

Rename the (*insn_read), (*insn_config_, and (*insn_write) functions
for the counter subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten b639e09608 staging: comedi: vmk80xx: cleanup digital input subdevice init
Remove the SDF_GROUND flag from s->subdev_flags. This flag only has
meaning for analog subdevices.

Add the missing s->range_table for the subdevice.

Rename the (*insn_write), (*insn_bits), and (*insn_read) functions
for the digital input subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten 268e5148aa staging: comedi: vmk80xx: cleanup digital input subdevice init
Change the type for the digital input 'di_chans' boardinfo to match
the comedi_subdevice type it is set to. For aesthetic reasons, rename
the variable also.

Remove the SDF_GROUND flag from s->subdev_flags. This flag only has
meaning for analog subdevices.

Add the missing s->range_table for the subdevice.

Rename the (*insn_read) and (*insn_bits) functions for the digital
input subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:12 -08:00
H Hartley Sweeten 8b3ec9f155 staging: comedi: vmk80xx: cleanup analog output subdevice init
Change the type for the analog output 'ao_chans' boardinfo to match
the comedi_subdevice type it is set to. For aesthetic reasons, rename
the variable also.

Rename the (*insn_write) and (*insn_read) functions for the analog
output subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten 658cd3ac2e staging: comedi: vmk80xx: cleanup analog input subdevice init
Change the 'ai_bits' in the boardinfo to 'ai_maxdata' so that the
calculation of s->maxdata can be removed.

Change the types for the analog input boardinfo to match the
comedi_subdevice types they are set to.

Rename the (*insn_read) function for the analog input subdevice from
vmk80xx_ai_rinsn to vmk80xx_ai_insn_read to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten 52d895d367 staging: comedi: vmk80xx: remove need for boardinfo in private_data
The only information in the boardinfo that is used outside of the
attach of the driver is the 'model' of the device.

Remove the 'board' pointer from the private data and replace it with
the 'model' enum and just copy that information over during the attach.

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten 57cf09aeee staging: comedi: vmk80xx: push usb (*probe) into comedi (*auto_attach)
Make the usb_driver (*probe) simply call comedi_usb_auto_config()
and move all the (*probe) code into the (*auto_attach) function.

This allows getting rid of the static private data array since we
no longer do part of the initialization in the (*probe) and then
finish it in the (*auto_attach). We can simply kzalloc the private
data instead. The comedi core will then handle the kfree of the
data when the driver is detached.

We can also get rid of the static 'glb_mutex' since this mutex was
only used to protect the static private data array.

Change the parameters for a couple of the helper functions used
during the auto attach. Now that the comedi_device is available
we can simply pass that pointer and get the specific pointers
needed by the helper functions from 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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten 55ab4f641a staging: comedi: comedi_usb: allow comedi usb drivers to pass a 'context'
Allow the comedi usb drivers to pass a 'context' from their (*probe)
functions to the comedi core's comedi_usb_auto_config(). This 'context'
is then passed to comedi_auto_config() and then to the comedi_driver's
(*auto_attach).

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten 29d6dd3310 staging: comedi: vmk80xx: remove private data 'attached'
The 'attached' flag in the private data is set after the comedi_driver
(*auto_attach) function has completed successfully.

The only places it's checked are in rudimentary_check(), which does
some basic sanity checks before doing any of the subdevice operations,
and vmk80xx_auto_attach(), which is the comedi_driver (*auto_attach)
function.

The (*auto_attach) function can only be called as the result of a
successfull usb_driver (*probe). Part of the probe is to locate a
free slot in the static private data array. All free slots are
initialized to '0' so the 'attached' flag will always be cleared.

Remove the unneccessary 'attached' flag in the private data.

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten b105ad8a78 staging: comedi: vmk80xx: remove private data 'probed'
The 'probed' variable is used in the usb driver (*probe) to detect an
unused element in the static private data arry. This variable is then
set after the usb driver has completed its (*probe) before calling
comedi_usb_auto_config(). When the comedi core does the auto config
it will call the (*auto_attach) function, vmk80xx_auto_attach(), which
then locates the correct private data in the static array by checking
to see if it has been 'probed' and that the 'intf' variable matches
the usb_interface pointer for the usb device.

Now that the private data is clean after failed usb probes and disconnects
we don't have to worry about have a garbage 'intf' value in the private
data that might match.

Remove the 'probed' flag from the private data and just use the 'intf'
pointer to detect the match.

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>
2013-02-05 18:07:11 -08:00
H Hartley Sweeten db7dabf707 staging: comedi: vmk80xx: make sure private data is clean when detached
Currently the private data used in this driver is stored in a static
array. During the usb (*probe) and empty location is found in this
array for use by the usb device. Some initialization of the private
data is then done before comedi_usb_auto_config() is called to allow
the comedi core to attach its comedi_device to the usb device.

The (*probe) can fail for various reasons. If it does, make sure that
the private data is clean before returning an error.

The usb (*disconnect) simply calls comedi_usb_auto_unconfig() to
allow the comedi core to disconnect its comedi_device from the usb
device. Since the private data points to the static array it cannot
be kfree'ed during the detach. Instead make sure it clean before
leaving the detach.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 18:07:10 -08:00
H Hartley Sweeten 1cc8f8854c staging: comedi: vmk80xx: remove private data 'count'
The 'count' in the private data is only used in a couple dev_info()
kernel messages. These messages are just added noise.

Remove the 'count' variable in the private data as well as the
dev_info() messages.

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>
2013-02-05 18:07:10 -08:00