Commit Graph

11157 Commits (5e8e19bf6c3c9d8ecf74e2a7fdae99a76949bdf6)

Author SHA1 Message Date
Bryan Freed 014fcb1db5 iio: light sensor: Improve granularity of tsl2583 lux values.
When illuminance0_calibbias gets 4000 (for a 4x multiplier), we see lux
granularity of 4.  Reversing the order of the right shift and multiplication
retains the precision of the unadjusted lux value.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 11:30:24 -08:00
Andreas Ruprecht d666c0d490 Staging: iio/accel: Added a range check for val in store_measurement_mode()
In sca3000_store_measurement_mode() we use val to and it with a mask.
This mask is only two bits long (as we are only interested in the
lowest two bits), so a value bigger than 3 was silently ignored so
far.

Now this function will return -EINVAL, if val is bigger than 3.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 11:30:24 -08:00
Andreas Ruprecht bba42776f5 Staging: iio/accel: Changed data type of mask in store_measurement_mode() to u8
In sca3000_store_measurement_mode() we parse a value from a string
buffer via kstrtou8, and store the parsed value into a u8 after
and-ing it with mask.

As we are only interested in the lowest two bits here and mask is
initialized with a fixed value 0x03, mask may as well be a u8.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 11:30:23 -08:00
David Daney af866496c7 MIPS: Octeon: Move some Ethernet support files out of staging.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Patchwork: https://patchwork.linux-mips.org/patch/2942/
Patchwork: https://patchwork.linux-mips.org/patch/3012/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-12-07 22:03:28 +00:00
Linus Torvalds f9143eae10 Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  Staging: comedi: fix integer overflow in do_insnlist_ioctl()
  Revert "Staging: comedi: integer overflow in do_insnlist_ioctl()"
  Staging: comedi: integer overflow in do_insnlist_ioctl()
  Staging: comedi: fix signal handling in read and write
  Staging: comedi: fix mmap_count
  staging: comedi: fix oops for USB DAQ devices.
  staging: comedi: usbduxsigma: Fixed wrong range for the analogue channel.
  staging:rts_pstor:Complete scanning_done variable
  staging: usbip: bugfix for deadlock
2011-12-02 13:30:25 -08:00
Justin P. Mattock 42b2aa86c6 treewide: Fix typos in various parts of the kernel, and fix some comments.
The below patch fixes some typos in various parts of the kernel, as well as fixes some comments.
Please let me know if I missed anything, and I will try to get it changed and resent.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-12-02 14:57:31 +01:00
Greg Kroah-Hartman 0c9d196462 Staging: hv: update TODO file
Hank is no longer at Microsoft, so remove his email address as it
bounces.

Cc: KY Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:38:42 -08:00
Greg Kroah-Hartman fe17a8c009 Staging: hv: remove hv_mouse driver as it's now in the hid directory
This removes the hv_mouse driver as it's now in Jiri's HID tree in the
"proper" place.

Cc: KY Srinivasan <kys@microsoft.com>
Cc: Jiri Kosina <jikos@jikos.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:37:09 -08:00
Martyn Welch 6af04b065b Staging: VME: Remove typedefs
The use of typedefs is discouraged, remove them.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:28:00 -08:00
K. Y. Srinivasan ce3e301c44 Staging: hv: storvsc: Implement per device memory pools
The current code implemented a per-HBA memory pool mechanism. For IDE disks
managed by this driver, there is a one to one correspondance between the
block device and the associated virtual HBA and since currently only IDE devices
can be the boot device, this addressed the deadlock issues that were raised during
the review process. This patch implements a per-lun memory pool mechanism.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:27:00 -08:00
K. Y. Srinivasan 10c43dd4c4 Staging: hv: storvsc: Fix a bug in copy_from_bounce_buffer()
Fix a bug in copy_from_bounce_buffer().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:27:00 -08:00
K. Y. Srinivasan a768a76d55 Staging: hv: storvsc: Fix a bug in storvsc_command_completion()
Fix a bug in storvsc_command_completion() that leaks memory when scatter/gather
lists are used on the "write" side.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:27:00 -08:00
K. Y. Srinivasan 2781866484 Staging: hv: storvsc: Cleanup storvsc_device_alloc()
The code in storvsc_device_alloc() is not needed as this would be
done by default. Get rid of it. We still keep the function as we use
this hook to allocate per-LUN memory pools in a later patch.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:26:59 -08:00
K. Y. Srinivasan 039db52de9 Staging: hv: storvsc: Disable clustering
Disable clustering, since the host side on Hyper-V requires that
each I/O element not exceed the page size. As part of this
cleanup, get rid of the function to merge bvecs, as the primary
reason for this function was to avoid having an element exceed
the page size.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:26:59 -08:00
Dan Carpenter 4bd8b4de6f Staging: line6: NULL dereference in dev_err()
"line6" hasn't been set at this point and we should be using
&interface->dev instead.

Gcc would have complained about this if it weren't for the fact that we
initialized line6 to NULL.  I removed the initialization.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:57:32 -08:00
K. Y. Srinivasan f75c051078 Staging: hv: mousevsc: Properly add the hid device
We need to properly add the hid device to correctly initialize the
sysfs state. While this patch is against the staging tree; Jiri,
please pick up this patch as you merge the Hyper-V mouse driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Fuzhou Chen <fuzhouch@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:57:32 -08:00
Mathieu Desnoyers 0dcbcbb49e staging: lttng: cleanup one-bit signed bitfields
* Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Sparse complains that these signed bitfields look "dubious".  The
> problem is that instead of being either 0 or 1 like people would expect,
> signed one bit variables like this are either 0 or -1.  It doesn't cause
> a problem in this case but it's ugly so lets fix them.

* walter harms (wharms@bfs.de) wrote:
> hi,
> This patch looks ok to me but this design is ugly by itself.
> It should be replaced by an uchar uint whatever or use a
> real bool (obviously not preferred by this programmes).

bool :1, uchar :1 or uint :1 could make sense. uchar:1/bool:1 won't save
any space here, because the surrounding fields are either uint or
pointers, so alignment will just add padding.

I try to use int/uint whenever possible because x86 CPUs tend to get
less register false-dependencies when using instructions modifying the
whole register (generated by using int/uint types) rather than only part
of it (uchar/char/bool). I only use char/uchar/bool when there is a
clear wanted space gain.

The reason why I never use the bool type within a structure when I want
a compact representation is that bool takes a whole byte just to
represent one bit:

struct usebitfield {
    int a;
    unsigned int f:1, g:1, h:1, i:1, j:1;
    int b;
};

struct usebool {
    int a;
    bool f, g, h, i, j;
    int b;
};

struct useboolbf {
    int a;
    bool f:1, g:1, h:1, i:1, j:1;
    int b;
};

int main()
{
    printf("bitfield %d bytes, bool %d bytes, boolbitfield %d bytes\n",
            sizeof(struct usebitfield), sizeof(struct usebool),
            sizeof(struct useboolbf));
}

result:

bitfield 12 bytes, bool 16 bytes, boolbitfield 12 bytes

This is because each bool takes one byte, while the bitfields are put in
units of "unsigned int" (or bool for the 3rd struct). So in this
example, we need 5 bytes + 3 bytes alignment for the bool, but only 4
bytes to hold the "unsigned int" unit for the bitfields.

The choice between bool and bitfields must also take into account the
frequency of access to the variable, because bitfields require mask
operations to access the selected bit(s). You will notice that none of
these bitfields are accessed on the tracing fast-path: only in
slow-paths. Therefore, space gain is more important than speed here.

One might argue that I have so few of these fields here that it does not
make an actual difference to go for bitfield or bool. I am just trying
to choose types best suited for their intended purpose, ensuring they
are future-proof and will allow simply adding more fields using the same
type, as needed.

So I guess I'll go for uint :1.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:57:31 -08:00
Mathieu Desnoyers 91c0a213f1 lttng wrapper: add missing include to kallsyms wrapper
Needed to keep bissectability.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:51:42 -08:00
Mathieu Desnoyers eeb34e2113 lttng lib: ring buffer move null pointer check to open
* Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The patch c844b2f5cfea: "lttng lib: ring buffer" from Nov 28, 2011,
> leads to the following Smatch complaint:
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c +86
> +lib_ring_buffer_mmap_buf()
>          warn: variable dereferenced before check 'buf' (see line 79)
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c
>     78          unsigned long length = vma->vm_end - vma->vm_start;
>     79          struct channel *chan = buf->backend.chan;
>                                        ^^^^^^^^^^^^^^^^^
> Dereference.
>
>     80          const struct lib_ring_buffer_config *config = chan->backend.config;
>     81          unsigned long mmap_buf_len;
>     82
>     83          if (config->output != RING_BUFFER_MMAP)
>     84                  return -EINVAL;
>     85
>     86          if (!buf)
>                     ^^^^
> Check.
>
>     87                  return -EBADF;
>     88

Let's move the NULL buf check to the file "open", where it belongs. The
"open" file operation is the actual interface between lib ring buffer
and the modules using it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:37:48 -08:00
Mathieu Desnoyers e5f7787388 lttng lib: ring buffer remove duplicate null pointer
* Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The patch c844b2f5cfea: "lttng lib: ring buffer" from Nov 28, 2011,
> leads to the following Smatch complaint:
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c +33
> +lib_ring_buffer_fault()
>          warn: variable dereferenced before check 'buf' (see line 26)
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c
>     25          struct lib_ring_buffer *buf = vma->vm_private_data;
>     26          struct channel *chan = buf->backend.chan;
>                                        ^^^^^^^^^^^^^^^^^
> Dereference.
>
>     27          const struct lib_ring_buffer_config *config = chan->backend.config;
>     28          pgoff_t pgoff = vmf->pgoff;
>     29          struct page **page;
>     30          void **virt;
>     31          unsigned long offset, sb_bindex;
>     32
>     33          if (!buf)
>                     ^^^^
> Check.
>
>     34                  return VM_FAULT_OOM;
>     35

