platform/kernel/linux-exynos.git
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/uuid to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:43 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/uuid to sysfs

Move uuid file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/fstype to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:42 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/fstype to sysfs

Move fstype file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/client_type to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:41 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/client_type to sysfs

Move client_type file from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/files* to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:40 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/files* to sysfs

Move filestotal and filesfree files from /proc/fs/lustre/llite/*
to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/kbytes* to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:39 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/kbytes* to sysfs

Move kbytestotal, kbytesavail and kbytesfree files from
/proc/fs/lustre/llite/* to /sys/fs/lustre/llite/*/

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: move /proc/fs/lustre/llite/blocksize to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:38 +0000 (15:31 -0400)]
staging/lustre/llite: move /proc/fs/lustre/llite/blocksize to sysfs

Move blocksize file from /proc/fs/lustre/llite/*/ to
/sys/fs/lustre/llite/*/blocksize

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: Preparation to move /proc/fs/lustre/llite to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:37 +0000 (15:31 -0400)]
staging/lustre/llite: Preparation to move /proc/fs/lustre/llite to sysfs

Add necessary infrastructure, add support for mountpoint
registration in /proc/fs/lustre/llite

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Move /proc/fs/lustre root level files to sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:36 +0000 (15:31 -0400)]
staging/lustre: Move /proc/fs/lustre root level files to sysfs

except devices, for now.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Generic helpers for sysfs
Oleg Drokin [Thu, 21 May 2015 19:31:35 +0000 (15:31 -0400)]
staging/lustre: Generic helpers for sysfs

Add generic helpers to allow displaying oof lustre-specific values
in /sys/fs/lustre

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Correct include indentation and openning braces at new line
Pedro Marzo Perez [Thu, 21 May 2015 00:25:19 +0000 (02:25 +0200)]
Staging: rtl8192u: Correct include indentation and openning braces at new line

Opening braces should never be in a new line.
Correct include indentation.

Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: vt6656: device: Fixed spelling error
Colin Cronin [Fri, 15 May 2015 06:33:34 +0000 (23:33 -0700)]
Staging: vt6656: device: Fixed spelling error

Fixed comment spelling error.

Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: xgifb: use arch_phys_wc_add() and ioremap_wc()
Luis R. Rodriguez [Thu, 28 May 2015 19:39:07 +0000 (12:39 -0700)]
staging: xgifb: use arch_phys_wc_add() and ioremap_wc()

The same area used for ioremap() is used for the MTRR area.
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.

There are a few motivations for this:

a) Take advantage of PAT when available

b) Help bury MTRR code away, MTRR is architecture specific and on
   x86 its replaced by PAT

c) Help with the goal of eventually using _PAGE_CACHE_UC over
   _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
   de33c442e titled "x86 PAT: fix performance drop for glx,
   use UC minus for ioremap(), ioremap_nocache() and
   pci_mmap_page_range()")

The conversion done is expressed by the following Coccinelle
SmPL patch, it additionally required manual intervention to
address all the #ifdery and removal of redundant things which
arch_phys_wc_add() already addresses such as verbose message
about when MTRR fails and doing nothing when we didn't get
an MTRR.

@ mtrr_found @
expression index, base, size;
@@

-index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
+index = arch_phys_wc_add(base, size);

@ mtrr_rm depends on mtrr_found @
expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
@@

-mtrr_del(index, base, size);
+arch_phys_wc_del(index);

@ mtrr_rm_zero_arg depends on mtrr_found @
expression mtrr_found.index;
@@

-mtrr_del(index, 0, 0);
+arch_phys_wc_del(index);

@ mtrr_rm_fb_info depends on mtrr_found @
struct fb_info *info;
expression mtrr_found.index;
@@

-mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
+arch_phys_wc_del(index);

@ ioremap_replace_nocache depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@

-info->screen_base = ioremap_nocache(base, size);
+info->screen_base = ioremap_wc(base, size);

@ ioremap_replace_default depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@

-info->screen_base = ioremap(base, size);
+info->screen_base = ioremap_wc(base, size);

Generated-by: Coccinelle SmPL
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Brian Vandre <bvandre@gmail.com>
Cc: Thomas Gummerer <t.gummerer@gmail.com>
Cc: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Vitor Braga <vitorpybraga@gmail.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devel@driverdev.osuosl.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: xgifb: use swap() in XGI_WriteDAC()
Fabian Frederick [Mon, 18 May 2015 17:34:15 +0000 (19:34 +0200)]
staging: xgifb: use swap() in XGI_WriteDAC()

Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: xgifb: vb_setmode: Fixed spelling error
Colin Cronin [Thu, 14 May 2015 05:35:03 +0000 (22:35 -0700)]
Staging: xgifb: vb_setmode: Fixed spelling error

Fixed spelling error in comment.

Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoDrivers: staging: skein: skein_api: Fixed spelling errors
Colin Cronin [Thu, 14 May 2015 01:05:42 +0000 (18:05 -0700)]
Drivers: staging: skein: skein_api: Fixed spelling errors

Fixed a few spelling errors in comments.

Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: dgnc: delete all references to 'flipbuf'
Gujulan Elango, Hari Prasath (H.) [Fri, 29 May 2015 07:17:37 +0000 (07:17 +0000)]
staging: dgnc: delete all references to 'flipbuf'

