Randy Dunlap [Mon, 8 Aug 2011 18:31:48 +0000 (11:31 -0700)]
staging: fix ft1000 sparse warnings
Fix sparse warnings in staging/ft1000/:
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:69:7: warning: obsolete struct initializer, use C99 syntax
and make many functions & data static. Examples:
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:65:23: warning: symbol 'fw_entry' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:836:6: warning: symbol 'ft1000_send_cmd' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:1014:6: warning: symbol 'ft1000_proc_drvmsg' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:1788:5: warning: symbol 'ft1000_copy_down_pkt' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2096:6: warning: symbol 'stop_ft1000_card' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c:2155:19: warning: symbol 'init_ft1000_card' was not declared. Should it be static?
rivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c:172:5: warning: symbol 'ft1000_confcheck' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:50:5: warning: symbol 'ft1000ReadProc' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:194:6: warning: symbol 'ft1000InitProc' was not declared. Should it be static?
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:207:6: warning: symbol 'ft1000CleanupProc' was not declared. Should it be static?
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...kfree(x)...+> }
when any
when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
when forall
(
return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kevin McKinney [Tue, 16 Aug 2011 02:10:12 +0000 (22:10 -0400)]
Staging: bcm: Fix a coding style error reported by checkpatch.pl
Tool checkpatch.pl reported the following error: extern struct class *bcm_class;"
declaration not allowed in .c files. Therefore, I move this declaration into
the header "headers.h" file.
Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
daemonize() is only needed when a user-space task does kernel_thread().
r8712_cmd_thread() is kthread_create()'ed and thus it doesn't need
the soon-to-be-deprecated daemonize(). It is the only caller of
thread_enter() which actually does the call.
Note:
- we are going to remove the sigdelset(blocked) code from
allow_signal(), this means that without this patch
thread_enter() can't work after that. Not to mention
daemonize() should be deprecated.
- as a side effect, this patch changes ->comm. Hopefully
this is fine, and padapter->pnetdev->name probably makes
more sense anyway.
Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Matt Fleming <matt.fleming@intel.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-and-tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Manohar Vanga [Fri, 12 Aug 2011 10:30:48 +0000 (12:30 +0200)]
staging: vme: keep track of registered buses
This patch adds a list which keeps track of all registered VME
buses. This is required for adding refcounting later to bridge
modules, something that is not currently implemented.
This is based on the changes introduced by Emilio G. Cota in the
patch:
Manohar Vanga [Wed, 10 Aug 2011 09:33:46 +0000 (11:33 +0200)]
staging: vme: make [alloc|free]_consistent bridge specific
Make PCI dependent functions ([alloc|free]_consistent() in
'vme.c') bridge specific. By removing the dependency of the
VME bridge framework on PCI, this patch allows for addition of
non-PCI based VME bridges.
Seth Jennings [Mon, 22 Aug 2011 19:30:38 +0000 (14:30 -0500)]
staging: zcache: fix possible sleep under lock
zcache_new_pool() calls kmalloc() with GFP_KERNEL which has
__GFP_WAIT set. However, zcache_new_pool() gets called on
a stack that holds the swap_lock spinlock, leading to a
possible sleep-with-lock situation. The lock is obtained
in enable_swap_info().
Jesper Juhl [Fri, 12 Aug 2011 22:53:07 +0000 (00:53 +0200)]
drivers/staging/rtl8192u: Don't pass huge struct by value
struct ieee80211_network is fairly large (more than half a kilobyte),
so let's pass a pointer instead of passing the entire structure by
value when ieee80211_is_54g() and ieee80211_is_shortslot() need to
look at a few members.
Also remove parentheses around the values being returned from those
two functions - 'return' is not a function.
Jesper Juhl [Fri, 12 Aug 2011 22:51:40 +0000 (00:51 +0200)]
drivers/staging/rtl8187se: Don't pass huge struct by value
struct ieee80211_network is fairly large (more than half a kilobyte),
so let's pass a pointer instead of passing the entire structure by
value when ieee80211_is_54g() and ieee80211_is_shortslot() need to
look at a few members.
Also remove parentheses around the values being returned from those
two functions - 'return' is not a function.
Andres Salomon [Fri, 22 Jul 2011 03:38:01 +0000 (20:38 -0700)]
staging: olpc_dcon: replace remaining calls to i2c_smbus_read/write
Use dcon_read and dcon_write; shorter, and understands the dcon_priv
struct. This transition was started long ago. This converts the
last few i2c_smbus_* callers.
Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andres Salomon [Fri, 22 Jul 2011 03:37:43 +0000 (20:37 -0700)]
staging: olpc_dcon: remove noinit module variable
This came from Jordan's original 2007 gxfb_dcon commit. I've never
seen or heard of it actually being used. Presumably it was once
useful for skipping hardware initialization when reloading the module
over and over during driver development..
Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Kalle Valo [Fri, 12 Aug 2011 19:08:00 +0000 (22:08 +0300)]
staging: remove ath6kl
ath6kl is now in drivers/net/wireless/ath so the staging driver
is not supported anymore and should be removed.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
IIO: ADC: New driver for AD7190/AD7192/AD7195 4 Channel SPI ADC
New driver for AD7190/AD7192/AD7195 4.8 kHz, Ultralow Noise, 24-Bit
Sigma-Delta ADC with PGA
These devices features a dual use data out ready DOUT/RDY output.
In order to avoid contentions on the SPI bus, it's necessary to use
spi bus locking. The DOUT/RDY output must also be wired to an
interrupt capable GPIO.
In INDIO_RING_TRIGGERED mode, this driver may block its SPI bus segment
for an extended period of time.
Changes since V1:
Add missing documentation.
Remove obsoleted include files.
Fix typos and style issues.
Fix buffer size.
Split ad7192_show() into two functions.
Avoid race condition add mutex.
Abandon IIO_CHAN macro.
Reorder elements in ad7192_platform_data.
Remove driver bus type.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Grant Grundler [Tue, 9 Aug 2011 22:18:14 +0000 (15:18 -0700)]
STAGING:iio:light: fix ISL29018 init to handle brownout
After a voltage brownout, sensor will now operate correctly.
Page 10 of ISL29018 data sheet and the Intersil Application Note 1534
describe the required initialization sequence:
1. Write 0x00 to register 0x08 (TEST)
2. Write 0x00 to register 0x00 (CMD1)
3. msleep(1)
4. program remaining registers as before
Signed-off-by: Grant Grundler <grundler@chromium.org> Reviewed-by: Bryan Freed <bfreed@chromium.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
iio: impedance-analyzer: New driver for AD5933/4 Impedance Converter, Network Analyzer
The AD5933 is a high precision impedance converter system solution
that combines an on-board frequency generator with a 12-bit, 1 MSPS,
analog-to-digital converter (ADC). The frequency generator allows an
external complex impedance to be excited with a known frequency.
The response signal from the impedance is sampled by the on-board ADC
and a discrete Fourier transform (DFT) is processed by an on-chip DSP engine.
The DFT algorithm returns a real (R) and imaginary (I) data-word at each
output frequency.
Changes since V1:
Apply list review feedback:
Consistently use poll_time_jiffies.
Use be|le cpu endian helpers where applicable.
Add various comments.
Changes since V2:
Fix KernelVersion tag in Documentation.
Declare ad5933_default_pdata static.
Fix typos.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
iio: adc: New driver for AD7280A Lithium Ion Battery Monitoring System
The AD7280A monitoring system contains all the functions required for
general purpose monitoring and maintenance of stacked
lithium ion batteries as used in hybrid electric vehicles,
battery backup applications, etc.
Changes since V1:
Make cell channels all type IIO_IN_DIFF, update documentation accordingly.
Remove unused and redundant defines.
Use SI units where applicable.
Remove unnecessary wrapper function.
Remove redundant initialization.
Add comments where requested.
Revise event handler.
Use const where applicable.
Changes since V2:
Remove redundant adc.h include file, scheduled for removal.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:56:04 +0000 (17:56 +0100)]
staging:iio:events: use IIO_<TYPE> and IIO_MOD_<> instead of IIO_EV_CLASS_<TYPE> etc
The original definitions were duplicated to reduce tree churn during introduction of chan_spec
registration. Now there is no point in maintaining the two sets of definitions.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:48:03 +0000 (17:48 +0100)]
staging:iio:magnetometer:ak8975 convert to iio_chan_spec + cleanups.
iio_chan_spec conversion is straight forward.
Other changes:
* use i2c_smbus_write_byte_data in write_data
* c99 isms to setup various structures.
* move the comment about the scale factor and kill off trivial access func.
* make mode setting code use a bool rather than a ulong.
Ultimately I'd like to get rid of that mode bit entirely and handle it through
core pm routines, but have left it for now.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:48:01 +0000 (17:48 +0100)]
staging:iio:accel:adis16204: use peak_raw info_mask element + push some defs down from header.
Currently this is the only driver using some of the defines in accel.h.
If these become common we'll just add them to the channel_spec options,
for now push down into this driver.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:08:53 +0000 (17:08 +0100)]
staging:iio: Remove deprecated dev_data from iio_dev.
The equivalent should always be done using iio_alllocate_device
with to create a private area for the driver and then iio_priv
to access it. There may be other uses for a private data pointer
but right now it just leads driver writers astray.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:08:41 +0000 (17:08 +0100)]
staging:iio:gyro:adis16130 drop control of adc resolution.
There is no clear use case for this functionality in a driver
that only supports slow reading via sysfs. The interface
use was non compliant with the abi motiving it being dropped.
It can go back in if anyone ever implements buffered reading
support for this device. Then it will be controlled as
part of the buffering abi where this should indeed be correctly
supported.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 16:08:38 +0000 (17:08 +0100)]
staging:iio:triggers introduce iio_trigger_ops to take const bits out of iio_trig_structure.
Right now this results in increased code, but I still think it is worth doing to avoid
replication across instances of drivers etc and move as much stuff as possible to constant.
Ops structure is optional for the occasional driver that uses none of it (currently
only the ad7793).
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Fri, 12 Aug 2011 15:55:30 +0000 (16:55 +0100)]
staging:iio:core simplify and fix a bug in iio_device_(un)register_event_set.
The unwinding index was j, not i and it is much simpler to do these as a single
loop unwinding those elements necessary in before jumping to the error handler.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>