This check is performed at mapping setup time in
lib_ring_buffer_mmap_buf() already, so we can safely remove this
duplicata.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:37:47 -08:00
Mathieu Desnoyers 2f8e0b31ad lttng lib: ring buffer: remove stale null-pointer
* Dan Carpenter <dan.carpenter@oracle.com> wrote:
[...]
> The patch c844b2f5cfea: "lttng lib: ring buffer" from Nov 28, 2011,
> leads to the following Smatch complaint:
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_frontend.c +1150
> +lib_ring_buffer_print_buffer_errors()
>          warn: variable dereferenced before check 'chan' (see line 1143)
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_frontend.c
>   1142  {
>   1143          const struct lib_ring_buffer_config *config =
> +chan->backend.config;
>
> +^^^^^^^^^^^^^^^^^^^^
> Dereference.
>
>   1144          unsigned long write_offset, cons_offset;
>   1145
>   1146          /*
>   1147           * Can be called in the error path of allocation when
>   1148           * trans_channel_data is not yet set.
>   1149           */
>   1150          if (!chan)
>                 ^^^^^^^^^
> Check.  At first glance the comment seems out of date, I think check can
> be removed safely.
>
>   1151                  return;
>   1152          /*

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:37:47 -08:00
Sean MacLennan 976d534118 rtl8192e: Rename clashing symbols
The "rtl8192e: Export symbols" patch exported three functions already
exported by the rtl8192u driver. This patch renames the three functions:
  Dot11d_Init => dot11d_init
  HTUpdateSelfAndPeerSetting => HT_update_self_and_peer_setting
  IsLegalChannel => rtllib_legal_channel

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 14:16:42 -08:00
Colin Cross a6707f830e staging: android: ram_console: pass in a boot info string
Allow the board file to pass a boot info string through the
platform data that is appended to the /proc/last_kmsg file.

[moved the .h file to drivers/staging/android/ to be self-contained - gregkh]

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:23:37 +09:00
JP Abgrall 2b374956f3 android: logger: bump up the logger buffer sizes
(port from common android-2.6.39
  commit: 11430f16545205c614dd5bd58e4a7ee630fc0f9f)

events: (no change, 256)
main: 64 -> 256
radio: 64 -> 256
system: 64 -> 256

Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:22:32 +09:00
Colin Cross cae9bf11ef android: lowmemorykiller: Fix arguments to lowmem_shrink
The arguments to shrink functions have changed, update
lowmem_shrink to match.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:21:10 +09:00
Arve Hjønnevåg 71b2c82bdf staging: android: lowmemorykiller: Ignore shmem pages in page-cache
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:20:51 +09:00
Colin Cross 06a1074e1c staging: android: lowmemorykiller: Update arguments of shrinker for 2.6.35
Signed-off-by: Colin Cross <ccross@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:07:04 +09:00
San Mehat eb943f6be0 staging: android: lowmemorykiller: Remove bitrotted codepath
Now that we're murder-synchronous, this code path will never be
called (and if it does, it doesn't tell us anything useful other
than we killed a task that was already being killed by somebody
else but hadn't gotten its' signal yet)

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 21:05:32 +09:00
Christopher Lais 58526090ec staging: binder: Fix memory corruption via page aliasing
binder_deferred_release was not unmapping the page from the buffer
before freeing it, causing memory corruption.  This only happened
when page(s) had not been freed by binder_update_page_range, which
properly unmaps the pages.

This only happens on architectures with VIPT aliasing.

To reproduce, create a program which opens, mmaps, munmaps, then closes
the binder very quickly.  This should leave a page allocated when the
binder is released.  When binder_deferrred_release is called on the
close, the page will remain mapped to the address in the linear
proc->buffer.  Later, we may map the same physical page to a different
virtual address that has different coloring, and this may cause
aliasing to occur.

PAGE_POISONING will greatly increase your chances of noticing any
problems.

Signed-off-by: Christopher Lais <chris+android@zenthought.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:51:37 +09:00
San Mehat 4755b72e26 staging: android: lowmemkiller: Substantially reduce overhead during reclaim
This patch optimizes lowmemkiller to not do any work when it has an outstanding
kill-request. This greatly reduces the pressure on the task_list lock
(improving interactivity), as well as improving the vmscan performance
when under heavy memory pressure (by up to 20x in tests).

Note: For this enhancement to work, you need CONFIG_PROFILING

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:51:37 +09:00
San Mehat 4964cd41cd staging: android: lowmemorykiller: Don't try to kill the same pid over and over
Under certain circumstances, a process can take awhile to
handle a sig-kill (especially if it's in a scheduler group with
a very low share ratio). When this occurs, lowmemkiller returns
to vmscan indicating the process memory has been freed - even
though the process is still waiting to die. Since the memory
hasn't actually freed, lowmemkiller is called again shortly after,
and picks the same process to die; regardless of the fact that
it has already been 'scheduled' to die and the memory has already
been reported to vmscan as having been freed.

  Solution is to check fatal_signal_pending() on the selected
task, and if it's already pending destruction return; indicating
to vmscan that no resources were freed on this pass.

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:51:36 +09:00
Arve Hjønnevåg 3c762a49b1 Staging: android: binder: Create dedicated workqueue for binder deferred work
Some drivers flush the global workqueue when closed. This would deadlock if
the last reference to the file was released from the binder.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:51:36 +09:00
Mike Lockwood 8bfe15f3de Staging: android: timed_gpio: Properly discard invalid timeout values.
The timed output device never previously checked the return value of sscanf,
resulting in an uninitialized int being passed to enable() if input value
was invalid.

Signed-off-by: Mike Lockwood <lockwood@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:51:36 +09:00
Arve Hjønnevåg 16b6655438 staging: android: binder: Move debugging information from procfs to debugfs
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:49:07 +09:00
Arve Hjønnevåg 5249f48830 binder: Use seq_file for debug interface.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:40:06 +09:00
San Mehat 3537cdaa16 android: logger: Add new system log for framework/system log messages
Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:40:06 +09:00
Arve Hjønnevåg 0445f1548f Staging: android: timed_gpio: Request gpios.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:40:05 +09:00
Arve Hjønnevåg 81057ec1de Staging: android: ram_console: Start ram console earlier
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:40:05 +09:00
San Mehat fdfc808942 staging: android: ramconsole: Ensure ramconsole does not get cluttered by apanic threads
[Note, this is part of a patch from Sam, just the drivers/staging/
portion, that adds a function that the apanic code calls, but the apanic
code isn't here, so just include part of this to make merges and diffs
easier and this keeps things self-contained - gregkh]

Signed-off-by: San Mehat <san@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:36:55 +09:00
Greg Kroah-Hartman f4dc23861d Staging: android: add the code back to the build
It builds, so ship it!

Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:33:10 +09:00
Greg Kroah-Hartman e59bbb8ea3 Revert "Staging: android: mark subsystem as broken"
This reverts commit 2cdf99ce2b.

It now builds, so this can be reverted.

Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:32:24 +09:00
Colin Cross c11a166cd4 android-common: Fix slab.h includes for 2.6.34-rc4
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:30:14 +09:00
Arve Hjønnevåg c1b197ae67 android-common: include linux/slab.h
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:27:13 +09:00
Corentin Chary 23687af931 staging/android: fix build issues
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:26:09 +09:00
Greg Kroah-Hartman 355b0502f6 Revert "Staging: android: delete android drivers"
This reverts commit b0a0ccfad8.

Turns out I was wrong, we want these in the tree.

Note, I've disabled the drivers from the build at the moment, so other
patches can be applied to fix some build issues due to internal api
changes since the code was removed from the tree.

Cc: Arve Hjønnevåg <arve@android.com>
Cc: Brian Swetland <swetland@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 20:18:14 +09:00
Sean MacLennan 3d461c9124 rtl8192e: Split into two directories
Now that the rtl8192e driver is split up, it makes sense to keep the
rtllib code in one directory and the rtl8192e specific code in
another. This patch contains the split and the fixup of includes.

Since rtl_core.h already included rtllib.h and dot11d.h, rtl_core.h
was updated to point to the parent directory. All other references to
rtllib.h and dot11d.h in the rtl8192e specific code where deleted
rather than fixed. This leaves just one file that needs to know the
real location of the rtllib includes.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:50:42 +09:00
Sean MacLennan d37e0208df rtl8192e: Split the driver up
This patch splits the current r8192e_pci driver up into six different
drivers: rtllib, rtllib_crypt, rtllib_crypt_ccmp, rtllib_crypt_tkip,
rtllib_crypt_wep, and r8192e_pci.

Now that they are proper modules, the init and exit functions do not
need to be called directly. Also, the rtllib_*_null functions are not
needed since they will be loaded on demand.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:48:56 +09:00
Sean MacLennan 3b28499c55 rtl8192e: Export symbols
The rtl8192e driver had a natural split between the more generic
rtllib code and the more specific rtl8192e code. This patch exports
all the symbols needed by the r8192 specific code from the rtllib
generic code.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:45:26 +09:00
Sean MacLennan ea74fedced rtl8192e: create generic rtllib_debug.h
Rename rtl_debug.h to rtllib_debug.h. Source files should include
rtllib.h if they are generic and rtl_core.h if they are r8192e
specific. Files should never include both.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:44:09 +09:00
Sean MacLennan f1c602f999 rtl8192e: move RTL_DEBUG and proc prototypes
The RTL_DEBUG enum is used for rt_global_debug_component global
variable and RT_TRACE. It should be in rtl_debug.h and not rtl_core.h.

The rtl8192_proc_* functions are r8192 specific and should not be in
rtl_debug.h. Move them to rtl_core.h.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:40:55 +09:00
Sean MacLennan 80c0d83aec rtl8192e: cleanup rtl_debug.h
This patch cleans up rtl_debug.h by removing all the unused defines and
stub functions.
The changes to rtl_core.c are just to remove the deleted stub function
calls.
The changes to rtl_debug.c are functions that are never called.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:39:34 +09:00
Andreas Ruprecht 28998e005b Staging: iio/accel: Changed return type of lis3l02dq_read_event_config() to int
The lis3l02dq_read_event_config() function returned an ssize_t up to
now, which lead to a compiler warning in line 660 (initialization from
incompatible pointer type). The iio_info struct is defined to accept an
int-returning function as the read_event_config parameter.

Also it seems odd to have the check for (ret < 0) and return ret in
this case, when the return type is signed.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Martyn Welch c1fcc4c9bd Staging: VME: PIO2: Correct irq reset
The loop used to reset the interrupt masks has faulty logic. There are 4
banks of 8 I/O, however each mask is comprised of 2 bits and thus there are
8 sets of registers to clear. Driver was wrongly equating this with 8 banks
leading to a us writing past the end of the "bank" array (used to store mask
configuration as these registers are write only) and thus causing memory
corruption. Clear both registers of masks for each bank and half iterations.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Andreas Ruprecht 6d3ff1cc99 Staging: iio/adc: strict_strtoul was used with a long type variable
The function ad7280_store_balance_timer() parses data from a char*
buffer into a long variable, but uses the the function strict_strtoul
which expects a pointer to an unsigned long variable as its third
parameter.

As Dan Carpenter mentioned, the values are capped a few lines later,
but a check if val is negative is missing.
Now this function will return -ERANGE if there is a representation of
a negative number in buf.

Additionally the checkpatch.pl considers strict_strtoul as obsolete.
I replaced its call with the suggested kstrtoul.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Thomas Meyer d83fb18494 staging: iio: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Xi Wang 201320435d staging: vt6656: integer overflows in private_ioctl()
There are two potential integer overflows in private_ioctl() if
userspace passes in a large sList.uItem / sNodeList.uItem.  The
subsequent call to kmalloc() would allocate a small buffer, leading
to a memory corruption.

Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:29:40 +09:00
Xi Wang 2a58b19fd9 staging: vt6655: integer overflows in private_ioctl()
There are two potential integer overflows in private_ioctl() if
userspace passes in a large sList.uItem / sNodeList.uItem.  The
subsequent call to kmalloc() would allocate a small buffer, leading
to a memory corruption.

Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:29:40 +09:00
Marcos Paulo de Souza fee6433bdd staging: vt6656: card.c: Change return of CARDbAddBasicRate to void
In all locations that call this function ignore your returna, so remove
it.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:28:19 +09:00
Marcos Paulo de Souza ca76edebce staging: vt6656: baseband.c: Remove commented code
This patch removes a lot of commented code, and some return calls of
void functions.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:28:18 +09:00
Marcos Paulo de Souza f001d7e28c staging: vt6656: baseband.c: Removed dead code, and fix coding standards
Remved some commented code, and fixed some style issues. was removed too
a redundant if statement.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:28:18 +09:00
Marcos Paulo de Souza 6318237691 staging: vt6656: 80211mgr.c: Code cleanup, removed return of void funcs.
Removed return call of void functions. Removed some code style issues.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:28:18 +09:00
Marcos Paulo de Souza ac31e9e8e6 staging: vt6656: main_usb.c: Use kzalloc instead kmalloc
Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:28:18 +09:00
Marcos Paulo de Souza 428c1fb50e staging:vt6656: iwctl.c: Removed unneeded function
Removed the function iwctl_giwnwid, that just return a error code.

Changes v1 to v2:
	Removed same functions of vt6655 and vt6656.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:25:50 +09:00
Dave Airlie 248dbc2350 drm: move the fb bpp/depth helper into the core.
This is used by nearly everyone including vmwgfx which doesn't generally
use the fb helper.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-29 20:02:54 +00:00
Haiyang Zhang 95fa0405c5 staging: hv: move hv_netvsc out of staging area
hv_netvsc has been reviewed on netdev mailing list on 6/09/2011.
All recommended changes have been made. We are requesting to move
it out of staging area.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: KY Srinivasan <kys@microsoft.com>
Signed-off-by: Mike Sterling <Mike.Sterling@microsoft.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 16:12:36 +09:00
Andreas Ruprecht 3b724ca145 Staging: iio/accel: Changed data type of val in store_measurement_mode to u8
The code in sca3000_store_measurement_mode() uses the variable val to
do bitwise operations with an int mask and or-s it into st->rx[0] which
is an entry in a u8 array (see sca3000.h).

This means up to now values larger than a u8 were silently ignored and
just the lower 8 bits counted into the value that was written into
st->rx[0]. This code will return -ERANGE if the value in buf was too
large to fit into a u8.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09:00
Andreas Ruprecht 359f9caa4d Staging: iio/accel: Changed data type for val to unsigned long in write_frequency
In lis3102dq_write_frequency() we used a long variable to store the
value parsed from the char* buffer buf, as there only was a
strict_strtol() function to parse values.
Now we have got kstrto* which allows us to convert to the right data
type in most cases.

In this particular function we want to write a frequency value, and it
doesn't make sense to allow negative values here (as Dan Carpenter
pointed out in a previous email).
This means we can now parse the value into an unsigned long and get an
error for invalid (e.g. negative) values.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09:00
Andreas Ruprecht bae5b53753 Staging: iio/accel: Changed data type in adis16220_write_16bit to u16
In the adis16220_write_16bit() function we used a long value to store
parsed data from the char* buffer buf.
The called function to actually write the data,
adis16220_spi_write_reg_16(), takes a u16 value as a parameter, so up
to now a value larger than u16 was silently ignored as it was only
truncated when passing the parameter.
Now this function will only accept values fitting into a u16.

Additionally the parsing function was changed to overcome the now
obsolete strict_strtol() function.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:12:06 +09:00
Kevin McKinney 19a177e6fb Staging: bcm: Reverse semaphore locking in IOCTL_BCM_BUFFER_DOWNLOAD_STOP.
This patch reorders the semaphore locking.
It makes better sense to first evaluate
fw_download_sema semaphore then
NVMRdmWrmLocl semaphore. The
fw_download_sema is suppose to be
acquired in the START ioctl.  If this is
not true, then it does not make sense
to continue.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Kevin McKinney 8fbebb091a Staging: bcm: Alter code to move error handling closer to the calls.
This is a cleanup patch. I've shuffled the code around to
move the error handling closer to the calls. I've removed
some indent levels. I've replaced break statements with
direct returns.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Kevin McKinney fef5675ecb Staging: bcm: Clean up patch that calls semaphore down_trylock directly.
This patch evaluates/calls the down_trylock locking
function directly, instead of storing the results
in a variable and evaluating the variable. These
changes were made in:
IOCTL_BCM_BUFFER_DOWNLOAD_STOP and
IOCTL_BCM_BUFFER_DOWNLOAD_START.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:09:52 +09:00
Mathieu Desnoyers 9b6d121984 staging: add LTTng to build
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers 3c46c44027 lttng: toplevel Makefile and Kconfig
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers 1e8ab70d74 lttng: probe callbacks
Implement the LTTng probe callbacks. One notable file here is
lttng-events.h, which is the core implementation of the LTTng
TRACE_EVENT macros for generation of probes and tracepoint decription
from the TRACE_EVENT declarations.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers 97104e24fb lttng: add system call instrumentation probe
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers 18b2248a0d lttng: Add documentation and TODO files
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers c623c0a349 lttng: debugfs and procfs ABI
Add the "lttng" virtual file to debugfs and procfs. All operations are
performed through ioctls (LTTng ioctl range is already reserved
upstream) on this virtual file and on anonymous file descriptors
returned by these ioctls. Each file descriptor is associated with a
tracer "object" (session, channel, stream, event, context).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:07 +09:00
Mathieu Desnoyers da66e4e541 lttng: timing calibration feature
This calibration feature is fairly limited for now, but provides an
example of how this can be performed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:06 +09:00
Mathieu Desnoyers 6c19da3578 lttng: dynamically selectable context information
Events can be augmented with context information. This is dynamically
configurable from the command line.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:06 +09:00
Mathieu Desnoyers ccc7340a94 lttng: tracer control and core structures
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:06 +09:00
Mathieu Desnoyers 6857797120 lttng: lib ring buffer clients
Each lttng buffer configuration (discard mode, overwrite mode, mmap
support, splice support, per-cpu buffers, global buffer for metadata) is
a lib ring buffer client.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:06 +09:00
Mathieu Desnoyers 54a69e5511 lttng: syscall instrumentation
x86-32 and x86-64 system call instrumentation, along with the
lttng-syscalls-generate-headers.sh script that generates the headers
from the system call list. See README for details.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:06 +09:00
Mathieu Desnoyers 763be8c0a9 lttng instrumentation: tracepoint events
Modifications to the in-kernel TRACE_EVENT are needed to generate the
compact event descriptions and the probe code LTTng generates. These
changes could apply to upstream TRACE_EVENT, but requires changing the
in-kernel API.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers 69e1242eaa lttng wrappers
Implement wrappers for compatibility with older kernel versions and
kernels with had the libringbuffer (old) patchset applied.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers 848afbd72e lttng libs: add Makefile
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers 2d31597d37 lttng: offset alignment header
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers a643061cb8 lttng: BUILD_RUNTIME_BUG_ON
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers 7430010ec5 lttng lib: portable bitfield read/write header
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:05 +09:00
Mathieu Desnoyers c844b2f5cf lttng lib: ring buffer
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:04 +09:00
Mathieu Desnoyers 1b4d28b622 lttng lib: lttng priority heap
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-29 10:05:04 +09:00
Tomas Winkler b7cd2d9fdc staging/mei: don't check if list is empty before looping
1. No need to check if a list is empty before list_for_each_ looping as
this is already checked by loop stopping conditional.

The side effect is reduced indentation depth
from:
	if (!list_empty)
		list_for_each()
to:
	list_for_each()

2. drop cb_ prefix from cl_pos, cl_next variables used in list_for_each
loops. The code is more compact and readable

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:46:18 +09:00
Tomas Winkler c83720941f staging/mei: remove status member of mei_io_list
status was never writen

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:46:17 +09:00
Tomas Winkler 2bcfaa1fa2 staging/mei: remove BUG_ON for testing of the response buffer size overflow
We can remove BUG_ON in mei_irq_thread_read_client_message()
as the testing for response buffer size overflow has already
graceful handling in place.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:46:17 +09:00
Aaro Koskinen ef497f46c3 staging: xgifb: vb_setmode: clean up a single statement if
Eliminate the only remaining checkpatch.pl warning:

	WARNING: braces {} are not necessary for single statement blocks
	#7463: FILE: staging/xgifb/vb_setmode.c:7463:
	+       if (ModeNo & 0x80) {
	+               ModeNo = ModeNo & 0x7F;
	+       }

	total: 0 errors, 1 warnings, 0 checks, 7554 lines checked

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:14 +09:00
Aaro Koskinen 798b4da50f staging: xgifb: vb_setmode: reduce if nesting in XGI_GetVCLK2Ptr()
Eliminate unnecessary nesting levels by rearranging code and conditions.
The resulting code should be still identical.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:14 +09:00
Aaro Koskinen 6596fc06e4 staging: xgifb: vb_setmode: reduce if nesting in XGI_SetLockRegs()
Eliminate unnecessary nesting levels by rearranging code and conditions.
The resulting code should be still identical.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen ebe3302410 staging: xgifb: vb_setmode: delete empty if statement blocks
Delete empty if statement blocks. The patch eliminates following
checkpatch.pl warnings:

WARNING: suspect code indent for conditional statements (8, 8)

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen 337a1a8f78 staging: xgifb: vb_setmode: delete XGI_VBLongWait()
XGI_VBLongWait() is NOP, so just delete it.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen 9a0b295e29 staging: xgifb: vb_setmode: delete commented-out code
Delete commented-out code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen eb9aef1de1 staging: xgifb: vb_setmode: inline XGI_SetMiscRegs()
Inline a trivial function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen 9ffc7e9fee staging: xgifb: vb_setmode: eliminate GetVGAType/Set_VGAType
Eliminate unneeded function and struct field. The same information is
available in HwDeviceExtension->jChipType.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen fac2cc9205 staging: xgifb: vb_setmode: make internal functions static
Make internal functions static.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:12 +09:00
Aaro Koskinen ed2e7203c3 staging: xgifb: vb_setmode: make XGI_GetLVDSOEMTableIndex() static
XGI_GetLVDSOEMTableIndex() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:12 +09:00
Aaro Koskinen 9913b6c0d7 staging: xgifb: vb_setmode: make XGI_XG21SetPanelDelay() static
XGI_XG21SetPanelDelay() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:12 +09:00
Aaro Koskinen 776115a0eb staging: xgifb: vb_setmode: make XGI_XG27BLSignalVDD() static
XGI_XG27BLSignalVDD() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:12 +09:00
Aaro Koskinen 0ebf538b8a staging: xgifb: vb_setmode: make XGI_XG21BLSignalVDD() static
XGI_XG21BLSignalVDD() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:12 +09:00
Aaro Koskinen a2d08cf38a staging: xgifb: vb_setmode: make XGI_SetXG27FPBits() static
XGI_SetXG27FPBits() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:11 +09:00
Aaro Koskinen e85f203696 staging: xgifb: vb_setmode: make XGI_SetXG21FPBits() static
XGI_SetXG21FPBits() can be made static. Move the function, so that
forward declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:11 +09:00
Aaro Koskinen 0646596cc7 staging: xgifb: vb_setmode: make XGI_GetResInfo() static
XGI_GetResInfo() can be made static. Move the function, so that forward
declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:11 +09:00
Aaro Koskinen 7f04ec3058 staging: xgifb: vb_setmode: make XGI_LongWait() static
XGI_LongWait() can be made static. Move the function, so that forward
declaration is not needed.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:11 +09:00
Xi Wang dfd8ee92a9 Staging: comedi: fix integer overflow in do_insnlist_ioctl()
There is a potential integer overflow in do_insnlist_ioctl() if
userspace passes in a large insnlist.n_insns.  The call to kmalloc()
would allocate a small buffer, leading to a memory corruption.

The bug was reported by Dan Carpenter <dan.carpenter@oracle.com>
and Haogang Chen <haogangchen@gmail.com>.  The patch was suggested by
Ian Abbott <abbotti@mev.co.uk> and Lars-Peter Clausen <lars@metafoo.de>.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Haogang Chen <haogangchen@gmail.com>.
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:38:45 +09:00
Greg Kroah-Hartman 06b446c8af Revert "Staging: comedi: integer overflow in do_insnlist_ioctl()"
This reverts commit e384a41141.
It's not the correct way to solve this issue.

Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:36:10 +09:00
Peter Huewe c0fe602f2d staging/sm7xx: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:24:32 +09:00
Peter Huewe 5fef30b282 staging/wlags49_h2: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since CH_Agere_Systems_Mini_PCI_V1 is defined as 0 in hermes_pci_versions
and neither the enum nor the value is used anywhere else, we can drop
the assignment of .driver_data as it is initialized as 0 by default.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:24:32 +09:00
Peter Huewe dcbc2fc62c staging/phison: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:24:32 +09:00
Jonathan Cameron 0c22db439a staging:iio:documentation: document filter_low_pass_3db_frequency.
Add the sysfs ABI docs for all current instances of this
parameter.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:22:23 +09:00
Jonathan Cameron 98c9373d31 staging:iio:imu:adis16400 add control of data filtering.
Bartlett filter used.  Values read of figures on datasheet
so far from precise.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:22:23 +09:00
Jonathan Cameron df94aba81f staging:iio: filter description - low pass 3db frequency.
Introduce the first data filtering related parameter.
For now we are ignoring the filter type and merely specifying its
approximate (I read them off tiny graphs) 3db point.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 04:22:23 +09:00
Ravishankar karkala Mallikarjunayya 0389245f0c Staging: comedi: fix brace coding style issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a brace
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:41 -08:00
Ravishankar karkala Mallikarjunayya 34dac67d6c Staging: comedi: fix printk issue in ni_pcimio.c
This is a patch to the ni_pcimio.c file that fixes up a printk
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya e8f31fd312 Staging: comedi: fix printk issue in ni_pcimio.c
This is a patch to the ni_pcimio.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Converted printks to dev_<level> and pr_<level>.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya 25c0ca8406 Staging: comedi: fix brace coding style issue in ni_pcimio.c
This is a patch to the ni_pcimio.c file that fixes up a brace
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya 327ffc0ce7 Staging: comedi: fix printk issue in ni_labpc_cs.c
This is a patch to the ni_labpc_cs.c file that fixes up a printk
warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya 1aa301e83b Staging: comedi: fix printk issue in ni_daq_dio24.c
This is a patch to the ni_daq_dio24.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Converted printks to pr_<levels> and dev_version.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya ef7908ebc3 Staging: comedi: fix brace coding style issue in ni_daq_dio24.c
This is a patch to the ni_daq_dio24.c file that fixes up a
brace warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya 73b12a5bc0 Staging: comedi: fix initialise statics to 0 or NULL issue in ni_daq_dio24.c
This is a patch to the ni_daq_dio24.c file that fixes up a initialise
statics to 0 or NULL warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:51:40 -08:00
Ravishankar karkala Mallikarjunayya 408f6bcd2a Staging: comedi: fix printk issue in pcl818.c
This is a patch to the pcl818.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Removed an unnecessary printks.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:46 -08:00
Ravishankar karkala Mallikarjunayya c62a0ef42c Staging: comedi: fix printk issue in pcl818.c
This is a patch to the pcl818.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Converted printks to dev_version.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:46 -08:00
Ravishankar karkala Mallikarjunayya 26ba666c50 Staging: comedi: fix printk issue in pcl818.c
This is a patch to the pcl818.c file that fixes up a printk
warning found by the checkpatch.pl tool

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:46 -08:00
Ravishankar karkala Mallikarjunayya 3478f74231 Staging: comedi: fix printk issue in das16m1.c
This is a patch to the das16m1.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to comedi_<level.
Removed an unnecessary printk statment.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:46 -08:00
Ravishankar karkala Mallikarjunayya b147ed6077 Staging: comedi: fix initialise statics to 0 or NULL issue in pcl816.c
This is a patch to the pcl816.c file that fixes up a initialise statics to 0 or NULL
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:45 -08:00
Ravishankar karkala Mallikarjunayya 352f91747f Staging: comedi: fix brace coding style issue in daqboard2000.c
This is a patch to the daqboard2000.c file that fixes up a brace
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:50:45 -08:00
Ravishankar karkala Mallikarjunayya 61a8d9550e Staging: comedi: fix printk issue in das08_cs.c
This is a patch to the das08_cs.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_printk.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:03 -08:00
Ravishankar karkala Mallikarjunayya f15d651b14 Staging: comedi: fix printk issue in adv_pci_dio.c
This is a patch to the adv_pci_dio.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_version.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:03 -08:00
Ravishankar karkala Mallikarjunayya e75aca9286 Staging: comedi: fix printk issue in das800.c
This is a patch to the das800.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_dbg.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:03 -08:00
Ravishankar karkala Mallikarjunayya bb1defe465 Staging: comedi: fix printk issue in das800.c
This is a patch to the das800.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_version.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:03 -08:00
Ravishankar karkala Mallikarjunayya 5d2d50745c Staging: comedi: fix printk issue in cb_pcimdas.c
This is a patch to the cb_pcimdas.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_version.
Removed ifdef CBPCIMDAS_DEBUG and unecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:03 -08:00
Ravishankar karkala Mallikarjunayya 3f00cf8ff3 Staging: comedi: fix printk issue in cb_pcimdas.c
This is a patch to the cb_pcimdas.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_version.
Removed ifdef CBPCIMDAS_DEBUG.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:02 -08:00
Ravishankar karkala Mallikarjunayya 2c6abc58f2 Staging: comedi: fix printk issue in cb_pcimdas.c
This is a patch to the cb_pcimdas.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_printk.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:02 -08:00
Ravishankar karkala Mallikarjunayya 610b8ed959 Staging: comedi: fix printk issue in cb_pcidio.c
This is a patch to the cb_pcidio.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_printk and Removed unnecessary printk
statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:48:02 -08:00
Ravishankar karkala Mallikarjunayya 143c128cc1 Staging: comedi: fix printk issue in cb_pcidda.c
This is a patch to the cb_pcidda.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_printk and Removed unnecessary
printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:19 -08:00
Ravishankar karkala Mallikarjunayya 8bde85db94 Staging: comedi: fix printk issue in cb_pcidas.c
This is a patch to the cb_pcidas.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_printk and Removed unnecessary
printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:19 -08:00
Ravishankar karkala Mallikarjunayya be545c6251 Staging: comedi: fix printk issue in adv_pci1710.c
This is a patch to the adv_pci1710.c file that fixes up a printk
warning found by the checkpatch.pl tool.

Converted printks to dev_version and Removed an unnecessary printk
statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:19 -08:00
Ravishankar karkala Mallikarjunayya 4547251f6a Staging: comedi: fix brace coding style issue in das16m1.c
This is a patch to the das16m1.c file that fixes up a brace coding
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Ravishankar karkala Mallikarjunayya 2b8731348a Staging: comedi: fix NULL initilization issue in pcl818.c
This is a patch to the pcl818.c file that fixes up a NULL initilization
warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Ravishankar karkala Mallikarjunayya fc95013963 Staging: comedi: fix brace coding style issue in pcl818.c
This is a patch to the pcl818.c file that fixes up a brace
coding style warning found by the checkpatch.pl tool.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Ravishankar karkala Mallikarjunayya cc780e8f92 Staging: comedi: fix printk issue in cb_das16_cs.c
This is a patch to the cb_das16_cs.c file that fixes up a printk
warning found by the checkpatch.pl tool.

Converted printks to dev_printk.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Ravishankar karkala Mallikarjunayya 3dbeb83c24 Staging: comedi: fix printk issue in serial2002.c
This is a patch to the serial2002.c file that fixes up a printk
warning found by the checkpatch.pl tool.

converted printks to dev_version.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Ravishankar karkala Mallikarjunayya 7e4198f47b Staging: comedi: fix printk issue in das6402.c
This is a patch to the das6402.c file that fixes up a printk
warning found by the checkpatch.pl tool.

Converted printks to dev_version.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:45:18 -08:00
Peter Huewe 855f62ef19 staging/comedi/daqboard: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:37 -08:00
Peter Huewe 7b0be12b26 staging/comedi/amplc: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:37 -08:00
Peter Huewe 8c0690eaf7 staging/comedi/adl: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:37 -08:00
Peter Huewe 71d4c80db1 staging/comedi/cb_pcimdda: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:37 -08:00
Peter Huewe 8edbfb8dec staging/comedi/das08: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Peter Huewe dbecdf36ce staging/comedi/me_daq: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Peter Huewe 9fb7d6fa1d staging/comedi/contec: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Peter Huewe 49d6f67245 staging/comedi/ke_counter: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Peter Huewe 1013762ccf staging/comedi/jr3: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Peter Huewe d9fcd77b56 staging/comedi/addi: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readablity.

Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.

Moreover the hardcoded 0x15B8 was replaced by the more readable
PCI_VENDOR_ID_ADDIDATA

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Johannes Thumshirn cf5682788f staging: comedi: Unbreak output of printk()s in pcmmio
Unbreak the output of some printk()s I broke.

Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:39:36 -08:00
Dan Carpenter e384a41141 Staging: comedi: integer overflow in do_insnlist_ioctl()
There is an integer overflow here that could cause memory corruption
on 32 bit systems.

insnlist.n_insns could be a very high value size calculation for
kmalloc() could overflow resulting in a smaller "insns" than
expected.  In the for (i = 0; i < insnlist.n_insns; i++) {... loop
we would read past the end of the buffer, possibly corrupting memory
as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:34:15 -08:00
Federico Vaga 6a9ce6b654 Staging: comedi: fix signal handling in read and write
After sleeping on a wait queue, signal_pending(current) should be
checked (not before sleeping).

Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:34:15 -08:00
Federico Vaga df30b21cb0 Staging: comedi: fix mmap_count
In comedi_fops, mmap_count is decremented at comedi_vm_ops->close but
it is not incremented at comedi_vm_ops->open. This may result in a negative
counter.  The patch introduces the open method to keep the counter
consistent.

The bug was triggerd by this sample code:

        mmap(0, ...., comedi_fd);
        fork();
        exit(0);

Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:34:14 -08:00
Bernd Porr 3ffab428f4 staging: comedi: fix oops for USB DAQ devices.
This fixes kernel oops when an USB DAQ device is plugged out while it's
communicating with the userspace software.

Signed-off-by: Bernd Porr <berndporr@f2s.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:34:14 -08:00
Bernd Porr 8b78607fc4 staging: comedi: usbduxsigma: Fixed wrong range for the analogue channel.
It's actually +/-2.65V/2 and not +/-2.65V.

Signed-off-by: Bernd Porr <berndporr@f2s.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:34:14 -08:00
Christopher Brannon 4afaee1561 Staging: speakup: Don't try to access an unallocated struct.
In speakup_init, we have the following:
	if (quiet_boot)
		spk_shut_up |= 0x01;
And in spk_types.h:
This patch moves the statement in speakup_init so that
speakup_console[vc->vc_num] is guaranteed to be allocated when it
executes.

Signed-off-by: Christopher Brannon <chris@the-brannons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:13:55 -08:00
Bernhard Heinloth ebadb73043 Staging: zcache: Fix calls to obsolete function
Function "strict_strtol" replaced by "kstrtol" as suggested by the checkpatch script

Signed-off-by: Bernhard Heinloth <bernhard@heinloth.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:13:55 -08:00
Ken O'Brien a75311dcb8 Staging: frontier: Removed use of obsolete function
Replaced one reference to strict_strtoul() to kstrtoul().

Signed-off-by: Ken O'Brien <kernel@kenobrien.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:13:54 -08:00
Ken O'Brien 67d6baa401 Staging: asus_oled: Fixed use of obsolete function.
Removed use of obsolete function "strict_strtoul". Replaced with "kstrtoul"
as suggested by checkpatch.pl

Signed-off-by: Ken O'Brien <kernel@kenobrien.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:13:54 -08:00
Omar Ramirez Luna 3b9cd5d114 staging: tidspbridge: request dmtimer clocks on init
Given that dm timer framework doesn't support request of clocks
by soft | hard irqs because some recent changes, tidspbridge needs
to request its clocks on init and enable/disable them on demand.

This was first seen on 3.2-rc1.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:12:57 -08:00
Omar Ramirez Luna 9b0a3f985a staging: tidspbridge: include module.h by default
Fixes compilation break when compiled as part of the kernel:

drivers/staging/tidspbridge/rmgr/drv_interface.c:134: error: expected declaration specifiers or '...' before string constant
drivers/staging/tidspbridge/rmgr/drv_interface.c:134: warning: data definition has no type or storage class
drivers/staging/tidspbridge/rmgr/drv_interface.c:134: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/staging/tidspbridge/rmgr/drv_interface.c:134: warning: function declaration isn't a prototype
drivers/staging/tidspbridge/rmgr/drv_interface.c:135: error: expected declaration specifiers or '...' before string constant
drivers/staging/tidspbridge/rmgr/drv_interface.c:135: warning: data definition has no type or storage class
drivers/staging/tidspbridge/rmgr/drv_interface.c:135: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/staging/tidspbridge/rmgr/drv_interface.c:135: warning: function declaration isn't a prototype
drivers/staging/tidspbridge/rmgr/drv_interface.c:136: error: expected declaration specifiers or '...' before string constant
drivers/staging/tidspbridge/rmgr/drv_interface.c:136: warning: data definition has no type or storage class
drivers/staging/tidspbridge/rmgr/drv_interface.c:136: warning: type defaults to 'int' in declaration of 'MODULE_VERSION'
drivers/staging/tidspbridge/rmgr/drv_interface.c:136: warning: function declaration isn't a prototype
drivers/staging/tidspbridge/rmgr/drv_interface.c: In function 'omap34_xx_bridge_probe':
drivers/staging/tidspbridge/rmgr/drv_interface.c:359: error: 'THIS_MODULE' undeclared (first use in this function)
drivers/staging/tidspbridge/rmgr/drv_interface.c:359: error: (Each undeclared identifier is reported only once
drivers/staging/tidspbridge/rmgr/drv_interface.c:359: error: for each function it appears in.)

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:12:57 -08:00
Thomas Meyer 1aa5eb67d7 Staging: speakup: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:12:56 -08:00
Alexander Beregalov cd420765eb Staging: cxt1e1: remove rcs keywords and log
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:11:35 -08:00
Alexander Beregalov 48d7c08f0f Staging: cxt1e1: remove ifdef __cplusplus
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:11:35 -08:00
Alexander Beregalov 05c0cb4e40 Staging: cxt1e1: remove unnecessary includes
Remove *BSD, SunOS and userspace includes.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:11:35 -08:00
Aaro Koskinen 15eac0f847 staging: xgifb: delete vb_ext.{c,h}
Delete empty files.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:03:18 -08:00
Aaro Koskinen 40544b0411 staging: xgifb: move XGINew_SenseLCD() to vb_init.c
The function is used only in vb_init.c, so move it there and make
it static.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:02:56 -08:00
Aaro Koskinen 7a809f5c20 staging: xgifb: rename XGINew_GetLCDDDCInfo() to XGINew_SenseLCD()
Eliminate an unnecessary wrapper function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:02:24 -08:00
Aaro Koskinen f1c289115a staging: xgifb: delete XGI_GetSenseStatus()
Delete unused function XGI_GetSenseStatus().

Static functions XGINew_Is301B(), XGINew_Sense(), XGINew_GetPanelID(),
XGINew_BridgeIsEnable() and XGINew_SenseHiTV() can be deleted as well,
since they are not used anymore.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:02:10 -08:00
Peter Huewe 27d73f1a5a staging/xgifb: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used)
This patch converts pci_table entries to use the PCI_DEVICE macro,
if .subvendor and .subdevice are set to PCI_ANY_ID,
and thus improves readability.

v2:
Since the driver_data field isn't used anywhere we can also drop the
assignments for class, class_mask and driver_data.
(found by Aaro Koskinen)

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 18:00:09 -08:00
Rob Clark cd5351f4d2 staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform.  Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels.  And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).

The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's.  Note that this arrangement might change slightly
when support for drm_plane overlays is added.

For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()).  In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().

See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git

Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302

Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/

History:

v5: move headers from include/drm at Greg KH's request, minor rebasing
    on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
    because "drm/gem: add functions to get/put pages" patch is not
    merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
    rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
    API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
    unneeded functions, use dma_addr_t for physical addresses, error
    handling cleanup, refactor attach/detach pages into common drm
    functions, split non-userspace-facing API into omap_priv.h, remove
    plugin API

v1: original

Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:43:30 -08:00
wwang f7364ba04b staging:rts_pstor:Complete scanning_done variable
Complete scanning_done variable if rtsx-scan thread created failed.

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:37:39 -08:00
Bart Westgeest 438957f8d4 staging: usbip: bugfix for deadlock
Interrupts must be disabled prior to calling usb_hcd_unlink_urb_from_ep.
If interrupts are not disabled, it can potentially lead to a deadlock.
The deadlock is readily reproduceable on a slower (ARM based) device
such as the TI Pandaboard.

Signed-off-by: Bart Westgeest <bart@elbrys.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:37:38 -08:00
Greg Kroah-Hartman be7f39c5ec Staging: delete spectra driver
To quote Alan:
	Moorestown/Oaktrail has appeared only in the PC like form so the
	following bits of staging can be binned:

	drivers/staging/spectra

so let's delete it.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:28:56 -08:00
Martyn Welch 9dc367bc4c Driver for GE PIO2 VME Card
This patch implements a driver for the GE PIO2 VME Parallel I/O Card.  This
card is a 6U VME Card, implementing 32 solid-state relay switched IO lines,
in 4 groups of 8. Each bank of IO lines is built to function as input,
output or both depending on the variant of the card.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:25:38 -08:00
Manohar Vanga 8cdc081913 staging: vme: fix comment for struct vme_dev
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:25:38 -08:00
Manohar Vanga 5b93c2a2f1 staging: vme: remove vme_add_bus() and vme_remove_bus()
The functions vme_add_bus() and vme_remove_bus() were only being used
in the vme_register_bridge() and vme_unregister_bridge() functions
respectively. This patch gets rid of them and moves their code to
vme_register_bridge() and vme_unregister_bridge().

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:25:38 -08:00
Manohar Vanga c26f611299 staging: vme: fix comment in __vme_register_driver()
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:25:38 -08:00
Martyn Welch 3fe0a87f8f Staging: VME: Update TODO file
Contents of TODO file has become more of a feature wish-list rather than issues
which should stop the VME driver being merged into the mainline kernel.

Update the TODO list with issues that need to be resolved before it can be
migrated to mainline.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:23:57 -08:00
Manohar Vanga b91a9363bb staging: vme: fix address cast warnings for 64 bit architectures
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:23:57 -08:00
Dan Carpenter 9638b67ba2 Staging: sep: potential buffer overflow in ioctl
tail_size is determined by several variables that come from the user
so we should verify that it's not too large.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:23:57 -08:00
Thomas Meyer 23226977e9 staging: rtl8192e: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation

 The semantic patch that makes this change is available
 in scripts/coccinelle/api/memdup.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:21:17 -08:00
Thomas Meyer d9317533c5 staging: rtl8192e: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation

 The semantic patch that makes this change is available
 in scripts/coccinelle/api/memdup.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:21:16 -08:00
Thomas Meyer 929fa2a42e staging: rtl8192e: Use kzalloc rather than kmalloc v2
Use kzalloc rather than kmalloc followed by memset with 0

This considers some simple cases that are common and easy to validate
Note in particular that there are no ...s in the rule, so all of the
matched code has to be contiguous

The semantic patch that makes this change is available
in scripts/coccinelle/api/alloc/kzalloc-simple.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:21:16 -08:00
Stefan Lippers-Hollmann 61fcc0166f rtl8192e: drop alternate code paths for CONFIG_PM_RTL
It has always been enabled unconditionally by ccflags-y.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:19:24 -08:00
Stefan Lippers-Hollmann 71769d737a rtl8192e: use HAVE_NET_DEVICE_OPS unconditionally
Mainline provides NET_DEVICE_OPS, remove alternate code paths and now
obsolete defines from ccflags-y.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:19:24 -08:00
Stefan Lippers-Hollmann 44b6eb2637 rtl8192e: remove stale defines from ccflags-y
Code paths using these defines have been removed long time ago,
now remove stale references from injected ccflags-y.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:19:24 -08:00
Jesper Juhl 6f03053b68 rtl8192e: Don't copy huge struct by value (and make it const).
rtllib_is_shortslot() takes one argument - a struct that's more than a
kilobyte large. It should take a pointer instead of copying such a
huge struct - and the argument might as well be declared 'const' now
that we are at it, since it is not modified. This patch makes these
changes.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:19:23 -08:00
Julia Lawall 7c19c1e80d drivers/staging/rtl8712/rtl871x_mlme.c: eliminate a null pointer dereference
If ibss_wlan is NULL, it is not correct to memcpy into its field.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

if (E == NULL)
{
  ... when != if (E == NULL || ...) S1 else S2
      when != E = E1
*E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:19:23 -08:00
Marc Dietrich 7990b0d7ec staging: nvec: add device tree support
This adds device tree support to the nvec driver. By using this method
it is no longer necessary to specify platform data through a board
file.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Cc: Julian Andres Klode <jak@jak-linux.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:17:14 -08:00
Kevin McKinney d9f26a6689 Staging: bcm: Fix semaphore locking error when downloading firmware.
This patch releases semaphore locks when
an error occurrs while attempting to
download firmware for the bcm driver.
When downloading firmware for this driver,
a process is expected to call
the following ioctl's in this order:
(1)IOCTL_BCM_BUFFER_DOWNLOAD_START,
(2)IOCTL_BCM_BUFFER_DOWNLOAD, and (3)
IOCTL_BCM_BUFFER_DOWNLOAD_STOP.
Semaphore, “Adapter->fw_download_sema” is
expected to be acquired in the first ioctl,
IOCTL_BCM_BUFFER_DOWNLOAD_START, and it should
block until IOCTL_BCM_BUFFER_DOWNLOAD_STOP
is called.  In this case, if an error
occurred before STOP finished, the semaphore
"Adapter->fw_download_sema" was not being released.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney abe33fc093 Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD
In this ioctl, we are testing to see if the lock is held.
If it is not held, that means this ioctl used incorrectly.
Therefore, we do not want to take the lock ourselves here.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney 77121d52a4 Staging: bcm: Remove unnecessary "do while" statement in, IOCTL_BCM_BUFFER_DOWNLOAD
This patch removes a superfluous "do while"
statement in IOCTL_BCM_BUFFER_DOWNLOAD.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:14:48 -08:00
Kevin McKinney 51935d2259 Staging: bcm: Clean up code in ioctl: IOCTL_BCM_EEPROM_REGISTER_READ
This patch verifies two conditions before executing
a kmalloc call. First, it checks to see that
IoBuffer.OutputLength is not greater than an
unsigned short. If so, an invalid value may be
returned. The second change is a check to make
sure IoBuffer.OutputLength is not equal to
zero. Which simply keeps this code inline with
the other ioctl, IOCTL_BCM_REGISTER_READ_PRIVATE.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:13:33 -08:00
Kevin McKinney 41c7b7c0fa Staging: bcm: Fix information leak in ioctl: IOCTL_BCM_REGISTER_READ_PRIVATE, IOCTL_BCM_EEPROM_REGISTER_READ
This patch fixes an information leak in ioctl
IOCTL_BCM_REGISTER_READ_PRIVATE and
IOCTL_BCM_EEPROM_REGISTER_READ when determining
the number of bytes to copy to user space.  Function,
usb_control_msg, returns the correct number of
bytes from the hardware.  Instead of using
this value, we were using a value derived from
user space. In this case, this value could be more
than the hardware allocated.  Therefore, this
patch copies the proper number of bytes from
the hardware, and uses this value as the maximum
number of bytes for user space.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:58 -08:00
Diego F. Marfil 57bfa9d417 Staging: bcm: hostmibs: Added temporary variable to shorten lines
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:12 -08:00
Diego F. Marfil 94abda9837 Staging: bcm: hostmibs: White spaces and indentation fixes.
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:11 -08:00
Diego F. Marfil ed8e9bb7e0 Staging: bcm: hostmibs: C99 comments replaced
Signed-off-by: Diego F. Marfil <diegomarfil@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:11:11 -08:00
Thomas Meyer 27b7923035 staging: hv: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:03:56 -08:00
K. Y. Srinivasan b401731985 Staging: hv: storvsc: Support hot-removing of scsi devices
Support hot-removing of scsi devices.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:08 -08:00
K. Y. Srinivasan 126757998a Staging: hv: storvsc: Support hot add of scsi disks
Support hot add of scsi disks.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:08 -08:00
K. Y. Srinivasan 2b9525f511 Staging: hv: storvsc: Upgrade the vmstor protocol version
In preparation for supporting hot add/remove of scsi devices,
upgrade the vmstor protocol version.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:08 -08:00
K. Y. Srinivasan a404c1ff55 Staging: hv: storvsc: Get rid of an unnecessary forward declaration
Get rid of an unnecessary forward declaration.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:08 -08:00
K. Y. Srinivasan fafb0efc30 Staging: hv: storvsc: use the macro KBUILD_MODNAME
Use the macro KBUILD_MODNAME.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan bab445e12b Staging: hv: storvsc: Use the unlocked version queuecommand
Use the unlocked version queuecommand.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan 7f33f30a67 Staging: hv: storvsc: Use the accessor function shost_priv()
Use the accessor function shost_priv().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan a00e8224c1 Staging: hv: storvsc: Fix error handling storvsc_host_reset()
Fix error handling storvsc_host_reset(). I would like to thank
Long Li <longli@microsoft.com> for reporting this.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reported-by: Long Li <longli@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan 59e00e744d Staging: hv: storvsc: Fixup the error when processing SET_WINDOW command
Fixup the error when processing SET_WINDOW command.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan 225ce6eab7 Staging: hv: storvsc: Cleanup error handling in the probe function
Cleanup error handling in the probe function.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan 4e03e697c5 Staging: hv: storvsc: Use mempools to allocate struct storvsc_cmd_request
We intend to use the storage driver to manage the root device.
To avoid deadlocks, use mempools to allocate struct storvsc_cmd_request.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:02:07 -08:00
K. Y. Srinivasan 1c7dac3269 Staging: hv: mousevsc: Use the KBUILD_MODNAME macro
Use the KBUILD_MODNAME macro.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:00:01 -08:00
K. Y. Srinivasan 226383751f Staging: hv: mousevsc: Add a check to prevent memory corruption
Add a check to prevent memory corruption.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:00:01 -08:00
K. Y. Srinivasan dba8e1ad95 Staging: hv: mousevsc: Address some style issues
Deal with some style related issues. Also get rid of an unused macro.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:00:01 -08:00
K. Y. Srinivasan f72a1cc74f Staging: hv: mousevsc: Get rid of unnecessary include files
Get rid of unnecessary include files.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:46 -08:00
K. Y. Srinivasan f50617fabd Staging: hv: mousevsc: Add a new line to a debug string
Add a new line to a debug string.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:46 -08:00
K. Y. Srinivasan 3b5632efd9 Staging: hv: mousevsc: Cleanup mousevsc_on_channel_callback()
Cleanup mousevsc_on_channel_callback(). This is based on the code provided
by Joe Perches <joe@perches.com>.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:45 -08:00
K. Y. Srinivasan 32325302aa Staging: hv: mousevsc: Inline the code for reportdesc_callback()
Inline the code for reportdesc_callback() as this function is called from
mousevsc_probe(). As part of this, cleanup the code in reportdesc_callback().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:45 -08:00
K. Y. Srinivasan 5cf06b0de8 Staging: hv: mousevsc: Inline the code for mousevsc_on_device_add()
Inline the code for mousevsc_on_device_add() as this only used from
the function mousevsc_probe().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:45 -08:00
K. Y. Srinivasan a1914f5416 Staging: hv: mousevsc: Make boolean states boolean
Make some state that is boolean in nature, a boolean variable.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:57:44 -08:00
Dan Carpenter c1a752883d Staging: iio: fix endian conversion in ad7298_scan_direct()
"tmp" is used to store the output from cpu_to_be16() so it should be
a __be16 bit type.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:55:38 -08:00
Sasha Levin 5ae8f44090 iio: Don't OOPS if dummy evgen failed init
If the dummy evgen failed init, the irq allocation functions which assume
init succeeded may still be called - causing an OOPS due to wrong assumption.

Here's the oops:

[    3.914332] BUG: unable to handle kernel NULL pointer dereference at 0000000000000148
[    3.915310] IP: [<ffffffff810b3008>] __lock_acquire+0xac/0xe50
[    3.915310] PGD 0
[    3.915310] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[    3.915310] CPU 1
[    3.915310] Pid: 1, comm: swapper Not tainted 3.2.0-rc2-sasha-00279-gd7bfb12-dirty #20
[    3.915310] RIP: 0010:[<ffffffff810b3008>]  [<ffffffff810b3008>] __lock_acquire+0xac/0xe50
[    3.915310] RSP: 0018:ffff880012499bc0  EFLAGS: 00010046
[    3.915310] RAX: 0000000000000086 RBX: ffff880012490000 RCX: 0000000000000000
[    3.915310] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000148
[    3.915310] RBP: ffff880012499c90 R08: 0000000000000002 R09: 0000000000000000
[    3.915310] R10: 0000000000000148 R11: 0000000000000000 R12: 0000000000000148
[    3.915310] R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000
[    3.915310] FS:  0000000000000000(0000) GS:ffff880013c00000(0000) knlGS:0000000000000000
[    3.915310] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[    3.915310] CR2: 0000000000000148 CR3: 0000000002605000 CR4: 00000000000406e0
[    3.915310] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    3.915310] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[    3.915310] Process swapper (pid: 1, threadinfo ffff880012498000, task ffff880012490000)
[    3.915310] Stack:
[    3.915310]  ffff880012490000 ffffffff81e6fd38 ffffffff00000000 0000000000000000
[    3.915310]  0000000000000148 0000000012499c08 ffffffff00000000 000000000000002e
[    3.915310]  0000000000000001 ffff880012499ce0 ffffffff8161620e 0000000000000000
[    3.915310] Call Trace:
[    3.915310]  [<ffffffff81e6fd38>] ? retint_restore_args+0x13/0x13
[    3.915310]  [<ffffffff8161620e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[    3.915310]  [<ffffffff81e6fd38>] ? retint_restore_args+0x13/0x13
[    3.915310]  [<ffffffff81af8883>] ? iio_dummy_evgen_get_irq+0x33/0x8a
[    3.915310]  [<ffffffff810b4255>] lock_acquire+0x8a/0xa7
[    3.915310]  [<ffffffff81af8883>] ? iio_dummy_evgen_get_irq+0x33/0x8a
[    3.915310]  [<ffffffff81e6db81>] __mutex_lock_common+0x63/0x491
[    3.915310]  [<ffffffff81af8883>] ? iio_dummy_evgen_get_irq+0x33/0x8a
[    3.915310]  [<ffffffff810b474d>] ? debug_check_no_locks_freed+0x135/0x14a
[    3.915310]  [<ffffffff810b2c3a>] ? lock_is_held+0x92/0x9d
[    3.915310]  [<ffffffff81e6dfe5>] mutex_lock_nested+0x36/0x3b
[    3.915310]  [<ffffffff81af8883>] iio_dummy_evgen_get_irq+0x33/0x8a
[    3.915310]  [<ffffffff81af8594>] iio_simple_dummy_events_register+0x1b/0x69
[    3.915310]  [<ffffffff82ad4a91>] iio_dummy_init+0x105/0x18d
[    3.915310]  [<ffffffff82ad498c>] ? iio_init+0x7d/0x7d
[    3.915310]  [<ffffffff82a8dc02>] do_one_initcall+0x7a/0x135
[    3.915310]  [<ffffffff82a8dda7>] kernel_init+0xea/0x16f
[    3.915310]  [<ffffffff81e727c4>] kernel_thread_helper+0x4/0x10
[    3.915310]  [<ffffffff81e6fd38>] ? retint_restore_args+0x13/0x13
[    3.915310]  [<ffffffff82a8dcbd>] ? do_one_initcall+0x135/0x135
[    3.915310]  [<ffffffff81e727c0>] ? gs_change+0x13/0x13
[    3.915310] Code: 95 50 ff ff ff 74 24 e8 1f 3f 56 00 85 c0 0f 84 4e 0d 00 00 be cf 0b 00 00 83 3d 63 7c 58 02 00 0f 85 3c 0d 00 00 e9 c1 0c 00 00
[    3.915310]  81 3a a0 17 ca 82 b8 01 00 00 00 44 0f 44 e8 83 fe 01 77 0c
[    3.915310] RIP  [<ffffffff810b3008>] __lock_acquire+0xac/0xe50
[    3.915310]  RSP <ffff880012499bc0>
[    3.915310] CR2: 0000000000000148

Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:52:44 -08:00
Lars-Peter Clausen 55e4390cb0 staging:iio: Add missing MODULE_DEVICE_TABLE and MODULE_ALIAS
Quite a few iio drivers provide no MODULE_DEVICE_TABLE or MODULE_ALIAS or only
provide a MODULE_ALIAS while they have support for multiple device ids. This
prevents auto module loading from working correctly.

This patch fixes it by adding the missing MODULE_DEVICE_TABLEs and
MODULE_ALIAS'.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:48:04 -08:00
Lars-Peter Clausen 275de9f7a8 staging:iio:dac:ad5624r: Convert to channel spec
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:46:58 -08:00
Lars-Peter Clausen a7b152881c staging:iio:dac:ad5504: Convert to channel spec
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:46:58 -08:00
Lars-Peter Clausen 33ad6b21f6 staging:iio:dac:ad5446: Convert to channel spec
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:46:57 -08:00
Paul Bolle 73aaf63c5e staging: iio: drop "select IIO_SIMPLE_DUMMY_EVGEN"
Commit e6477000fc ("staging:iio:dummy Add event support + fake event
generator") added "select IIO_SIMPLE_DUMMY_EVGEN if [...]". But there
is no Kconfig symbol named IIO_SIMPLE_DUMMY_EVGEN. The select statement
for that symbol is a nop. Drop it.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Jonathan Cameron <jic23@camd.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:43:38 -08:00
Lars-Peter Clausen 465825963c staging:iio:dac:ad5446: Add support for the AD5662
The AD5662 is compatible to the AD5660, but uses an external reference instead
of an internal.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:43:38 -08:00
Lars-Peter Clausen 5691b23489 staging:iio:dac: Add AD5421 driver
This patch adds support for the Analog Devices AD5421 Loop-Powered, 4mA to 20mA
DAC.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:39:58 -08:00
Lars-Peter Clausen 19c2aedc54 staging:iio: IIO_EVENT_CODE: Clamp channel numbers
Make sure we only use the allotted space for channel numbers in the event mask
and do not let them override other fields.

Since negative values are valid channel number, cast the channel number to
signed when extracting it from an event mask.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:39:58 -08:00
Lars-Peter Clausen 43c0364551 staging:iio: Make write_event_value callback optional
Some devices have fixed thresholds which can not be modified so make the
write_event_value callback optional, so the drivers for these devices do not
have to implement a boilerplate no-op callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:39:58 -08:00
Dan Carpenter 685e010748 Staging: iio/dac/ad5360.c: signedness bug in ad5360_read_raw()
ad5360_get_channel_vref() returns an int and scale_uv should be the
same.  Making it unsigned here breaks the error handling.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:38:32 -08:00
Dan Carpenter 23a3b8cc9c Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw()
regulator_get_voltage() returns an int so "scale_uv" should be an
int.  Making it unsigned here breaks the error handling.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:38:32 -08:00
Jonathan Cameron c8a9f8056f staging:iio:treewide only use shared to decide on interfaces
Internally the fact that say scale is shared across channels is
actually of remarkably little interest.  Hence lets not store it.
Numerous devices have weird combinations of channels sharing
scale anyway so it is not as though this was really telling
us much. Note however that we do still use the shared sysfs
attrs thus massively reducing the number of attrs in complex
drivers.

Side effect is that certain drivers that were abusing this
(mostly my work) needed to do a few more checks on what the
channel they are being queried on actually is.

This is also helpful for in kernel interfaces where we
just want to query the scale and don't care whether it
is shared with other channels or not.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 924f8a21dd staging:iio: Do not use bitmasks for channel info addresses
Currently the iio framework uses bitmasks for the address field of channel info
attributes. This is for historical reasons and no longer required since it will
only ever query a single info attribute at once. This patch changes the code to
use the non-shifted iio_chan_info_enum values for the info attribute address.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 3014cd97e5 staging:iio: Add documentation for IIO_EVENT_CODE
Document the different parameters of the IIO_EVENT_CODE macro and friends.

While we are at it standardise the name of channel type parameter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Lars-Peter Clausen 65d5ff8d51 staging:iio: Use userspace types for iio_event_data
Since we want to export struct iio_event_data to userspace use the userspace
integer types. Also add a include to linux/types.h.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Jonathan Cameron af5046af1c staging:iio: header reorganization
Issue brought up by Lars-Peter Clausen. This is a varient of what
he suggested.

io/iio.h for driver stuff (has to include types.h)
	Sub files for the bits drivers may or may not use
	iio/sysfs.h
	iio/buffer.h (contents of current buffer_generic.h)
	(obviously anything offering events will need events.h as well)
iio/types.h for the enums that matter to both
	iio_chan_type, iio_modifier
iio/events.h for the event code stuff
	IIO_EVENT_CODE and friends.  + everything in chrdev.h  So this
	is the stuff that userspace cares about.
	Also include iio_event_type, iio_event_direction

Thus iio drivers include iio.h + as required
events.h
sysfs.h
buffer.h

in kernel users (once that interface is merged) will need inkern.h
which will pull in types.h

Userspace will need just events.h (which pulls in types.h) to get
everything they need to know about.  Buffer userspace access doesn't
currently need any core defines. All information about the data
format is passed through sysfs.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:35:04 -08:00
Greg Kroah-Hartman f791cec850 Subject: fix build breakage in drivers/staging/iio/industrialio-core.c
This was introduced in commit b464133679
(iio: fix a leak due to improper use of anon_inode_getfd())

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:31:16 -08:00
Jonathan Cameron 96e00f110f staging:iio: core. Allow for event chrdev obtaining ioctl if no buffer present.
Logic bug meant the chrdev would fail to open if there was no buffer support
in a driver or in the core. This meant the ioctl to get the event chrdev
would fail and hence events were not available.

V2: change error to -EINVAL to mark as unsuitable for reading rather than
not there.  Both are true depending on how you look at it.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:31 -08:00
Lars-Peter Clausen bc9f35db8f staging:iio:iio_utils.h: Add missing include
iio_utils.h uses opendir and friends which need dirent.h

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:31 -08:00
Lars-Peter Clausen dc8f52643d staging:iio:events: Make sure userspace buffer is large enough
Make sure that the userspace buffer is large enough to hold a iio_event_data
struct before writing to it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:31 -08:00
Jonathan Cameron 0403e0d643 staging:iio:core shared attrs do not work with modifier.
The logic building the name had a small bug where
it did not verify if it was generic before applying the
modifier.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Jonathan Cameron 5dd72ecb01 staging:iio: trigger fixes for repeat request of same trigger and allocation failure
Both of these are decidedly silly bugs show up whilst testing
completely different code paths.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Jonathan Cameron 4c3d15358a staging:iio:kfifo remove entirely pointless code.
I really don't want to think about how this bit got
in there.  It allocates some storage - copies something
into it then frees it without making use of it.
Oops.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Jonathan Cameron e69616b1e6 staging:iio:industrialio-trigger.c Trivial code style brackets fix
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Jonathan Cameron 67be8e32c9 staging:iio:triggers Remove unecessary existence checks and return val
Postenable and predisable are called via buffer->ops so  don't
need to check if buffer exists.

The return value of iio_device_register_trigger_consumer is
always zero and it isn't checked anyway so get rid of it.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Maxin B. John 22dc09cafd staging:iio:light:tsl2563 missing setting of id in get id function.
Signed-off-by: Maxin B. John <maxin.john@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Jonathan Cameron a7e3bd669e staging:iio:light:tsl2563 both intensity channels have same chan_spec.
Bug has been fixed for some time in the outofstaging tree, but
didn't propogate back to here.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:30:30 -08:00
Michael Hennerich 703a9ce45a iio: adc: ad7280a: Fix memory leak
Free channels in case read fails with error.

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>
2011-11-26 16:28:56 -08:00
Michael Hennerich e15fbc91a4 iio: introduce type casts to avoid __ucmpdi2 calls
This patch type casts the switch control variable to 32 bits in order to
prevent a call __ucmpdi2 generated by some versions of gcc.

This fixes an undefined reference to `__ucmpdi2' when compiled for arch/blackfin

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>
2011-11-26 16:28:56 -08:00
Greg Kroah-Hartman 53b99be764 Staging: rtl8192u: remove api.c file
It wasn't being used, and had a hacked-up export symbol table which
wasn't very nice either.

Reported-by: James Morris <jmorris@namei.org>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:25:54 -08:00
Geert Uytterhoeven 0775c98acf m68k/serial: Remove obsolete IRQ_FLG_* users
The m68k core irq code stopped honoring these flags during the irq
restructuring in 2006.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:22:27 -08:00
Mark Einon 54dbf04f91 staging: et131x: Remove section comments
Following the move to put the driver into one file, comments were added to identify which source file each set of functions originated from.
These no longer made sense after functions were moved around to remove some forward declarations, so remove them.

A function comment was previously not moved along with its function, now they are reunited.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:21:24 -08:00
Francois Romieu d14e3d05f3 et131x: uncloak PCIe capabilities.
FIXME: it should be possible to get rid of ET1310_PCI_L0L1LATENCY as well.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:21:24 -08:00
Francois Romieu 5f3eb881a9 et131x: kiss netdev.{base_addr, irq} goodbye.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:21:06 -08:00
Francois Romieu c3abb6871e et131x: remove extraneous pci_save_state.
pci_{save, restore}_state are balanced in .suspend and .resume.
They are not used anywhere else in the driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:21:06 -08:00
Francois Romieu fa9f0a657e et131x: fix error paths in et131x_pci_setup.
Wrong status code and unbalanced phy_connect.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:20:36 -08:00
Francois Romieu 834d0ee317 et131x: uintxy_t removal.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:19:31 -08:00
Francois Romieu eb7a6ca618 et131x: add static qualifiers.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:19:31 -08:00
Thomas Meyer cff863871e Staging: line6: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation

 The semantic patch that makes this change is available
 in scripts/coccinelle/api/memdup.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:57 -08:00
Stefan Hajnoczi 140e28b83c staging: line6: alloc/free buffers in hw_params/hw_free
It is unsafe to free buffers in line6_pcm_stop(), which is not allowed
to sleep, since urbs cannot be killed completely there and only
unlinked.  This means I/O may still be in progress and the URB
completion function still gets invoked.  This may result in memory
corruption when buffer_in is freed but I/O is still pending.

Additionally, line6_pcm_start() is not supposed to sleep so it should
not use kmalloc(GFP_KERNEL).

These issues can be resolved by performing buffer allocation/freeing in
the .hw_params/.hw_free callbacks instead.  The ALSA documentation also
recommends doing buffer allocation/freeing in these callbacks.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:12 -08:00
Stefan Hajnoczi 3b08db37cb staging: line6: use smallest iso ep packet size
The POD HD300 isochronous endpoints have different max packet sizes for
read and write.  Using the read endpoint max packet size may be too
large for the write endpoint.  Instead we should use the minimum of both
endpoints to be sure the size is acceptable.

In theory we could decouple read and write packet sizes but the driver
currently uses a single size which I chose not to mess with since other
features like software monitoring may depend on a single packet size for
both endpoints.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:12 -08:00
Stefan Hajnoczi 1dc403ffec staging: line6: add missing MIDI postprocessing case for POD HD300
The driver leaves MIDI processing up to userspace for the POD HD300
device.  Add a missing case statement to skip MIDI postprocessing in the
driver.  This change has no effect other than silencing a printk:

  line6usb driver bug: missing case in linux/drivers/staging/line6/midi.c:179

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:11 -08:00
Stefan Hajnoczi 16dc104011 staging: line6: add Pod HD300 support
The Pod HD device family uses new MIDI SysEx messages and therefore
cannot reuse the existing Pod code.  Instead of hardcoding Pod HD MIDI
messages into the driver, leave MIDI up to userspace.  This driver
simply presents MIDI and pcm ALSA devices.

This device is similar to the Pod except that it has 48 kHz audio and
does not respond to Pod SysEx messages.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:11 -08:00
Jesper Juhl 982d6ab501 line6: fix memory leaks in line6_init_midi()
If the first call to line6_midibuf_init() fails we'll leak a little
bit of memory. If the second call fails we'll leak a bit more. This
happens when we return from the function and the local variable
'line6midi' goes out of scope.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:14:11 -08:00
Tomas Winkler 6f37aca827 staging/mei: fix check for allocating host client id
MEI_CLIENTS_MAX is 255 and host_client_id is u8 therefore
for check to work we need to first assign the return value
of find_first_zero_bit to unsigned long variable

Fix warning

drivers/staging/mei/main.c: In function mei_open
drivers/staging/mei/main.c:260:2: warning: comparison is always false due to limited range of data type

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:05:14 -08:00
Oren Weil 5b881e3c08 staging: mei: expose misc interface instead of char device
Misc device provides everything MEI needs for registration,
it doesn't required separate driver class.

Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:05:13 -08:00
Tomas Winkler 575c1e43c8 staging:mei: wd_ops and wd_info should be static
wd_ops and wd_info structures are local to wd.c so mark them static

Cc: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:05:13 -08:00
Alan Cox 55f9102b75 gma500: mark staging broken
It now clashes with upstream DRM which we don't want to block.

We don't want to delete this code just yet as we want to keep it for
comparison and reference when debugging, but soon it will be a removal
candidate as well

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: linux-next@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:05:13 -08:00
Andy Whitcroft aaa0b4f007 iio: iio_event_getfd -- fix ev_int build failure
Fix build failure in staging iio driver:

.../drivers/staging/iio/industrialio-core.c: In function 'iio_event_getfd':
.../drivers/staging/iio/industrialio-core.c:262:32: error:
			'ev_int' undeclared (first use in this function)

Also convert the rest of the function to use the new variable.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-11-26 13:23:49 -08:00
Dan Carpenter 87d466e503 [media] staging/media: lirc_imon: add a __user annotation
This silences the following Sparse warnings:
lirc_imon.c:404:32: warning: incorrect type in argument 1 (different address spaces)
lirc_imon.c:404:32:    expected void const [noderef] <asn:1>*<noident>
lirc_imon.c:404:32:    got char const *buf
lirc_imon.c:117:28: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
lirc_imon.c:117:28:    expected long ( *write )( ... )
lirc_imon.c:117:28:    got long ( static [toplevel] *<noident> )( ... )

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-26 08:48:03 -02:00
Jesse Barnes 15b273bb26 drm/staging/gma500: fix linux-next build
Here's a patch to move things over to the new addfb2 interfaces at
least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-25 10:13:42 +00:00
Pete 7e5219d18e [media] go7007: Fix 2250 urb type
commit a846d8fce9e8be30046be3c512982bd0345e7015

The 2250 board uses bulk endpoint for interrupt handling,
and should use a bulk urb instead of an int urb.

Signed-off-by: Pete Eberlein <pete@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 21:09:25 -02:00
Gianluca Gennari dd7aaa4d9d [media] staging: as102: Add support for Sky Italia Digital Key based on the same chip
Add support for the Sky Italia Digital Key, an USB dongle offered
by Sky Italia to its customers for use with their satellite set-top-boxes.
This is the "green led" model based on the Abilis as102 chip, while the
so called "blue led" model is based on the Avermedia A867 design.

Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:34:48 -02:00
Tomas Winkler a6ff0a06d8 [media] easycap: fix warnings: variable set but not used
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:18:19 -02:00
Tomas Winkler 0b217d2125 [media] easycap: drop usb_class_driver
Drop usb_class_driver and collaterals as it is not used

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:17:53 -02:00
Tomas Winkler 96bec7dd72 [media] easycap: add easycap prefix to global functions names
Add easycap prefix to global function to reduce
possibility of name collision.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:17:32 -02:00
Tomas Winkler a5b6ee06b2 [media] easycap: remove unused members of struct easycap
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:17:02 -02:00
Tomas Winkler 4329f3c6a5 [media] easycap: easycap_usb_driver should be static to easycap_main.c
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:16:49 -02:00
Tomas Winkler 8b1fad2f04 [media] easycap: use usb_kill_urb wrapper functions
1. kill_video_usb can be used in all places where video urbs are killed
and reduce code repetition

2. remove unnecessary check for easycap == NULL in the function
as it is always checked by the calling function

3. rename the function to easycap_video_kill_urb to reduce
possibility of name conflict

4. implement also easycap_audio_kill_urb

5. simplify freeing urbs

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:16:22 -02:00
Tomas Winkler 7dfdae8e32 [media] easycap: drop initializations to 0 in the probe functions
peasycap was allocated using kzalloc so drop all
to zero initializations

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:14:15 -02:00
Tomas Winkler 101dca425d [media] easycap: streamline the code
change statements of types
	if (err)
		return err
	else
		do something

and
	if (ok)
		do something
	else
		return err

into

	if (err)
		return err

	do something

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:12:53 -02:00
Tomas Winkler 7dbb392025 [media] easycap: compress initialization tables
1. saa and stk initialization tables are less then
256 entries
2. stk table can fit into u16 and saa into u8

size before
 text	   data	    bss	    dec	    hex	filename
 105687	   1072	1134800	1241559	 12f1d7	easycap.ko

size after

 text	   data	    bss	    dec	    hex	filename
 97919	   1072	1134800	1233791	 12d37f	easycap.ko

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:10:36 -02:00
Tomas Winkler 47cefc21ef [media] easycap: remove linux/version.h include from easycap_ioctl.c
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:09:50 -02:00
Tomas Winkler 98680557f3 [media] easycap: cleanup function usage
1. Remove declarations of none global functions from easycap.h
and make them static in the c-files.
2. Reorder static functions to reduce number of forward declarations.
3. Remove unused functions.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 19:09:08 -02:00
Ben Hutchings affc9a0d59 [media] staging: lirc_serial: Do not assume error codes returned by request_irq()
lirc_serial_probe() must fail if request_irq() returns an error, even if
it isn't EBUSY or EINVAL,

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 18:18:21 -02:00
Ben Hutchings 9b98d60679 [media] staging: lirc_serial: Fix bogus error codes
Device not found?  ENODEV, not EINVAL.
Write to read-only device?  EPERM, not EBADF.
Invalid argument?  EINVAL, not ENOSYS.
Unsupported ioctl?  ENOIOCTLCMD, not ENOSYS.
Another function returned an error code?  Use that, don't replace it.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 18:18:05 -02:00
Ben Hutchings 1ff1d88e86 [media] staging: lirc_serial: Fix deadlock on resume failure
A resume function cannot remove the device it is resuming!

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 18:17:50 -02:00
Ben Hutchings c8e57e1b76 [media] staging: lirc_serial: Free resources on failure paths of lirc_serial_probe()
Failure to allocate the I/O region leaves the IRQ allocated.
A later failure leaves them both allocated.

Reported-by: Torsten Crass <torsten.crass@eBiology.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 18:17:30 -02:00
Ben Hutchings 9105b8b200 [media] staging: lirc_serial: Fix init/exit order
Currently the module init function registers a platform_device and
only then allocates its IRQ and I/O region.  This allows allocation to
race with the device's suspend() function.  Instead, allocate
resources in the platform driver's probe() function and free them in
the remove() function.

The module exit function removes the platform device before the
character device that provides access to it.  Change it to reverse the
order of initialisation.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 18:16:40 -02:00