This patch deletes all references to 'flipbuf'.Memory is allocated and
freed but never used anywhere in the driver.Also deleted an ununsed
Macro defined in the header file.

Signed-off-by: Gujulan Elango Hari Prasath <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: dgnc: fix line length over 80 chars in dgnc_sysfs.c
Wim de With [Wed, 20 May 2015 12:27:39 +0000 (14:27 +0200)]
staging: dgnc: fix line length over 80 chars in dgnc_sysfs.c

This patch fixes most of the lines over 80 characters long in
dgnc_sysfs.c. I couldn't find a way to break line 202-207 in a sensible
way. If there is a way, let me know.

Signed-off-by: Wim de With <nauxuron@wimdewith.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: dgnc: fixed coding style issue in digi.h
Buţiu Alexandru Octavian [Sun, 17 May 2015 19:31:34 +0000 (22:31 +0300)]
Staging: dgnc: fixed coding style issue in digi.h

Fixed coding style issue "warning line over 80 characters"
detected by checkpatch.pl in digi.h

Signed-off-by: Buţiu Alexandru Octavian <predator5047@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi/drivers/pcl.* coding style fixes
Matthew Needes [Mon, 25 May 2015 23:41:21 +0000 (16:41 -0700)]
staging: comedi/drivers/pcl.* coding style fixes

pcl812.c (resend of earlier patch)
    Fixed lines exceeding 80 columns, correcting some spelling in process

Signed-off-by: Matthew Needes <mneedes@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi/drivers/pcl.* coding style fixes
Matthew Needes [Mon, 25 May 2015 23:41:20 +0000 (16:41 -0700)]
staging: comedi/drivers/pcl.* coding style fixes

pcl812.c / pcl816.c (resend of earlier patch)
   Fixed indentation problems.

Signed-off-by: Matthew Needes <mneedes@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: keep the consistency
Geliang Tang [Mon, 25 May 2015 14:20:44 +0000 (14:20 +0000)]
staging: comedi: keep the consistency

Changed "register 0x%x" to "register=0x%x" to keep the consistency
of this file.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: fix checkpatch error
Geliang Tang [Mon, 25 May 2015 14:20:43 +0000 (14:20 +0000)]
staging: comedi: fix checkpatch error

Fixed an error found by checkpatch.pl.
ERROR: space required after that ',' (ctx:VxV)
./drivers/ni_mio_common.c:3764

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: comedi_isadma.h: make self-reliant
Ian Abbott [Fri, 22 May 2015 17:45:25 +0000 (18:45 +0100)]
staging: comedi: comedi_isadma.h: make self-reliant

The Comedi "comedi_isadma.h" header is included by the source for the
"comedi_isadma" helper module and other modules that use it.  It does
not compile cleanly when it is the first header file included.  It uses
the `dma_addr_t` type, so include <linux/types.h> to declare it.  (Also,
that indirectly takes care of the use of `NULL`.)  It uses `struct
comedi_device *` in various function prototypes, so add an incomplete
declaration of `struct comedi_device`.

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>
9 years agostaging: comedi: comedi_8254.h: make self-reliant
Ian Abbott [Fri, 22 May 2015 17:32:31 +0000 (18:32 +0100)]
staging: comedi: comedi_8254.h: make self-reliant

The Comedi "comedi_8254.h" header file is included by various Comedi
drivers with timer/counters based on the 8254 chip.  The drivers do not
compile cleanly if this header file is included first.  It uses pointers
to the `struct comedi_device`, `struct comedi_subdevice`, and `struct
comedi_insn` structures in various function prototypes, so declare those
as incomplete types.  It use the `bool` type, so include
<linux/types.h>.  It also uses the `__iomem` tag, but that seems to be
taken care of indirectly by including <linux/types.h>.

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>
9 years agostaging: comedi: addi_watchdog.h: don't include "../comedidev.h"
Ian Abbott [Fri, 22 May 2015 16:32:03 +0000 (17:32 +0100)]
staging: comedi: addi_watchdog.h: don't include "../comedidev.h"

The Comedi "addi_watchdog.h" header doesn't use anything form
"comedidev.h" apart from `struct comedi_subdevice`, which it only uses
to construct a corresponding pointer type within the parameter list of a
function prototype.  Just declare the structure type incompletely and
don't bother including the header file.

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>
9 years agostaging: comedi: amplc_dio200_pci.c: reformat copyright comment
Ian Abbott [Fri, 22 May 2015 17:16:01 +0000 (18:16 +0100)]
staging: comedi: amplc_dio200_pci.c: reformat copyright comment

Reformat the copyright comment at the top of the file to use the
preferred block comment style.

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>
9 years agostaging: comedi: amplc_dio200_common.c: fix up brace style
Ian Abbott [Fri, 22 May 2015 17:16:00 +0000 (18:16 +0100)]
staging: comedi: amplc_dio200_common.c: fix up brace style

Use braces when the single statement following an `if` (or `else`)
spans more than one line (including any preceding comments).

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>
9 years agostaging: comedi: amplc_dio200_common.c: reformat copyright comment
Ian Abbott [Fri, 22 May 2015 17:15:59 +0000 (18:15 +0100)]
staging: comedi: amplc_dio200_common.c: reformat copyright comment

