platform/adaptation/renesas_rcar/renesas_kernel.git
11 years agostaging: et131x: Remove assignment of skb->dev
Mark Einon [Sat, 16 Feb 2013 19:12:00 +0000 (19:12 +0000)]
staging: et131x: Remove assignment of skb->dev

The call eth_type_trans() sets skb->dev to netdev, so there's
no needto set it before the call.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging: wlan-ng: hfa384x.h: fix for error reported by smatch
Kumar Amit Mehta [Sat, 16 Feb 2013 13:01:22 +0000 (05:01 -0800)]
staging: wlan-ng: hfa384x.h: fix for error reported by smatch

Add the missing header include for 'struct urb' datatypes to avoid
potential build issues. Found using smatch.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/zache checkpatch ERROR: spaces prohibited around that
Robert Berger [Sat, 16 Feb 2013 08:35:51 +0000 (10:35 +0200)]
staging/zache checkpatch ERROR: spaces prohibited around that

zbud.c:106: ERROR: spaces prohibited around that ':' (ctx:VxW)
zbud.c:107: ERROR: spaces prohibited around that ':' (ctx:VxW)

Signed-off-by: Robert Berger <rber.git@ReliableEmbeddedSystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/ozwpan: Mark read only parameters and structs as const
Peter Huewe [Fri, 15 Feb 2013 20:17:24 +0000 (21:17 +0100)]
staging/ozwpan: Mark read only parameters and structs as const

This patch marks function parameters that are used read only
as well as readonly structs (and corresponding pointers) as const.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
Peter Huewe [Fri, 15 Feb 2013 20:17:23 +0000 (21:17 +0100)]
staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat

oz_cdev_heartbeat is empty and unused -> safe to remove.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/ozwpan: Mark local functions as static (fix sparse warnings)
Peter Huewe [Fri, 15 Feb 2013 20:17:22 +0000 (21:17 +0100)]
staging/ozwpan: Mark local functions as static (fix sparse warnings)

sparse complains about the following functions

ozhcd.c:330:20: warning: symbol 'oz_uncancel_urb' was not declared.  Should it be static?
ozhcd.c:420:6: warning: symbol 'oz_complete_buffered_urb' was not declared. Should it be static?
ozmain.c:25:6: warning: symbol 'g_net_dev' was not declared. Should it be static?
ozevent.c:95:5: warning: symbol 'oz_events_open' was not declared.  Should it be static?
ozevent.c:110:5: warning: symbol 'oz_events_release' was not declared.  Should it be static?
ozevent.c:121:9: warning: symbol 'oz_events_read' was not declared.  Should it be static?
ozevent.c:160:30: warning: symbol 'oz_events_fops' was not declared.  Should it be static?
ozcdev.c:47:14: warning: symbol 'g_oz_class' was not declared. Should it be static?
ozcdev.c:74:5: warning: symbol 'oz_cdev_open' was not declared. Should it be static?
ozcdev.c:86:5: warning: symbol 'oz_cdev_release' was not declared.  Should it be static?
ozcdev.c:94:9: warning: symbol 'oz_cdev_read' was not declared. Should it be static?
ozcdev.c:146:9: warning: symbol 'oz_cdev_write' was not declared. Should it be static?
ozcdev.c:236:6: warning: symbol 'oz_cdev_ioctl' was not declared. Should it be static?
ozcdev.c:300:14: warning: symbol 'oz_cdev_poll' was not declared. Should it be static?
ozcdev.c:321:30: warning: symbol 'oz_fops' was not declared. Should it be static?
ozproto.c:958:6: warning: context imbalance in 'oz_polling_lock_bh' - wrong count at exit
ozproto.c:964:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock
ozusbsvc1.c:308:6: warning: symbol 'oz_usb_handle_ep_data' was not declared. Should it be static?
ozpd.c:410:6: warning: symbol 'oz_set_more_bit' was not declared. Should it be static?
ozpd.c:418:6: warning: symbol 'oz_set_last_pkt_nb' was not declared.  Should it be static?

