Xenia Ragiadakou [Thu, 10 Oct 2013 07:43:50 +0000 (10:43 +0300)]
staging: rtl8192u: fix comments in r819xU_cmdpkt.h
This patch fixes the comments in r819xU_cmdpkt.h by:
* removing any empty or unnecessary comments
* replacing the // comments with /* */ comments
* removing date and author information from comments
This is done to improve code readability and to conform to linux kernel
coding style.
Xenia Ragiadakou [Thu, 10 Oct 2013 07:43:47 +0000 (10:43 +0300)]
staging: rtl8192u: remove #ifdef JOHN_
This patch removes the guards #ifdef JOHN_HWSEC, #ifdef JOHN_DUMP_TXDESC and
because the code inside them calls some undefined functions (e.g read_rtl8225,
rtl8187_read_phy etc).
Ian Abbott [Tue, 8 Oct 2013 18:06:38 +0000 (19:06 +0100)]
staging: comedi: s626: move struct buffer_dma
Move the declaration of `struct buffer_dma` from "s626.h" to "s626.c" as
it seems more at home there. After this move, "s626.h" just contains
macros related to hardware registers.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:36 +0000 (19:06 +0100)]
staging: comedi: s626: add mmiowb() calls
`s626_mc_enable()` is often called to enable some function in a control
register after setting up some other registers. Precede the write to
the control register with a call to `mmiowb()` to preserve mmio write
ordering.
`s626_mc_disable()` is called to disable some function in a control
register and is often followed up by writes to other registers. Follow
the write to the control register with a call to `mmiowb()` to preserve
mmio write ordering.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:35 +0000 (19:06 +0100)]
staging: comedi: s626: remove TRUE and FALSE macros
"s626.h" defines the macros `TRUE` and `FALSE` if they are not already
defined, yielding the expected numeric values. Remove the macros and
replace their usage with the values `true` and `false`, respectively.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:30 +0000 (19:06 +0100)]
staging: comedi: s626: remove encpriv macro
The `encpriv` macro relies on a local variable `dev` (of type `struct
comedi_device *`) being set correctly. By a convoluted path involving
the `private` data pointer of subdevice 5 (the encoder (counter)
subdevice), the macro always yields a pointer to the first element of
the static array `enc_private_data[]`. That holds statically constant
data for each of 6 encoder channels.
Instead of using the `encpriv` macro, just access the array it points to
directly and get rid of the macro. Don't bother initializing the
`private` member of the encoder subdevice any more. Since
`enc_private_data[]` now has nothing to so with subdevice private data,
rename `enc_private_data[]` to `s626_enc_chan_info[]` and rename its
type from `struct enc_private` to `struct s626_enc_info`. Since the
array contains unchanging, static information, declare it `const` and
declare all the variables that point to it `const`.
A forward declaration of `s626_enc_chan_info[]` has been added
temporarily and will be removed by a later patch.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:27 +0000 (19:06 +0100)]
staging: comedi: s626: remove a variable from set_mode_a() and _b()
The `set_mode_a()` and `set_mode_b()` functions use a local variable
`setup` which is initialized to the value of parameter `Setup` which is
not used further. Get rid of the local variable and rename the
parameter to `setup`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:26 +0000 (19:06 +0100)]
staging: comedi: s626: rename CamelCase in struct enc_private
Rename the CamelCase members of `struct enc_private`. Since most of
those are function pointers pointing to functions with similar names as
the members, rename the functions they point to as well.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The `I2C_B0(ATTR, VAL)`, `I2C_B1(ATTR, VAL)` and `I2C_B2(ATTR, VAL)`
macros are defined identically in "s626.h" and "s626.c". Remove the
duplicates from "s626.c".
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:22 +0000 (19:06 +0100)]
staging: comedi: s626: remove I2CR and I2CW macros
The `I2CR` and `I2CW` macros expand to the I2C read and write addresses,
respectively. They are only used in one place each and include the name
of a local variable `devpriv` in their expansion.
Get rid of the macros and expand them in place.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:20 +0000 (19:06 +0100)]
staging: comedi: s626: remove PCI ID defines
The Sensoray 626 is based on the Philips SAA7146 chip using the Philips
vendor and device ID for the chip, but with custom subdevice and
subvendor IDs. Use the Philips IDs in the PCI device table and replace
the macros for the subvendor and subdevice IDs with open-coded values.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:17 +0000 (19:06 +0100)]
staging: comedi: s626: tidy up main source code file
Tidy up the source code in "s626.c" and make it (slightly) more
readable. It's mostly whitespace changes although some large statements
have been split into smaller statements. It fixes most of the
checkpatch errors and warnings.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Tue, 8 Oct 2013 18:06:15 +0000 (19:06 +0100)]
staging: comedi: s626: tidy the header file a bit
Tidy up the "s626.h" header file a bit, cleaning up the whitespace and
fixing overlength lines. Add multiple inclusion protection (even though
it's only included once and only by "s626.c"). Remove unnecessary
driver comment near the start of the file as it is more or less the same
as the one in "s626.c". Remove obviously unused/useless stuff.
I'm not sure what to do about the INTEL/MOTOROLA platform selection in
the file. I've left it alone (set to INTEL) for now.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Zabel [Thu, 10 Oct 2013 14:18:45 +0000 (16:18 +0200)]
staging: drm/imx: add drm plane support
This patch adds support for a drm overlay plane on DI0 using the DP.
In principle, the overlay plane could also be used on DI1, but to switch
the overlay plane between display interfaces, the base planes would have
to be exchanged transparently while both display interfaces are inactive.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sascha Hauer [Thu, 10 Oct 2013 14:18:44 +0000 (16:18 +0200)]
staging: drm/imx: fix pageflip events during device close
During a device close the drm core frees all pending events in
drm_events_release(). If at that time a pageflip is pending the
interrupt handler will try to complete the now unitialized
event resulting in a NULL pointer exception. Seen on imx-drm
when userspace is killed during a page flip.
Sascha Hauer [Thu, 10 Oct 2013 14:18:41 +0000 (16:18 +0200)]
staging: drm/imx: make waiting for idle channel optional
Currently we wait for a channel until it's idle before actually
disabling it. This is not needed for all channels though, so make
waiting for idle a separate function and call it where necessary.
Philipp Zabel [Thu, 10 Oct 2013 14:18:38 +0000 (16:18 +0200)]
staging: drm/imx: fix RGB formats, make ipu_cpmem_set_fmt take a drm_fourcc
The drm fourccs define formats not available as video4linux pixel formats,
such as DRM_FORMAT_BGR565, or the DRM_FORMAT_RGBX/BGRX variants.
Also, contrary to the v4l2 formats, the drm formats are well defined.
This patch also fixes the BGRA32 and RGB/RGB24 internal formats to use a
common internal representation.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Zabel [Thu, 10 Oct 2013 14:18:36 +0000 (16:18 +0200)]
staging: drm/imx: also allow to allocate only 2 DMFC slots for DP full plane
Connecting a 320x240 parallel display on i.MX6 resulted in an invalid DRDY
signal because the DC would not receive NL/EOL events on every line.
Reducing the allocated DMFC space from 4 slots (256 * 128-bit) to 2 slots
(128 * 128-bit) solved the problem.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In order to avoid this lockdep warning, remove the locking from
imx_drm_encoder_get_mux_id() and imx_drm_crtc_panel_format_pins().
Tested on a mx6sabrelite and mx53qsb.
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch adds a MMU dependency to configure the ZSMALLOC in
drivers/staging/zsmalloc/Kconfig. Without this patch, build
system can lead to build failure. This was observed during
randconfig testing, in which ZSMALLOC was enabled w/o MMU being
enabled. Following was the error:
LD vmlinux
drivers/built-in.o: In function `__zs_map_object':
drivers/staging/zsmalloc/zsmalloc-main.c:650: undefined reference to `map_vm_area'
make: *** [vmlinux] Error 1
This fixes the following sparse warnings:
* drivers/staging/rtl8188eu/core/rtw_cmd.c:221:5: warning:
symbol 'rtw_cmd_filter' was not declared. Should it be static?
* drivers/staging/rtl8188eu/core/rtw_cmd.c:1670:6: warning:
symbol 'dynamic_chk_wk_hdl' was not declared. Should it be static?
Rashika Kheria [Thu, 10 Oct 2013 18:14:41 +0000 (23:44 +0530)]
Staging: btmtk_usb: Fix line length exceeding 80 characters using min_t macro
This patch fixes the following checkpatch.pl warning in btmtk_usb.c:
WARNING: line over 80 characters in the file
by using kernel built_in min_t macro.
This fixes sparse warnings for functions and variables, e.g.:
* drivers/staging/gdm724x/gdm_mux.c:29:25: warning: symbol
'mux_rx_wq' was not declared. Should it be static?
Jovi Zhangwei [Wed, 9 Oct 2013 14:47:51 +0000 (07:47 -0700)]
staging: ktap: add to the kernel tree
This patch introduces ktap to staging tree.
ktap is a new script-based dynamic tracing tool for Linux,
it uses a scripting language and lets users trace the
Linux kernel dynamically. ktap is designed to give
operational insights with interoperability that allow
users to tune, troubleshoot and extend kernel and application.
It's similar with Linux Systemtap and Solaris Dtrace.
ktap have different design principles from Linux mainstream
dynamic tracing language in that it's based on bytecode,
so it doesn't depend upon GCC, doesn't require compiling
kernel module for each script, safe to use in production
environment, fulfilling the embedded ecosystem's tracing needs.
See ktap tutorial for more information:
http://www.ktap.org/doc/tutorial.html
The merit of putting this software in staging tree is
to make it more possible to get feedback from users
and thus polish the code.
Ian Abbott [Mon, 7 Oct 2013 14:51:58 +0000 (15:51 +0100)]
staging: comedi: avoid memleak for subdevice private
`comedi_alloc_spriv()` allocates private storage for a comedi subdevice
and sets the `SRF_FREE_SPRIV` flag in the `runflags` member of the
subdevice to allow the private storage to be automatically freed when
the comedi device is being cleaned up. Unfortunately, the flag gets
clobbered by `do_cmd_ioctl()` which calls
`comedi_set_subdevice_runflags()` with a mask value `~0` and only the
`SRF_USER` and `SRF_RUNNING` flags set, all the other SRF flags being
cleared.
Change the calls to `comedi_set_subdevice_runflags()` that currently use
a mask value of `~0` to use a more relevant mask value. For
`do_cmd_ioctl()`, the relevant SRF flags are `SRF_USER`, `SRF_ERROR` and
`SRF_RUNNING`. (At one time, `SRF_RT` would be included in that set of
flags, but it is no longer used.) For `comedi_alloc_spriv()` replace
the call to `comedi_set_subdevice_runflags()` with a simple
OR-assignment to avoid unnecessary use of a spin-lock.
Ian Abbott [Mon, 7 Oct 2013 15:50:06 +0000 (16:50 +0100)]
staging: comedi: remove 'settling_time_0' from subdevice
The `settling_time_0` member of `struct comedi_subdevice` can be set by
a low-level comedi driver and will be copied to user-space as part of
the information provided by the `COMEDI_SUBDINFO` ioctl. No comedi
driver has ever set it; it's just been left at its initial value of 0.
Remove it to save a bit of space, and behave as though it is 0.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 7 Oct 2013 15:50:05 +0000 (16:50 +0100)]
staging: comedi: remove unused 'channel flags' support
The `flags` and `flaglist` members of `struct comedi_subdevice` were
defined to supply "all-channel" flags via the `COMEDI_SUBDINFO` ioctl,
or "channel-specific" flags via the `COMEDI_CHANINFO` ioctls,
respectively. However, no comedi driver has ever set them.
It's not entirely clear how "all-channel" flags would differ from the
"subdevice" flags passed by `COMEDI_SUBDINFO`. It is conceivable that
"channel-specific" flags could be used to describe different analog
reference values (or whatever) supported by different channels.
Presumably these would use some sub-set of the `SDF_xxx` subdevice flag
values, or possibly the `CR_xxx` flag values that get packed into a
"chanspec" value (along with a channel number and range code). The
original intentions are lost in the mists of time.
For now, just remove the `flags` and `flaglist` members from `struct
comedi_subdevice` and behave as though they have been left at their
default values (0 or NULL) by the low-level comedi driver.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Mon, 7 Oct 2013 15:10:55 +0000 (10:10 -0500)]
staging: r8188eu: Fix skb leak in usb_read_port_complete()
In the completion routine for a usb_fill_bulk_urb() call, an skb is
leaked whenever the status of the USB transaction is not zero. A call
to skb_put() is needed to fix the problem.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes the following sparse warnings:
* drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning:
symbol 'chd_dec_alloc_iodata' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning:
symbol 'chd_dec_free_iodata' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:630:5: warning:
symbol 'chd_dec_pci_suspend' was not declared. Should it be static?
* drivers/staging/crystalhd/crystalhd_lnx.c:664:5: warning:
symbol 'chd_dec_pci_resume' was not declared. Should it be static?