Reformat the copyright comment at the top of the file to use the
preferred block comment style.

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>
9 years agostaging: comedi: amplc_dio200.c: reformat copyright comment
Ian Abbott [Fri, 22 May 2015 17:15:58 +0000 (18:15 +0100)]
staging: comedi: amplc_dio200.c: reformat copyright comment

Reformat the copyright comment at the top of the file to use the
preferred block comment style.

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>
9 years agostaging: comedi: amplc_dio200.h: make self-reliant
Ian Abbott [Fri, 22 May 2015 17:15:57 +0000 (18:15 +0100)]
staging: comedi: amplc_dio200.h: make self-reliant

The Comedi "amplc_dio200.h" header file included by drivers for Amplicon
DIO200 series cards does not compile cleanly when it is the first header
included by the ".c" file.  It uses `struct comedi_device *` in the
parameter lists of some function prototypes, so just declare `struct
comedi_device` as an incomplete type.  It also uses `bool`, so include
<linux/types.h> to declare it.

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>
9 years agostaging: comedi: amplc_dio200.h: reformat copyright comment
Ian Abbott [Fri, 22 May 2015 17:15:56 +0000 (18:15 +0100)]
staging: comedi: amplc_dio200.h: reformat copyright comment

Reformat the copyright comment at the top of the file to use the
preferred block comment style.

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>
9 years agostaging: comedi: comedi_8255: new module split from 8255
Ian Abbott [Fri, 22 May 2015 15:21:38 +0000 (16:21 +0100)]
staging: comedi: comedi_8255: new module split from 8255

The Comedi "8255" module is both a standalone Comedi device driver
module for simple devices with one or more 8255 "Programmable Peripheral
Interface" chips at known I/O base addresses (configured at run-time),
and a helper module to configure a 8255-based digital I/O subdevice for
other Comedi drivers.

Split the "8255 subdevice helper" functionality into a new module:
"comedi_8255", leaving the standalone 8255 Comedi driver in the "8255"
module.

The Comedi "detach" routine of the standalone "8255" driver needs to
retrieve the I/O base address passed to the "comedi_8255" module to set
up each subdevice in order to release the I/O port regions it requested
in its "attach" routine.  The "comedi_8255" module stores it in a
"subdevice private" data structure that is no longer known to the "8255"
module, so add a new, exported function `subdev_8255_regbase()` to
retrieve it.

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>
9 years agostaging: comedi: 8255: document callback parameters better
Ian Abbott [Fri, 22 May 2015 15:21:37 +0000 (16:21 +0100)]
staging: comedi: 8255: document callback parameters better

Several Comedi driver modules call `subdev_8255_init()` or
`subdev_8255_mm_init()` to set up a digital I/O subdevice based on the
"8255" chip.  One of the parameters to these functions is an optional
pointer to an I/O callback function to perform the actual register
accesses (an internal default callback function is used if NULL).

The kerneldoc for `subdev_8255_init()` and `subdev_8255_mm_init()`
describe the prototype of the optional I/O callback function
incorrectly (my fault), adding a non-existent parameter of type `struct
comedi_subdevice *`.  Fix the kerneldoc.  Also add parameter names to
the callback function pointer type wherever it occurs to make the usage
clearer.

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>
9 years agostaging: comedi: 8255.h: don't include "../comedidev.h"
Ian Abbott [Fri, 22 May 2015 15:21:36 +0000 (16:21 +0100)]
staging: comedi: 8255.h: don't include "../comedidev.h"

The Comedi "8255.h" header doesn't use anything from "comedidev.h" apart
from `struct comedi_device` and `struct comedi_subdevice`, which are
only used to construct corresponding pointer types within the parameter
lists of function prototypes.  Just declare those structure types
incompletely and don't bother including "comedidev.h".

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>
9 years agostaging: comedi: 8255: fix I/O region leak on failure
Ian Abbott [Fri, 22 May 2015 15:21:35 +0000 (16:21 +0100)]
staging: comedi: 8255: fix I/O region leak on failure

The Comedi "8255" driver does not clean up properly on failure.  It can
leave requested I/O port regions unreleased.  Specifically, the Comedi
"attach" handler (`dev_8255_attach()`) requests a specified I/O port
region before calling `subdev_8255_init()` to set up the subdevice.  If
that fails, the "attach" handler returns an error and the Comedi core
will call the "detach" handler (`dev_8255_detach()`) to clean up.  The
"detach" handler is responsible for releasing the I/O port regions
successfully requested by the "attach" handler.  Unfortunately, it is
unable to obtain the base address of the region if the call to
`subdev_8255_init()` failed.

Fix the I/O region leak by releasing the region in the "attach" handler
directly if the call to `subdev_8255_init()` fails.

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>
9 years agostaging: wlan-ng: fix checkpatch warnings
chaehyun lim [Fri, 15 May 2015 13:13:43 +0000 (22:13 +0900)]
staging: wlan-ng: fix checkpatch warnings

clean up checkpatch.pl in prism2sta.c
 WARNING : line over 80 characters

Signed-off-by: chaehyun lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wlan-ng: check return value of kmalloc
Gujulan Elango, Hari Prasath (H.) [Wed, 13 May 2015 14:35:25 +0000 (14:35 +0000)]
staging: wlan-ng: check return value of kmalloc