-> add static keyword to silence the warning and make sparse happy.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/ozwpan: Add missing header includes
Peter Huewe [Fri, 15 Feb 2013 20:17:21 +0000 (21:17 +0100)]
staging/ozwpan: Add missing header includes

ozcdev.c and ozhcd.c should include their own header file, so sparse
knows which functions are declared and which not.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/usbip: Mark local functions as static (fix sparse warnings)
Peter Huewe [Fri, 15 Feb 2013 19:39:57 +0000 (20:39 +0100)]
staging/usbip: Mark local functions as static (fix sparse warnings)

sparse complains about these functions:
usbip/stub_dev.c:529:5: warning: symbol 'stub_pre_reset' was not declared. Should it be static?
usbip/stub_dev.c:535:5: warning: symbol 'stub_post_reset' was not declared. Should it be static?

-> add static keyword to silence the warning and make sparse happy.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/xgifb: Remove duplicated code in loops.
Peter Huewe [Fri, 15 Feb 2013 19:37:13 +0000 (20:37 +0100)]
staging/xgifb: Remove duplicated code in loops.

Instead of calling the same function three times in a loop, multiply the
loop counter by three.
And since the value in DAC_TEST_PARMS is always the same we can use the
value directly.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/xgifb: Consolidate return paths
Peter Huewe [Fri, 15 Feb 2013 19:37:12 +0000 (20:37 +0100)]
staging/xgifb: Consolidate return paths

Both branches of this if statement end in the same return statement.
-> move the return to the bottom and get rid of the else statement.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/xgifb: Remove code without effect
Peter Huewe [Fri, 15 Feb 2013 19:37:11 +0000 (20:37 +0100)]
staging/xgifb: Remove code without effect

The tempal variable is assigned and then immediately overwritten.
-> remove everything without effect.