check return value of kmalloc before accessing the memory pointer and
return -ENOMEM if allocation fails.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: remove unused variable warning
Arnd Bergmann [Tue, 19 May 2015 22:07:27 +0000 (00:07 +0200)]
staging: lustre: remove unused variable warning

A recent patch to simplify the lustre large memory allocation
causes new warnings as an unintended side-effect:

lustre/lov/lov_request.c: In function 'lov_finish_set':
lustre/lov/lov_request.c:78:7: warning: unused variable 'len' [-Wunused-variable]
   int len = set->set_oabufs * sizeof(*set->set_pga);
       ^
lustre/obdclass/acl.c: In function 'lustre_ext_acl_xattr_reduce_space':
lustre/obdclass/acl.c:123:6: warning: unused variable 'old_size' [-Wunused-variable]
  int old_size = CFS_ACL_XATTR_SIZE(old_count, ext_acl_xattr);
      ^

The reason is that the 'size' argument to OBD_FREE_LARGE()
is never needed, which was previously hidden by the extra
abstractions.

This avoids the warnings by adding a cast to void, to tell
the compiler that the argument is intentionally unused.
A better fix is probably to remove the entire set of allocation
macros and open-code the normal kernel interface calls.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 99d56ff7c1c ("staging/lustre: Always try kmalloc first for OBD_ALLOC_LARGE")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: remove LNET_MUTEX_LOCK macro
Mike Shuey [Tue, 19 May 2015 14:14:39 +0000 (10:14 -0400)]
staging: lustre: lnet: remove LNET_MUTEX_LOCK macro

LNET_MUTEX_LOCK and LNET_MUTEX_UNLOCK are verbose wrappers to mutex_lock and
mutex_unlock.  Get rid of these.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: selftest: code cleanup - variable spacing, indentation
Mike Shuey [Tue, 19 May 2015 14:14:38 +0000 (10:14 -0400)]
staging: lustre: lnet: selftest: code cleanup - variable spacing, indentation

Unify spacing in variable declarations, and align indentation in headers.
General whitespace cleanups.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: socklnd: code cleanup - align spacing
Mike Shuey [Tue, 19 May 2015 14:14:37 +0000 (10:14 -0400)]
staging: lustre: lnet: socklnd: code cleanup - align spacing

Unify variable declarations to use a single space.  Also include several
miscellaneous whitespace cleanups, particularly in socklnd.h.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: o2iblnd: code cleanup - align whitespace
Mike Shuey [Tue, 19 May 2015 14:14:36 +0000 (10:14 -0400)]
staging: lustre: lnet: o2iblnd: code cleanup - align whitespace

Unify variable declarations to use a single whitespace.  Also line up
declarations and comments in o2iblnd.h.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: lnet: Module is LNet, not Portals
Mike Shuey [Tue, 19 May 2015 14:14:35 +0000 (10:14 -0400)]
staging: lustre: lnet: lnet: Module is LNet, not Portals

Fix the module version to match upstream development.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: dead code - remove LNetSetAsync
Mike Shuey [Tue, 19 May 2015 14:14:34 +0000 (10:14 -0400)]
staging: lustre: lnet: dead code - remove LNetSetAsync

LNetSetAsync() returns 0, and is never called.  Doesn't exist in the Intel
tree, either.  Remove it.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: dead code - remove lnet_fini_locks
Mike Shuey [Tue, 19 May 2015 14:14:33 +0000 (10:14 -0400)]
staging: lustre: lnet: dead code - remove lnet_fini_locks

lnet_fini_locks() does nothing.  Remove.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: lnet: code cleanups - variable declarations
Mike Shuey [Tue, 19 May 2015 14:14:32 +0000 (10:14 -0400)]
staging: lustre: lnet: lnet: code cleanups - variable declarations

Unify variable declarations to use a single space, and any other obvious
spacing flaws.

Signed-off-by: Mike Shuey <shuey@purdue.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Fixed typo
Adrian Remonda [Mon, 18 May 2015 18:34:50 +0000 (20:34 +0200)]
Staging: lustre: Fixed typo

In the explanation of the function the name of the function was incorrect

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: Fix wrong identing in ll_setxattr_common
Oleg Drokin [Sat, 16 May 2015 07:38:34 +0000 (03:38 -0400)]
staging/lustre/llite: Fix wrong identing in ll_setxattr_common

smatch has highlighted wrong indenting that results from
commit 7fc1f831d83f ("staging/lustre/llite: extended attribute cache")

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: Fix potential NULL pointer dereference
Oleg Drokin [Sat, 16 May 2015 07:38:33 +0000 (03:38 -0400)]
staging/lustre/ptlrpc: Fix potential NULL pointer dereference

In lov_unpackmd() there's this strange bit of code where we first try
to look inside of lmm striping pattern for it's type, and then
we check if the pattern is NULL which cannot be right.
Move the check under if (lmm) branch so that it's safe.

Found by Coverity version 6.6.1

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-on: http://review.whamcloud.com/7827
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4049
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Signed-off: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: Fix wrong indenting in plain_authorize()
Oleg Drokin [Sat, 16 May 2015 07:38:32 +0000 (03:38 -0400)]
staging/lustre/ptlrpc: Fix wrong indenting in plain_authorize()

smatch highlighted a wrongly indented bit of code that almost
hides the extra assignment.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Only set INTERRUPTIBLE state before calling schedule
Oleg Drokin [Sat, 16 May 2015 07:38:31 +0000 (03:38 -0400)]
staging/lustre: Only set INTERRUPTIBLE state before calling schedule

In __l_wait_event the condition could be a complicated function that does
allocations and other potentialy blocking activities, so it sohuld
not be called in a task state other than RUNNABLE

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: remove useless comment
Luca Ceresoli [Tue, 19 May 2015 09:35:21 +0000 (11:35 +0200)]
staging: rtl8723au: remove useless comment

"step 2" does mean much as there is no "step 1" stated anywhere...

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: remove useless return value
Luca Ceresoli [Tue, 19 May 2015 09:35:20 +0000 (11:35 +0200)]
staging: rtl8723au: remove useless return value

The loadparam() function cannot fail, it's called only once and its return
value is ignored there.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: fix sparse warning
Juston Li [Sat, 23 May 2015 05:03:04 +0000 (22:03 -0700)]
staging: rtl8723au: fix sparse warning

change cast to __le16 to fix the following warning:
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1488:20: warning: cast to restricted __le16

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: remove redundant initialization
Gujulan Elango, Hari Prasath (H.) [Tue, 12 May 2015 10:01:18 +0000 (10:01 +0000)]
staging: rtl8723au: remove redundant initialization

The variable pHalData is initialized twice in this same function with
same value.So removing one of them.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Use roundup_pow_of_two() in LNetEQAlloc()
Pekka Enberg [Fri, 15 May 2015 18:40:20 +0000 (21:40 +0300)]
staging/lustre: Use roundup_pow_of_two() in LNetEQAlloc()

Use roundup_pow_of_two() and drop the private cfs_power2_roundup()
implementation.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Remove duplicate helpers from libcfs.h
Pekka Enberg [Fri, 15 May 2015 18:40:19 +0000 (21:40 +0300)]
staging/lustre: Remove duplicate helpers from libcfs.h

Remove bunch of duplicate helpers from libcfs.h that are guaranteed to
be present.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Remove __attribute__ definition from libcfs.h
Pekka Enberg [Fri, 15 May 2015 18:40:18 +0000 (21:40 +0300)]
staging/lustre: Remove __attribute__ definition from libcfs.h

Linux requires a GNU C compatible compiler so drop a pointless define.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: check kzalloc return value
Gujulan Elango, Hari Prasath (H.) [Wed, 13 May 2015 10:36:28 +0000 (10:36 +0000)]
staging: lustre: check kzalloc return value

check the return value of kzalloc before accessing the memory pointer

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Replace kzalloc and memcpy by kmemdup
Gunasundar, Balamanikandan (B.) [Tue, 12 May 2015 10:35:52 +0000 (10:35 +0000)]
Staging: lustre: Replace kzalloc and memcpy by kmemdup

This patch was generated by 'make coccicheck'

Signed-off-by: Balamanikandan Gunasundar <bgunasun@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lclient: lcommon_cl.c fixing coding style issues
Ankit Garg [Wed, 6 May 2015 05:33:23 +0000 (11:03 +0530)]
staging: lustre: lclient: lcommon_cl.c fixing coding style issues

This patch fixes the checkpatch.pl warning:

WARNING: else is not generally useful after a break or return
+                       return result;
+               } else {

Signed-off-by: Ankit Garg <kerneldvlper@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agolustre: kill unused helper
Al Viro [Wed, 13 May 2015 22:25:57 +0000 (23:25 +0100)]
lustre: kill unused helper

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agolustre: kill unused macro (LOOKUP_CONTINUE)
Al Viro [Wed, 13 May 2015 22:25:56 +0000 (23:25 +0100)]
lustre: kill unused macro (LOOKUP_CONTINUE)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types
Sasha Levin [Thu, 28 May 2015 15:03:56 +0000 (11:03 -0400)]
staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types

NL80211_IFTYPE_MAX represents the largest interface type number defined,
so declaring the array with that size will actually leave out the last
interface.

This causes invalid memory access whenever this array is used, which starts
happening at boot.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: remove __DRIVER_VERSION__ macro
Arnd Bergmann [Fri, 29 May 2015 20:52:15 +0000 (22:52 +0200)]
staging: wilc1000: remove __DRIVER_VERSION__ macro

The driver version is meaningless, and in particular does not
have to be passed from the Makefile. This removes the macros,
but leaves the behavior of printing the 10.2 version untouched
for the moment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: remove thread wrapper
Arnd Bergmann [Fri, 29 May 2015 20:52:14 +0000 (22:52 +0200)]
staging: wilc1000: remove thread wrapper

The wilc_thread code is a very thin wrapper around kthread,
so just remove it and use kthread directly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: remove platform version checks
Arnd Bergmann [Fri, 29 May 2015 20:52:13 +0000 (22:52 +0200)]
staging: wilc1000: remove platform version checks

For code that is integrated into mainline Linux, checks for
the OS platform make no sense, because we know that we
are on Linux.

This removes all checks and the associated dead code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: remove linux version checks
Arnd Bergmann [Fri, 29 May 2015 20:52:12 +0000 (22:52 +0200)]
staging: wilc1000: remove linux version checks

For code that is integrated into mainline Linux, checks for
the kernel version make no sense, because we know which version
we are compiling against.

This removes all checks and the associated dead code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/wilc1000: fix Kconfig dependencies
Arnd Bergmann [Thu, 28 May 2015 14:35:42 +0000 (16:35 +0200)]
staging/wilc1000: fix Kconfig dependencies

The newly added wilc1000 driver lacks several Kconfig dependencies,
resulting in a multitude of randconfig build errors, e.g.:

drivers/built-in.o: In function `WILC_WFI_mgmt_tx_cancel_wait':
binder.c:(.text+0x12bd28): undefined reference to `cfg80211_remain_on_channel_expired'
drivers/built-in.o: In function `WILC_WFI_CfgSetChannel':
binder.c:(.text+0x12c9d8): undefined reference to `ieee80211_frequency_to_channel'
drivers/built-in.o: In function `WILC_WFI_CfgAlloc':
binder.c:(.text+0x132530): undefined reference to `wiphy_new_nm'
drivers/built-in.o: In function `wilc_netdev_init':
binder.c:(.text+0x1356d0): undefined reference to `register_inetaddr_notifier'
drivers/built-in.o: In function `linux_spi_init':
binder.c:(.text+0x210a68): undefined reference to `spi_register_driver'

This change ensures that we always have at least one of SPI or MMC
enabled, and are only able to pick an interface that works. It also
adds all the missing dependencies for networking infrastructure
(cfg80211, wext, and ipv4).

In order to make it readable, I also took the liberty of re-indenting
the Kconfig file to the normal conventions.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: Disable for S390
Guenter Roeck [Thu, 28 May 2015 04:32:43 +0000 (21:32 -0700)]
staging: wilc1000: Disable for S390

The wilc1000 driver uses definitions such as DEBUG_LEVEL, DEBUG,
and PRINT_INFO. This causes compile errors on S390 which has similar
definitions in its core code. Disable the driver for S390 instead
of giving the non-standard messaging code credit by trying to fix it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: Include linux/gpio.h instead of asm/gpio.h
Guenter Roeck [Wed, 27 May 2015 20:02:16 +0000 (13:02 -0700)]
staging: wilc1000: Include linux/gpio.h instead of asm/gpio.h

Fix:

drivers/staging/wilc1000/linux_wlan.c:18:22: fatal error:
asm/gpio.h: No such file or directory

Not every architecture has asm/gpio.h. Include linux/gpio.h instead.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: MAINTAINERS: add maintainer for wilc1000 device
Johnny Kim [Mon, 11 May 2015 05:30:57 +0000 (14:30 +0900)]
staging: MAINTAINERS: add maintainer for wilc1000 device

Add myself as maintainer for atmel wilc1000

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Rachel Kim <rachel.kim@atmel.com>
Signed-off-by: Dean Lee <dean.lee@atmel.com>
Signed-off-by: Chris Park <chris.park@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: Add SDIO/SPI 802.11 driver
Johnny Kim [Mon, 11 May 2015 05:30:56 +0000 (14:30 +0900)]
staging: wilc1000: Add SDIO/SPI 802.11 driver

This driver is for the wilc1000 which is a single chip IEEE 802.11
b/g/n device.
The driver works together with cfg80211, which is the kernel side of
configuration management for wireless devices because the wilc1000
chipset is fullmac where the MLME is managed in hardware.

The driver worked from kernel version 2.6.38 and being now ported
to several others since then.
A TODO file is included as well in this commit.

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Rachel Kim <rachel.kim@atmel.com>
Signed-off-by: Dean Lee <dean.lee@atmel.com>
Signed-off-by: Chris Park <chris.park@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: panel: fix stackdump
Sudip Mukherjee [Tue, 12 May 2015 12:06:08 +0000 (17:36 +0530)]
staging: panel: fix stackdump

if we load the module, unload and then again try to load the module, we
will get a stackdump. In the module_exit function we are unregistering
the device and releasing the parport. So when we reach the detach
function parport is already null and the unregister_reboot_notifier()
is never called. When we again try to load the module it again tries
register_reboot_notifier() and gives us a stackdump as its earlier
registration is still not removed. It was caused by the
commit bb046fef9668 ('staging: panel: register reboot')
Fix this by moving all the unregistering and releasing in the detach
function, which should be the ideal case as the detach will be called if
we try to unregister the driver or if the parport is removed.

Fixes: bb046fef9668 ('staging: panel: register reboot')
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750: Fix lynxfb_ops_imageblit() if image->depth != 1
Huacai Chen [Mon, 11 May 2015 03:08:22 +0000 (11:08 +0800)]
staging: sm750: Fix lynxfb_ops_imageblit() if image->depth != 1

If image->depth != 1, lynxfb_ops_imageblit() should fallback to call
cfb_imageblit(), not return directly. Otherwise it can't display the
boot logo.

Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: use arch_phys_wc_add() and ioremap_wc()
Luis R. Rodriguez [Thu, 14 May 2015 14:07:55 +0000 (07:07 -0700)]
staging: sm750fb: use arch_phys_wc_add() and ioremap_wc()

The same area used for ioremap() is used for the MTRR area.
Convert the driver from using the x86 specific MTRR code to
the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add()
will avoid MTRR if write-combining is available, in order to
take advantage of that also ensure the ioremap'd area is requested
as write-combining.

There are a few motivations for this:

a) Take advantage of PAT when available