The inb is kept for possible side effects.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 years agostaging/xgifb: Remove unnecessary casts
Peter Huewe [Fri, 15 Feb 2013 19:37:10 +0000 (20:37 +0100)]
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>
11 years agostaging/xgifb: Consolidate if/else if with identical code branches
Peter Huewe [Fri, 15 Feb 2013 19:37:09 +0000 (20:37 +0100)]
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>
11 years agostaging: vt6656: replaced custom TRUE definition with true
Andres More [Wed, 13 Feb 2013 01:36:30 +0000 (20:36 -0500)]
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>
11 years agostaging: vt6656: replaced custom FALSE definition with false
Andres More [Wed, 13 Feb 2013 01:36:29 +0000 (20:36 -0500)]
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>
11 years agostaging: vt6656: replace custom BOOL definition with bool
Andres More [Wed, 13 Feb 2013 01:36:28 +0000 (20:36 -0500)]
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>
11 years agostaging/rtl8187se: Mark functions as static to silence sparse
Peter Huewe [Wed, 13 Feb 2013 03:05:26 +0000 (04:05 +0100)]
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>
11 years agostaging/rtl8187se: Remove duplicated code by using an offset
Peter Huewe [Wed, 13 Feb 2013 03:05:25 +0000 (04:05 +0100)]
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>
11 years agostaging/rtl8187se: Remove unused functions PlatformIORead2Byte / PlatformIORead4Byte
Peter Huewe [Wed, 13 Feb 2013 03:05:24 +0000 (04:05 +0100)]
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>
11 years agostaging/rtl8187se: Remove temporary variable for return value
Peter Huewe [Wed, 13 Feb 2013 03:05:23 +0000 (04:05 +0100)]
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>
11 years agostaging/rtl8187se: Reuse ReadBBPortUchar to avoid duplicated code
Peter Huewe [Wed, 13 Feb 2013 03:05:22 +0000 (04:05 +0100)]
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>
11 years agostaging/rtl8187se: Remove unused/unnecessary variables
Peter Huewe [Wed, 13 Feb 2013 02:58:17 +0000 (03:58 +0100)]
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>
11 years agostaging/rtl8187se: Remove code without effect
Peter Huewe [Wed, 13 Feb 2013 02:58:16 +0000 (03:58 +0100)]
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>
11 years agostaging/rtl8187se: Remove code without effect
Peter Huewe [Wed, 13 Feb 2013 02:58:15 +0000 (03:58 +0100)]
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>
11 years agostaging/rtl8187se: Remove code without effect
Peter Huewe [Wed, 13 Feb 2013 02:58:14 +0000 (03:58 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozhcd.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:28 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozusbsvc.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:27 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:26 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozproto.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:25 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:24 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozusbsvc1.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:23 +0000 (15:22 +0100)]
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>
11 years agostaging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)
Peter Huewe [Fri, 15 Feb 2013 14:22:22 +0000 (15:22 +0100)]
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>
11 years agostaging/panel: Mark local functions/structs static and add const if applicable (fix...
Peter Huewe [Fri, 15 Feb 2013 12:47:05 +0000 (13:47 +0100)]
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>
11 years agostaging/comedi: Remove if(); statement without effect
Peter Huewe [Fri, 15 Feb 2013 12:14:26 +0000 (13:14 +0100)]
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>
11 years agostaging/comedi: Use && instead of & for logical comparision
Peter Huewe [Thu, 14 Feb 2013 21:27:06 +0000 (22:27 +0100)]
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>
11 years agostaging: comedi: vmk80xx: initialize K8055 outputs to known state
Ian Abbott [Thu, 14 Feb 2013 16:42:15 +0000 (16:42 +0000)]
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>
11 years agostaging: comedi: vmk80xx: simplify vmk80xx_reset_device()
Ian Abbott [Thu, 14 Feb 2013 16:42:14 +0000 (16:42 +0000)]
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>
11 years agostaging: comedi: vmk80xx: zero buffers on allocation
Ian Abbott [Thu, 14 Feb 2013 16:42:13 +0000 (16:42 +0000)]
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>
11 years agozcache/zbud: Fix __init mismatch
Konrad Rzeszutek Wilk [Fri, 15 Feb 2013 17:53:44 +0000 (12:53 -0500)]
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>
11 years agozbud: Fix compile warnings due to usage of debugfs_create_size_t
Konrad Rzeszutek Wilk [Fri, 15 Feb 2013 17:53:43 +0000 (12:53 -0500)]
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>
11 years agoramster: Fix compile warnings due to usage of debugfs_create_size_t
Konrad Rzeszutek Wilk [Fri, 15 Feb 2013 17:53:42 +0000 (12:53 -0500)]
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>
11 years agozcache: Fix compile warnings due to usage of debugfs_create_size_t
Konrad Rzeszutek Wilk [Fri, 15 Feb 2013 17:53:41 +0000 (12:53 -0500)]
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>
11 years agostaging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c
Peter Huewe [Thu, 14 Feb 2013 03:08:55 +0000 (04:08 +0100)]
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>
11 years agostaging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c
Peter Huewe [Thu, 14 Feb 2013 02:37:10 +0000 (03:37 +0100)]
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>
11 years agostaging: zcache: add TODO file
Dan Magenheimer [Wed, 13 Feb 2013 18:13:06 +0000 (10:13 -0800)]
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>
11 years agostaging/comedi: Fix undefined array subscript
Peter Huewe [Wed, 13 Feb 2013 14:28:14 +0000 (15:28 +0100)]
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>
11 years agostaging: tidspbridge: remove redundant NULL check before delete_msg_mgr().
Cyril Roelandt [Tue, 12 Feb 2013 04:01:52 +0000 (05:01 +0100)]
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>
11 years agostaging: dgrp: remove redundant NULL check before unregister_dgrp_device().
Cyril Roelandt [Tue, 12 Feb 2013 04:01:51 +0000 (05:01 +0100)]
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>
11 years agostaging/zcache: Fix/improve zcache writeback code, tie to a config option
Dan Magenheimer [Mon, 11 Feb 2013 22:07:22 +0000 (14:07 -0800)]
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>
11 years agostaging: Remove unnecessary OOM messages
Joe Perches [Mon, 11 Feb 2013 17:41:29 +0000 (09:41 -0800)]
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>
11 years agoMerge tag 'iio-for-3.9d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio...
Greg Kroah-Hartman [Mon, 11 Feb 2013 17:58:02 +0000 (09:58 -0800)]
Merge tag 'iio-for-3.9d' of git://git./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"

11 years agoInvensense MPU6050 Device Driver.
Ge Gao [Sat, 2 Feb 2013 00:26:00 +0000 (00:26 +0000)]
Invensense MPU6050 Device Driver.

This the basic functional Invensense MPU6050 Device driver.

Signed-off-by: Ge Gao <ggao@invensense.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio:st_sensors fix build when !CONFIG_IIO_TRIGGER
Jonathan Cameron [Sat, 9 Feb 2013 10:49:00 +0000 (10:49 +0000)]
iio:st_sensors fix build when !CONFIG_IIO_TRIGGER

Partly a case of removing unused headers and partly a case
of ifdefing out the iio_trigger_ops structures.  This has
come about because of an 'unusual' separation of code in this
driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
11 years agoiio:triggers Protect functions in triggers.h from use when not compiled
Jonathan Cameron [Sat, 9 Feb 2013 10:49:00 +0000 (10:49 +0000)]
iio:triggers Protect functions in triggers.h from use when not compiled

Also include a couple of forward defs of struct iio_trigger and struct
iio_trigger_ops to avoid doing this in each driver.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
11 years agostaging:iio: Use spi_sync_transfer()
Lars-Peter Clausen [Wed, 9 Jan 2013 17:31:00 +0000 (17:31 +0000)]
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>
11 years agoiio: Use spi_sync_transfer()
Lars-Peter Clausen [Wed, 9 Jan 2013 17:31:00 +0000 (17:31 +0000)]
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>
11 years agospi: Add helper functions for setting up transfers
Lars-Peter Clausen [Wed, 9 Jan 2013 17:31:00 +0000 (17:31 +0000)]
spi: Add helper functions for setting up transfers

Quite often the pattern used for setting up and transferring a synchronous SPI
transaction looks very much like the following:

struct spi_message msg;
struct spi_transfer xfers[] = {
...
};

spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
...
spi_message_add_tail(&xfers[ARRAY_SIZE(xfers) - 1], &msg);

ret = spi_sync(&msg);

This patch adds two new helper functions for handling this case. The first
helper function spi_message_init_with_transfers() takes a spi_message and an
array of spi_transfers. It will initialize the message and then call
spi_message_add_tail() for each transfer in the array. E.g. the following

spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
...
spi_message_add_tail(&xfers[ARRAY_SIZE(xfers) - 1], &msg);

can be rewritten as

spi_message_init_with_transfers(&msg, xfers, ARRAY_SIZE(xfers));

The second function spi_sync_transfer() takes a SPI device and an array of
spi_transfers. It will allocate a new spi_message (on the stack) and add all
transfers in the array to the message. Finally it will call spi_sync() on the
message.

E.g. the follwing

struct spi_message msg;
struct spi_transfer xfers[] = {
...
};

spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
...
spi_message_add_tail(&xfers[ARRAY_SIZE(xfers) - 1], &msg);

ret = spi_sync(spi, &msg);

can be rewritten as

struct spi_transfer xfers[] = {
...
};

ret = spi_sync_transfer(spi, xfers, ARRAY_SIZE(xfers));

A coccinelle script to find such instances will follow.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: mxs-lradc: Fix 'duplicate const' warning
Fabio Estevam [Wed, 6 Feb 2013 02:54:00 +0000 (02:54 +0000)]
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>
11 years agoiio:common: added allocate and deallocate trigger functions when trigger is disabled.
Denis CIOCCA [Thu, 7 Feb 2013 09:46:00 +0000 (09:46 +0000)]
iio:common: added allocate and deallocate trigger functions when trigger is disabled.

This patch resolve a bugfix when driver is compiled without trigger.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: xgifb: XGI_SetDelayComp(): delete IF_DEF_LVDS check
Aaro Koskinen [Fri, 8 Feb 2013 22:03:48 +0000 (00:03 +0200)]
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>
11 years agostaging: xgifb: XGI_GetCRT2ResInfo(): delete IF_DEF_LVDS check
Aaro Koskinen [Fri, 8 Feb 2013 22:03:47 +0000 (00:03 +0200)]
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>
11 years agostaging: xgifb: XGI_GetLCDInfo(): delete IF_DEF_LVDS check
Aaro Koskinen [Fri, 8 Feb 2013 22:03:46 +0000 (00:03 +0200)]
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>
11 years agostaging: xgifb: XGI_GetTVInfo(): delete IF_DEF_LVDS checks
Aaro Koskinen [Fri, 8 Feb 2013 22:03:45 +0000 (00:03 +0200)]
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>
11 years agostaging: xgifb: XGI_GetVBInfo(): delete IF_DEF_LVDS check
Aaro Koskinen [Fri, 8 Feb 2013 22:03:44 +0000 (00:03 +0200)]
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>
11 years agostaging: xgifb: XGI_GetVCLK2Ptr(): delete IF_DEF_LVDS check
Aaro Koskinen [Fri, 8 Feb 2013 22:03:43 +0000 (00:03 +0200)]
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>
11 years agostaging: zram: __zram_reset_device() can be static
Fengguang Wu [Fri, 8 Feb 2013 02:15:10 +0000 (10:15 +0800)]
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>
11 years agostaging: dgrp: prefix function names with dgrp_ in dgrp_specproc.c
Tommi Rantala [Fri, 8 Feb 2013 11:41:26 +0000 (13:41 +0200)]
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>
11 years agostaging: dgrp: use correct release op for /proc/dgrp/info
Tommi Rantala [Fri, 8 Feb 2013 11:41:25 +0000 (13:41 +0200)]
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>
11 years agostaging: comedi: correct error message in comedi_alloc_subdevice_minor()
Ian Abbott [Thu, 7 Feb 2013 16:03:01 +0000 (16:03 +0000)]
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>
11 years agostaging: comedi: don't return minor from comedi_alloc_subdevice_minor()
Ian Abbott [Thu, 7 Feb 2013 16:03:00 +0000 (16:03 +0000)]
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>
11 years agostaging/goldfish: Add MTD dependency to KCONFIG
Peter Huewe [Thu, 7 Feb 2013 22:46:38 +0000 (23:46 +0100)]
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>
11 years agostaging/goldfish: Use %zx for printing size_t variables
Peter Huewe [Thu, 7 Feb 2013 22:57:07 +0000 (23:57 +0100)]
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>
11 years agostaging: comedi: ni_daq_dio24: add back missing 'if (ret)'
H Hartley Sweeten [Thu, 7 Feb 2013 20:27:10 +0000 (13:27 -0700)]
staging: comedi: ni_daq_dio24: add back missing 'if (ret)'

The 'if (ret)' after calling comedi_pcmcia_enable() was accidentally
removed in:

Commit: 573a964882065f9b2cb71db8a225ba067b4b5b7a
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>
11 years agostaging: xgifb: initialize register 3cc address
Aaro Koskinen [Thu, 7 Feb 2013 16:45:40 +0000 (18:45 +0200)]
staging: xgifb: initialize register 3cc address

Commit 56810a92c689c64d586a51a1078c5d307b24e8eb (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>
11 years agostaging: comedi: quatech_daqp_cs: fix build error
H Hartley Sweeten [Wed, 6 Feb 2013 21:12:07 +0000 (14:12 -0700)]
staging: comedi: quatech_daqp_cs: fix build error

The kbuild test robot reported a build error in this driver caused by:

commit: a3ac95195b020a0a8fa2a9b0649145324ba64c83
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>
11 years agoiio: Update iio_channel_get API to use consumer device pointer as argument
Guenter Roeck [Mon, 4 Feb 2013 20:26:00 +0000 (20:26 +0000)]
iio: Update iio_channel_get API to use consumer device pointer as argument

For iio_channel_get to work with OF based configurations, it needs the
consumer device pointer instead of the consumer device name as argument.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Anton Vorontsov <anton@enomsg.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: tweak language in industrialio-trigger comments
Peter Meerwald [Mon, 4 Feb 2013 11:36:00 +0000 (11:36 +0000)]
iio: tweak language in industrialio-trigger comments

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio/adc: (max1363) Add support for external reference voltage
Guenter Roeck [Sun, 3 Feb 2013 00:59:00 +0000 (00:59 +0000)]
iio/adc: (max1363) Add support for external reference voltage

Implement external reference voltage as regulator named "vref".

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agoiio: max1363: Use devm_ functions whereever possible to allocate resources
Guenter Roeck [Sun, 3 Feb 2013 00:59:00 +0000 (00:59 +0000)]
iio: max1363: Use devm_ functions whereever possible to allocate resources

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
11 years agostaging: comedi: ni_mio_cs: use pcmcia_request_irq()
H Hartley Sweeten [Wed, 6 Feb 2013 01:16:53 +0000 (18:16 -0700)]
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>
11 years agostaging: comedi: ni_mio_cs: use comedi_pcmcia_{enable, disable}
H Hartley Sweeten [Wed, 6 Feb 2013 01:16:28 +0000 (18:16 -0700)]
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>
11 years agostaging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check()
H Hartley Sweeten [Wed, 6 Feb 2013 01:16:07 +0000 (18:16 -0700)]
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>
11 years agostaging: comedi: ni_labpc_cs: use comedi_pcmcia_{enable,disable}
H Hartley Sweeten [Wed, 6 Feb 2013 01:15:42 +0000 (18:15 -0700)]
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>
11 years agostaging: comedi: ni_daq_dio24: use comedi_pcmcia_{enable,disable}
H Hartley Sweeten [Wed, 6 Feb 2013 01:15:20 +0000 (18:15 -0700)]
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>
11 years agostaging: comedi: vmk80xx: rename vmk80xx_attach_common()
H Hartley Sweeten [Wed, 6 Feb 2013 00:31:10 +0000 (17:31 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove the 'Changelog' comments
H Hartley Sweeten [Wed, 6 Feb 2013 00:30:48 +0000 (17:30 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup the comedi_lrange tables
H Hartley Sweeten [Wed, 6 Feb 2013 00:30:21 +0000 (17:30 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove CONFIG_COMEDI_DEBUG code
H Hartley Sweeten [Wed, 6 Feb 2013 00:30:01 +0000 (17:30 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove unused #define
H Hartley Sweeten [Wed, 6 Feb 2013 00:29:35 +0000 (17:29 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove digital input (*insn_read)
H Hartley Sweeten [Wed, 6 Feb 2013 00:29:13 +0000 (17:29 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove digital output (*insn_write)
H Hartley Sweeten [Wed, 6 Feb 2013 00:28:51 +0000 (17:28 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove digital output (*insn_read)
H Hartley Sweeten [Wed, 6 Feb 2013 00:28:27 +0000 (17:28 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup pwm subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:27:56 +0000 (17:27 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup counter subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:27:37 +0000 (17:27 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup digital input subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:25:49 +0000 (17:25 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup digital input subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:25:28 +0000 (17:25 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup analog output subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:25:07 +0000 (17:25 -0700)]
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>
11 years agostaging: comedi: vmk80xx: cleanup analog input subdevice init
H Hartley Sweeten [Wed, 6 Feb 2013 00:24:45 +0000 (17:24 -0700)]
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>
11 years agostaging: comedi: vmk80xx: remove need for boardinfo in private_data
H Hartley Sweeten [Wed, 6 Feb 2013 00:24:24 +0000 (17:24 -0700)]
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>
11 years agostaging: comedi: vmk80xx: push usb (*probe) into comedi (*auto_attach)
H Hartley Sweeten [Wed, 6 Feb 2013 00:24:03 +0000 (17:24 -0700)]
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>