b) Help bury MTRR code away, MTRR is architecture specific and on
   x86 its replaced by PAT

c) Help with the goal of eventually using _PAGE_CACHE_UC over
   _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
   de33c442e titled "x86 PAT: fix performance drop for glx,
   use UC minus for ioremap(), ioremap_nocache() and
   pci_mmap_page_range()")

The conversion done is expressed by the following Coccinelle
SmPL patch, it additionally required manual intervention to
address all the #ifdery and removal of redundant things which
arch_phys_wc_add() already addresses such as verbose message
about when MTRR fails and doing nothing when we didn't get
an MTRR.

@ mtrr_found @
expression index, base, size;
@@

-index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
+index = arch_phys_wc_add(base, size);

@ mtrr_rm depends on mtrr_found @
expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
@@

-mtrr_del(index, base, size);
+arch_phys_wc_del(index);

@ mtrr_rm_zero_arg depends on mtrr_found @
expression mtrr_found.index;
@@

-mtrr_del(index, 0, 0);
+arch_phys_wc_del(index);

@ mtrr_rm_fb_info depends on mtrr_found @
struct fb_info *info;
expression mtrr_found.index;
@@

-mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
+arch_phys_wc_del(index);

@ ioremap_replace_nocache depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@

-info->screen_base = ioremap_nocache(base, size);
+info->screen_base = ioremap_wc(base, size);

@ ioremap_replace_default depends on mtrr_found @
struct fb_info *info;
expression base, size;
@@

-info->screen_base = ioremap(base, size);
+info->screen_base = ioremap_wc(base, size);

Generated-by: Coccinelle SmPL
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devel@driverdev.osuosl.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: I2O cleanup
Valentin Rothberg [Thu, 14 May 2015 13:43:59 +0000 (15:43 +0200)]
staging: I2O cleanup

Remove the last reference on menuconfig I20 that has been removed by
commit 4a72a7af462d ("staging: remove i2o subsystem").

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: cleanup UNISYS_VISORUTIL
Valentin Rothberg [Thu, 14 May 2015 13:50:32 +0000 (15:50 +0200)]
staging: unisys: cleanup UNISYS_VISORUTIL

Commit 53490b545cb0 ("staging: unisys: move periodic_work.c into the
visorbus directory") removed the Kconfig option UNISYS_VISORUTIL, but
left one reference in a Kconfig select.  Remove this last reference.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Convert device functions to pass dev_info pointer around
Don Zickus [Wed, 13 May 2015 17:22:25 +0000 (13:22 -0400)]
staging: unisys: Convert device functions to pass dev_info pointer around

Most device functions pass bus_no and dev_no around and then do a lookup
inside each function to find the dev_info struct.  Instead just pass the
pointer.

This prepares us for a later conversion to using visor device.

No real technical changes.  Just function header changes and little
cleanups as a result.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Convert bus functions to pass bus_info pointer around
Don Zickus [Wed, 13 May 2015 17:22:24 +0000 (13:22 -0400)]
staging: unisys: Convert bus functions to pass bus_info pointer around

Most bus functions pass bus_no around and then do a lookup inside each
function to find the bus_info struct.  Instead just pass the pointer.

This prepares us for a later conversion to using visor_device.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Convert the device attributes to visor_device
Don Zickus [Wed, 13 May 2015 17:22:23 +0000 (13:22 -0400)]
staging: unisys: Convert the device attributes to visor_device

Convert the device attribute files to properly use visor_device.
This removes a whole bunch of checks and assumptions and simplifies
the code.  Everything is straightforward.

No testing down as I can't mimic channel info correctl.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Remove unused intr
Don Zickus [Wed, 13 May 2015 17:22:22 +0000 (13:22 -0400)]
staging: unisys: Remove unused intr

The conversion to visor_device caused some compile issues.The main
problem was the new fields in 'struct visor_device' were not public.
Remove one that wasn't being used for now.

struct irq_info intr

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Add checks for creation
Don Zickus [Wed, 13 May 2015 17:22:21 +0000 (13:22 -0400)]
staging: unisys: Add checks for creation

There was a bunch of channel creation checks before the
visorchannel_create function was called, moving some of those
checks inside.  This keeps the outside code cleaner and handles
the situation where a caller forgets to make these checks.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Add a function to set the clientpartition
Don Zickus [Wed, 13 May 2015 17:22:20 +0000 (13:22 -0400)]
staging: unisys: Add a function to set the clientpartition

This patch is an attempt to help hide the channel info behind
accessory functions.  I was trying to keep visorchannel as private
as possible.

The only function missing that seemed to be needed for now was
the ability to set the clientpartition.  So I expose that here.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Add visor device find routine
Don Zickus [Wed, 13 May 2015 17:22:19 +0000 (13:22 -0400)]
staging: unisys: Add visor device find routine

If we are going to remove the bus_info structs than we need a way
to find the devices when the *_create/destroy cmds are sent over
the vmchannel.

This function crudely impements what pci has.  It takes a bus_no
and dev_no and finds the matching 'struct visor_device'.

This function can/should be optimzed later once we get our heads
wrapped around its needs.  For now, I am using dev_no=0 to mean
the visorbus itself.

The function is limited to chipset.c only because it is only needed
to do the lookups upon receiving a vmchannel command.  Future patches
will make sure the resulting 'struct visor_device' is used every
where else.

Also allow visorbus_type to be more visible for use.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Prep for removing 'info' structs
Don Zickus [Wed, 13 May 2015 17:22:18 +0000 (13:22 -0400)]
staging: unisys: Prep for removing 'info' structs

The visorbus driver has three _info structs lying around
(device, bus, channel) that store subsets of info from the
bigger structs.

Having these structs around make resource handling very difficult
and more complicated than it needs to be.  Use the device
infrastructure and instead pass 'struct visor_device' all
over the place.

In order to do that 'struct visor_device' needs to get smarter.
This patch adds the pieces to prep for it.  The new elements
will be used in later patches.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Clean up device sysfs attributes
Don Zickus [Wed, 13 May 2015 17:22:17 +0000 (13:22 -0400)]
staging: unisys: Clean up device sysfs attributes

Properly hook into the struct device groups element.  This allows the
core infrastructure to manage the files instead of the bus layer.  And
makes the code easier to read.

I didn't clean up the _show functions just modified them a bit to handle
the different args for now and to prevent a build warning.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Remove dead kobj structs
Don Zickus [Wed, 13 May 2015 17:22:16 +0000 (13:22 -0400)]
staging: unisys: Remove dead kobj structs

Remove stale code.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Properly move version file into bus attr
Don Zickus [Wed, 13 May 2015 17:22:15 +0000 (13:22 -0400)]
staging: unisys: Properly move version file into bus attr

Simplify things by moving the version file handling into the core.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Move the visorbus device underneath devices
Don Zickus [Wed, 13 May 2015 17:22:14 +0000 (13:22 -0400)]
staging: unisys: Move the visorbus device underneath devices

Mimicing what other drivers do, this seems appropriate.  Yeah, it
is a bus, but it is a bus _device_.  This makes things work better
and smoother.  Now the sysfs looks like

[root@dhcp-17-174 visorbus]# ls -l /sys/bus/visorbus/devices/
total 0
lrwxrwxrwx. 1 root root 0 Apr 17 16:09 vbus1:dev2 ->
../../../devices/visorbus1/vbus1:dev2
lrwxrwxrwx. 1 root root 0 Apr 17 16:09 visorbus1 ->
../../../devices/visorbus1

Which looks correct.  All the attributes are still correct too, based on my
very minimal testing of 'ls -lR'. :-)

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Wire up proper device attr for bus
Don Zickus [Wed, 13 May 2015 17:22:13 +0000 (13:22 -0400)]
staging: unisys: Wire up proper device attr for bus

This patch moves the attributes to underneath the bus device correctly.
This will help remove a bunch of cruft from the code and let the kernel
infrastructure manage the sysfs files instead of the driver.

After the move remove all the leftover code.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Embed struct device for easier handling of attr
Don Zickus [Wed, 13 May 2015 17:22:12 +0000 (13:22 -0400)]
staging: unisys: Embed struct device for easier handling of attr

Handling the sysfs attributes become easier to deal with when you can just
run container_of(dev) to get devdata.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Remove temporarily added visorbus/ include in Makefile
Don Zickus [Wed, 13 May 2015 17:22:11 +0000 (13:22 -0400)]
staging: unisys: Remove temporarily added visorbus/ include in Makefile

Now that the header file movement is complete, remove the temporary ccflags
include

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: remove remaining utility headers
David Kershner [Wed, 13 May 2015 17:22:10 +0000 (13:22 -0400)]
staging: unisys: remove remaining utility headers

remove uisqueue.h, uisthread.h, and uisutils.h
replace HOSTADDRESS with u64
remove "uisutils.h" from header list in visorchipset.c

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: get rid of sparstop
David Kershner [Wed, 13 May 2015 17:22:09 +0000 (13:22 -0400)]
staging: unisys: get rid of sparstop

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Get rid of references to common-spar
David Kershner [Wed, 13 May 2015 17:22:08 +0000 (13:22 -0400)]
staging: unisys: Get rid of references to common-spar

Makefiles still had common-spar listed in ccflags.

This gets rid of them.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Move files out of common-spar
David Kershner [Wed, 13 May 2015 17:22:07 +0000 (13:22 -0400)]
staging: unisys: Move files out of common-spar

Move last three files out of common-spar

iochannel.h --> include (will be used by visorhba and visornic)
version.h --> moved to include
controlvmcompletionstatus.h --> moved to visorbus, part of
controlvmchannel.h

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Move diagchannel to include
David Kershner [Wed, 13 May 2015 17:22:06 +0000 (13:22 -0400)]
staging: unisys: Move diagchannel to include

Diagchannel needs to go to standard include.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: vbuschannel belonsg to visorbus
David Kershner [Wed, 13 May 2015 17:22:05 +0000 (13:22 -0400)]
staging: unisys: vbuschannel belonsg to visorbus

Move vbuschannel.h into visorbus.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: Move channel.h to include. Controvlm to visorbus
David Kershner [Wed, 13 May 2015 17:22:04 +0000 (13:22 -0400)]
staging: unisys: Move channel.h to include. Controvlm to visorbus

Channel.h is used by all channels, it needs to be in include.
Controlvm Channel is only used by visorbus, it needs to just be there.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>