platform/kernel/linux-rpi.git
6 years agostaging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h
Ben Evans [Sun, 20 Aug 2017 02:25:59 +0000 (22:25 -0400)]
staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h

Move lu_fid functions into lustre/lustre_fid.h
Move ost_id functions into lustre/lustre_ostid.h
Fix indenting, include new headers as needed.

Several inline functions in the header lustre_ostid.h
are using debug macros instead of returning proper errors.
Remove the debug macros and properly handle the returned
error codes. Place both UAPI headers lustre_fid.h and
lustre_ostid.h into the uapi directory.

Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22712
Reviewed-on: https://review.whamcloud.com/24569
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: uapi: update URL doc link in lustre_fid.h
Ben Evans [Sun, 20 Aug 2017 02:25:58 +0000 (22:25 -0400)]
staging: lustre: uapi: update URL doc link in lustre_fid.h

The wiki has been revived so update the URL about the FID
design in lustre_fid.h.

Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22712
Reviewed-on: https://review.whamcloud.com/24569
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: uapi: return error code for ostid_set_id
Ben Evans [Sun, 20 Aug 2017 02:25:57 +0000 (22:25 -0400)]
staging: lustre: uapi: return error code for ostid_set_id

Currently the function ostid_set_id() just logs an error
and just keeps going. This function is also used by user
land tools so having special lustre kernel debugging
code is not desired. So instead just return an error
code and have the calling kernel code print the error
instead.

Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/22712
Reviewed-on: https://review.whamcloud.com/24569
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: uapi: remove unused functions for lustre_fid.h
James Simmons [Sun, 20 Aug 2017 02:25:56 +0000 (22:25 -0400)]
staging: lustre: uapi: remove unused functions for lustre_fid.h

The inline function fid_is_namespace_visible and ost_fid_from_resid
are only used for server code so we can remove it.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: uapi: Move functions out of lustre_idl.h
Ben Evans [Sun, 20 Aug 2017 02:25:55 +0000 (22:25 -0400)]
staging: lustre: uapi: Move functions out of lustre_idl.h

Migrate functions set/get_mrc_cr_flags, ldlm_res_eq
ldlm_extent_overlap, ldlm_extent_contain,
ldlm_request_bufsize, and all the PTLRPC dump_*
functions out of lustre_idl.h which is a UAPI header
to the places in the kernel code they are actually used.
Delete unused lmv_mds_md_stripe_count and
agent_req_in_final_state.

Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/21484
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: fix a couple of spelling mistakes
Colin Ian King [Tue, 22 Aug 2017 12:51:08 +0000 (13:51 +0100)]
staging: r8822be: fix a couple of spelling mistakes

Trivial fixes to spelling mistake in pr_err error messages:

errorr -> error
mismactch -> mismatch

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: typec: tcpm: make function tcpm_get_pwr_opmode
Colin Ian King [Tue, 22 Aug 2017 16:02:18 +0000 (17:02 +0100)]
staging: typec: tcpm: make function tcpm_get_pwr_opmode

The function pointer tcpm_get_pwr_opmode is local to the source and does
not need to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'tcpm_get_pwr_opmode' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: fsl-dpaa2: ethernet: dpni.c: Fixed alignment to match open parenthesis.
Srishti Sharma [Sun, 20 Aug 2017 01:44:55 +0000 (07:14 +0530)]
Staging: fsl-dpaa2: ethernet: dpni.c: Fixed alignment to match open parenthesis.

Fixed alignment so that it matched open parenthesis

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: greybus: audio: constify snd_soc_dai_ops structures
Arvind Yadav [Mon, 21 Aug 2017 04:58:24 +0000 (10:28 +0530)]
staging: greybus: audio: constify snd_soc_dai_ops structures

snd_soc_dai_ops are not supposed to change at runtime. All functions
working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with
const snd_soc_dai_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: greybus: Fix spelling error in comment
Eames Trinh [Mon, 21 Aug 2017 22:11:37 +0000 (00:11 +0200)]
Staging: greybus: Fix spelling error in comment

Fixed a spelling error.

Signed-off-by: Eames Trinh <eamestrinh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: fix multiple build errors
Randy Dunlap [Tue, 22 Aug 2017 15:51:09 +0000 (08:51 -0700)]
staging: rtlwifi: fix multiple build errors

Fix many build errors when NETDEVICES is not enabled.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: use ATTRIBUTE_GROUPS instead of creating our own
David Kershner [Tue, 22 Aug 2017 17:27:36 +0000 (13:27 -0400)]
staging: unisys: use ATTRIBUTE_GROUPS instead of creating our own

Greg noticed that we were creating our own attribute groups, instead of
using the ATTRIBUTE_GROUPS macro, this patch fixes our mistake.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Get rid of passthrough function visorchipset_device_destroy
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:27:35 +0000 (13:27 -0400)]
staging: unisys: visorbus: Get rid of passthrough function visorchipset_device_destroy

The function visorchipset_device_destroy just called remove_visor_device,
we can just combine it with remove_visor_device.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Get rid of passthrough function visorchipset_device_create
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:27:34 +0000 (13:27 -0400)]
staging: unisys: visorbus: Get rid of passthrough function visorchipset_device_create

The function visorchipset_device_create just called create_visor_device,
we can just combine it with create_visor_device.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_destroy
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:27:33 +0000 (13:27 -0400)]
staging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_destroy

The function visorchipset_bus_destroy just called viosrbus_remove_instance,
we can just combine it with visorbus_remove_instance.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: iochannel.h: Add proper copyright statement
David Binder [Tue, 22 Aug 2017 17:27:32 +0000 (13:27 -0400)]
staging: unisys: include: iochannel.h: Add proper copyright statement

Adds the proper Unisys copyright statement to the top of iochannel.h.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorinput: ultrainputreport.h: Adjust comment formatting
David Binder [Tue, 22 Aug 2017 17:27:31 +0000 (13:27 -0400)]
staging: unisys: visorinput: ultrainputreport.h: Adjust comment formatting

The first line of the top file comment should begin on the line following
the block comment opening, thereby following the convention used elsewhere
in the driver set.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorhba: Adjust top comment formatting
David Binder [Tue, 22 Aug 2017 17:27:30 +0000 (13:27 -0400)]
staging: unisys: visorhba: Adjust top comment formatting

The first line of the top file comment should begin on the line following
the block comment opening, thereby following the convention used elsewhere
in the driver set.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: visorbus.h: Remove filename in top comment
David Binder [Tue, 22 Aug 2017 17:27:29 +0000 (13:27 -0400)]
staging: unisys: include: visorbus.h: Remove filename in top comment

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorinput: visorinput.c: Remove filename in top comment
David Binder [Tue, 22 Aug 2017 17:27:28 +0000 (13:27 -0400)]
staging: unisys: visorinput: visorinput.c: Remove filename in top comment

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: visorchannel.c: Remove filename in top comment
David Binder [Tue, 22 Aug 2017 17:27:27 +0000 (13:27 -0400)]
staging: unisys: visorbus: visorchannel.c: Remove filename in top comment

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: visorbus_main.c: Remove filename in top comment
David Binder [Tue, 22 Aug 2017 17:27:26 +0000 (13:27 -0400)]
staging: unisys: visorbus: visorbus_main.c: Remove filename in top comment

Removes unnecessary filename in the top file comment.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: visorchipset.c: Fix SonarQube sprintf findings
David Binder [Tue, 22 Aug 2017 17:27:25 +0000 (13:27 -0400)]
staging: unisys: visorbus: visorchipset.c: Fix SonarQube sprintf findings

Fixes two sprintf invocations where we attempt to format an unsigned
integer as a signed integer.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: iochannel.h: Update comments for #defines
David Kershner [Tue, 22 Aug 2017 17:27:07 +0000 (13:27 -0400)]
staging: unisys: include: iochannel.h: Update comments for #defines

Cleaned up some #defines to make the beginning of the file read easier.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_create
David Kershner [Tue, 22 Aug 2017 17:27:24 +0000 (13:27 -0400)]
staging: unisys: visorbus: Get rid of passthrough function visorchipset_bus_create

The function visorchipset_bus_create just called visorbus_create_instance,
we should just combine it with visorbus_create_instance.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: reference bus_no and dev_no directly
David Kershner [Tue, 22 Aug 2017 17:27:23 +0000 (13:27 -0400)]
staging: unisys: reference bus_no and dev_no directly

Don't store it in a local variable but reference it from the
visor_device.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: don't copy to local variable
David Kershner [Tue, 22 Aug 2017 17:27:22 +0000 (13:27 -0400)]
staging: unisys: don't copy to local variable

Do the check with the values in the structure instead of copying them to
local variables.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Remove confusing comment in controlvmchannel.
David Kershner [Tue, 22 Aug 2017 17:27:21 +0000 (13:27 -0400)]
staging: unisys: visorbus: Remove confusing comment in controlvmchannel.

Referencing a SegmentIndex doesn't make sense in the Linux drivers, get rid
of the comment.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: Move SIOVM guid to visorbus
David Kershner [Tue, 22 Aug 2017 17:27:20 +0000 (13:27 -0400)]
staging: unisys: Move SIOVM guid to visorbus

The SIOVM guid is only used by visorchipset. So define it there instead
of a global header file.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: Move VNIC GUID to visornic
David Kershner [Tue, 22 Aug 2017 17:27:19 +0000 (13:27 -0400)]
staging: unisys: Move VNIC GUID to visornic

Instead of including it in the global channel.h, move the VNIC GUID to the
visornic module.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: remove unnecessary blank line from channel.h
David Kershner [Tue, 22 Aug 2017 17:27:18 +0000 (13:27 -0400)]
staging: unisys: include: remove unnecessary blank line from channel.h

Remove unnecessary blank line from channel.h #defines.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorinput: Get rid of unused includes
David Kershner [Tue, 22 Aug 2017 17:27:17 +0000 (13:27 -0400)]
staging: unisys: visorinput: Get rid of unused includes

Cleanups caused us to not need to include a bunch of headers, got rid of
them.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: iochannel needs to include skbuff
David Kershner [Tue, 22 Aug 2017 17:27:16 +0000 (13:27 -0400)]
staging: unisys: include: iochannel needs to include skbuff

The iochannel.h header file references ETH_HLEN which is defined in
skbuff. Removed it from visorhba since it was no longer needed.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Remove unnecessary includes for visorchipset.c
David Kershner [Tue, 22 Aug 2017 17:27:15 +0000 (13:27 -0400)]
staging: unisys: visorbus: Remove unnecessary includes for visorchipset.c

Visorchipset.c was including unnecessary include files, either included by
other headers or not needed at all.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: fix include dependency
David Kershner [Tue, 22 Aug 2017 17:27:14 +0000 (13:27 -0400)]
staging: unisys: visorbus: fix include dependency

Due to include order, the visorbus_private.h file was missing a required
include header visorbus.h. If visorchipset.c or visorbus_main.c ever were
to change the order of the includes for visobus.h and visorbus_private.h,
the code would fail to compile.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Remove unneeded includes from visorbus.h
David Kershner [Tue, 22 Aug 2017 17:27:13 +0000 (13:27 -0400)]
staging: unisys: include: Remove unneeded includes from visorbus.h

A bunch of code churn has caused the following include files to not be
needed by visorbus.h:

linux/poll.h
linux/kernel.h
linux/uuid.h
linux/seq_file.h

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Remove unnecessary forward declaration
David Kershner [Tue, 22 Aug 2017 17:27:12 +0000 (13:27 -0400)]
staging: unisys: include: Remove unnecessary forward declaration

The struct visor_device had a forward declaration that was not needed.
Remove it.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Fix up comment style in visorbus.h
David Kershner [Tue, 22 Aug 2017 17:27:11 +0000 (13:27 -0400)]
staging: unisys: include: Fix up comment style in visorbus.h

Visorbus.h had comments that did not have /* on its own line, this patch
makes it uniform.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: cleanup channel comment
David Kershner [Tue, 22 Aug 2017 17:27:10 +0000 (13:27 -0400)]
staging: unisys: include: cleanup channel comment

A comment in channel.h was referencing windows guests, in reality the OS
of the guest is agnostic and the comment should reflect that.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Remove unused throttling defines.
David Kershner [Tue, 22 Aug 2017 17:27:09 +0000 (13:27 -0400)]
staging: unisys: include: Remove unused throttling defines.

We no longer send messages directly to the s-Par event log, so we do not
need the throttling defines anymore.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Remove unused vdiskmgmt commands
David Kershner [Tue, 22 Aug 2017 17:27:08 +0000 (13:27 -0400)]
staging: unisys: include: Remove unused vdiskmgmt commands

The vdisk task management commands are no longer used by s-Par, this
patch removes the definitions for them.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: Remove unused #define MAXNUM
David Kershner [Tue, 22 Aug 2017 17:27:05 +0000 (13:27 -0400)]
staging: unisys: include: Remove unused #define MAXNUM

The MAXNUM #define was not being used, and it shouldn't be used.
Remove it.

Reviewed-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: merging the visorbus_device_pause_response and visorbus_de...
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:27:04 +0000 (13:27 -0400)]
staging: unisys: visorbus: merging the visorbus_device_pause_response and visorbus_device_resume_response functions into one.

The functions viosrbus_device_pause_response() and
viosrbus_device_resume_response() are functionally similar.
Merging these functions into a single function called
visorbus_device_changestate_response().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: merging the visorbus_*_response functions into one.
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:27:03 +0000 (13:27 -0400)]
staging: unisys: visorbus: merging the visorbus_*_response functions into one.

The functions visorbus_create_response(), visorbus_destroy_response(),
viosrbus_device_create_response(), viosrbus_device_destroy_response()
are all functionally similar. Merging these four functions into a
single function called visorbus_response().

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: fix improper use of dma_data_direction
Steven Matthews [Tue, 22 Aug 2017 17:27:02 +0000 (13:27 -0400)]
staging: unisys: include: fix improper use of dma_data_direction

Replace use of standard Linux dma_data_direction with a Unisys-
specific uis_dma_data_direction and provide a function to convert
from the latter to the former.  This is necessary because Unisys
s-Par depends on the exact format of this field in multiple OSs
and languages, and so using the standard version creates an
unnecessary dependency between the kernel and s-Par.

Signed-off-by: Steven Matthews <steven.matthews@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Remove unnecessary comments
David Binder [Tue, 22 Aug 2017 17:27:01 +0000 (13:27 -0400)]
staging: unisys: visorbus: Remove unnecessary comments

Removes comments that do not provide any valuable information.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Merge vmcallinterface.h into visorchipset.c
David Binder [Tue, 22 Aug 2017 17:27:00 +0000 (13:27 -0400)]
staging: unisys: visorbus: Merge vmcallinterface.h into visorchipset.c

The contents of vmcallinterface.h are better placed within
visorchipset.c from an organizational perspective. The values are only
used in that file.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visornic: visornic_main.c: fix multiline dereference.
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:26:59 +0000 (13:26 -0400)]
staging: unisys: visornic: visornic_main.c: fix multiline dereference.

This patch fixes two checkpatch warnings in the visornic_main.c
file to avoid multiline dereference.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visornic: update the struct visornic_devdata comments
Sameer Wadgaonkar [Tue, 22 Aug 2017 17:26:58 +0000 (13:26 -0400)]
staging: unisys: visornic: update the struct visornic_devdata comments

Cleaned up the in-line comments in the structure and added a single block
comment for the structure.

Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: fix multi-line function definition
Charles Daniels [Tue, 22 Aug 2017 17:26:57 +0000 (13:26 -0400)]
staging: unisys: visorbus: fix multi-line function definition

Fixed incorrectly styled function definitions in visorbus/visorchipset.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels <cdaniels@fastmail.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: visorbus_private.h remove filename
Mark Foresta [Tue, 22 Aug 2017 17:26:56 +0000 (13:26 -0400)]
staging: unisys: visorbus: visorbus_private.h remove filename

Remove the filename in the comment at the beginning of the file.

Signed-off-by: Mark Foresta <Mark.Foresta@Unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Update comment style vbuschannel.h
Mark Foresta [Tue, 22 Aug 2017 17:26:55 +0000 (13:26 -0400)]
staging: unisys: visorbus: Update comment style vbuschannel.h

Moved blocked comment on to own line at beginning of struct to follow
standard. Since this is an internal structure, the block comment isn't
actually a kernel-doc so we only start the block with one asterisk.

Signed-off-by: Mark Foresta <Mark.Foresta@Unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: Switch to use new generic UUID API
Andy Shevchenko [Tue, 22 Aug 2017 17:26:54 +0000 (13:26 -0400)]
staging: unisys: Switch to use new generic UUID API

There are new types and helpers that are supposed to be used in new code.

As a preparation to get rid of legacy types and API functions do
the conversion here.

While here, re-indent couple of lines to increase readability.

Cc: David Kershner <david.kershner@unisys.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: sparmaintainer@unisys.com
Cc: devel@driverdev.osuosl.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: Adding a new line between function definition
Zohaib Javed [Tue, 22 Aug 2017 17:26:53 +0000 (13:26 -0400)]
staging: unisys: visorbus: Adding a new line between function definition

Added a new line before issue_vmcall_io_controlvm_addr() function
definition.

Signed-off-by: Zohaib Javed <zohaib.javed@gmail.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: include: iochannel.h: Removed unused DEFINE
Zohaib Javed [Tue, 22 Aug 2017 17:26:52 +0000 (13:26 -0400)]
staging: unisys: include: iochannel.h: Removed unused DEFINE

Removed unused #define GPI_ENTRIES_PER_PAGE

Signed-off-by: Zohaib Javed <zohaib.javed@gmail.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visorbus: remove filename from beginning of file
Zohaib Javed [Tue, 22 Aug 2017 17:26:51 +0000 (13:26 -0400)]
staging: unisys: visorbus: remove filename from beginning of file

The filename was in a comment at the beginning of the file. It is not
needed.

Signed-off-by: Zohaib Javed <zohaib.javed@gmail.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Reviewers fixes
Larry Finger [Thu, 17 Aug 2017 17:46:52 +0000 (12:46 -0500)]
staging: rtlwifi: Reviewers fixes

This commit adds the TODO file and implements some reviewers comments
made against some patches to the wireless tree.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add Makefiles and Kconfig for new driver
Larry Finger [Thu, 17 Aug 2017 17:46:51 +0000 (12:46 -0500)]
staging: r8822be: Add Makefiles and Kconfig for new driver

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

This commit enables building of the new driver. For this version, all
routines are built into a single module r8822be. When this driver is
moved to the wireless tree, halmac, phydm, and rtl8822be will become
new modules.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add the driver code
Ping-Ke Shih [Thu, 17 Aug 2017 17:46:50 +0000 (12:46 -0500)]
staging: r8822be: Add the driver code

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

This commit adds the code for the new r8822be driver.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add phydm mini driver
Ping-Ke Shih [Thu, 17 Aug 2017 17:46:49 +0000 (12:46 -0500)]
staging: r8822be: Add phydm mini driver

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

New Realtek wireless devices have a new method for PHY control and
dynamic management. The RTL8822BE is the first of these devices, thus
there is additional code required.

In the final version, this code will be a separate module; however,
it is combined with the r8822be driver to minimize the interference
with the drivers in the wireless tree.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add code for halmac sub-driver
Ping-Ke Shih [Thu, 17 Aug 2017 17:46:48 +0000 (12:46 -0500)]
staging: r8822be: Add code for halmac sub-driver

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

New Realtek devices implement a common sub-driver to control the MAC
layer. The RTL8822BE is the first of these devices, thus its introduction
involves some extra code. In the wireless tree, this will be a separate
module; however, it is compiled into the 8822be driver here.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add r8822be btcoexist routines to staging
Ping-Ke Shih [Thu, 17 Aug 2017 17:46:47 +0000 (12:46 -0500)]
staging: r8822be: Add r8822be btcoexist routines to staging

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

This commit adds the routines needed for BT coexistence with the
new driver.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Copy existing btcoexist code into staging
Larry Finger [Thu, 17 Aug 2017 17:46:46 +0000 (12:46 -0500)]
staging: r8822be: Copy existing btcoexist code into staging

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

This commit copies the existing routines from .../rtlwifi/btcoexist/
into staging. There are no changes other than removing all EXPORT
statements, and the fixing of checkpatch messages. The latter will
be backported to the wireless tree.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver
Ping-Ke Shih [Thu, 17 Aug 2017 17:46:45 +0000 (12:46 -0500)]
staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver

The RTL8822BE, an 802.11ac wireless network card, is now appearing in
new computers. Its driver is being placed in staging to reduce the time
that users of this new card will have access to in-kernel drivers.

This commit copies the code that currently constitutes the rtlwifi and
rtl_pci mini drivers. This material is copied into staging to prevent
any undo interaction between the existing drivers and this new one.
The only changes in this code are the removal of all export statements,
and the fixing of some checkpatch messages. The latter will be backported
into the wireless tree.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: hfa384x_usb: Fix multiple line dereference
Alex Briskin [Fri, 18 Aug 2017 12:27:35 +0000 (15:27 +0300)]
staging: wlan-ng: hfa384x_usb: Fix multiple line dereference

Refactor code to be more readable and eliminate the checkpatch
warning

Signed-off-by: Alex Briskin <br.shurik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: greybus: vibrator.c: Fixed alignment to match open parenthesis.
Srishti Sharma [Sat, 19 Aug 2017 08:42:50 +0000 (14:12 +0530)]
Staging: greybus: vibrator.c: Fixed alignment to match open parenthesis.

Fixed alignment so that it matched open parenthesis

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: greybus: make device_type const
Bhumika Goyal [Sat, 19 Aug 2017 08:22:25 +0000 (13:52 +0530)]
staging: greybus: make device_type const

Make this const as it is only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/rts5208: fix incorrect shift to extract upper nybble
Colin Ian King [Fri, 18 Aug 2017 13:34:16 +0000 (14:34 +0100)]
staging/rts5208: fix incorrect shift to extract upper nybble

The mask of sns_key_info1 suggests the upper nybble is being extracted
however the following shift of 8 bits is too large and always results in
0.  Fix this by shifting only by 4 bits to correctly get the upper nybble.

Detected by CoverityScan, CID#142891 ("Operands don't affect result")

Fixes: fa590c222fba ("staging: rts5208: add support for rts5208 and rts5288")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: pi433: fixed coding style issues
Xiangyang Zhang [Fri, 18 Aug 2017 03:27:40 +0000 (11:27 +0800)]
staging: pi433: fixed coding style issues

space required before the open parenthesis, open brace should be
on previous line.

Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:rtl8188eu: fix coding style issue
Jamie Huang [Fri, 18 Aug 2017 00:49:45 +0000 (08:49 +0800)]
staging:rtl8188eu: fix coding style issue

checkpatch.pl gave
ERROR: open brace '{' following function definitions go on the next line.

Signed-off-by: Jamie Huang <jamienstar@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lustre: Off by two in lmv_fid2path()
Dan Carpenter [Fri, 28 Jul 2017 14:42:27 +0000 (17:42 +0300)]
staging: lustre: lustre: Off by two in lmv_fid2path()

We want to concatonate join string one, a '/' character, string two and
then a NUL terminator.  The destination buffer holds ori_gf->gf_pathlen
characters.  The strlen() function returns the number of characters not
counting the NUL terminator.  So we should be adding two extra spaces,
one for the foward slash and one for the NUL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.14b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Sun, 20 Aug 2017 17:42:42 +0000 (10:42 -0700)]
Merge tag 'iio-for-4.14b' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of IIO new device support, features and cleanup for the 4.14 cycle.

New device support:
* ak8974
  - support the AMI306.
* st_magnetometer
  - add support for the LIS2MDL with bindings.
* rockchip-saradc
  - add binding for rv1108 SoC (no driver change).
* srf08
  - add srf02 (i2c only) and srf10 support.
* stm32-timer
  - support for the STM32H7 to existing driver.

Features:
* tools
  - move over to the tools buildsystem rather than hand rolling.
  - add an install section to the build.
* ak8974
  - use serial number to add device randomness.
  - add AMI306 calibration data output.
* ccs811
  - triggered buffer support.
* srf08
  - add a device tree table as the old style i2c probing is going away,
  - add triggered buffer support
* st32-adc
  - add optional st,min-sample-time-nsecs binding to allow control of
    sampling against analog circuitry.
* stm32-timer
  - add output compare triggers.
* ti-ads1015
  - add threshold event support.
* ti-ads7950
  - Allow use on ACPI platforms including providing a default reference
    voltage as there is no way to obtain this on ACPI currently.

Cleanup and fixes:
* ad7606
  - fix an error return code in probe.
* ads1015
  - fix incorrect data rate setting update when capture in progress,
  - fix wrong scale information for the ADS1115,
  - make conversions work when CONFIG_PM is not set,
  - make sure we don't get a stale result after a runtime resume by
    ensuring we wait long enough,
  - avoid returning a false error form the buffer setup callbacks,
  - add enough wait time to get the correct conversion,
  - remove an unnecessary config register update,
  - add a helper to set conversion mode reducing repeated boilerplate,
  - use devm_iio_triggered_buffer_setup to simplify error and remove
    paths,
  - use iio_device_claim_direct_mode instead of opencoding the same.
* ak8974
  - mark the INT_CLEAR register as precious to prevent debugfs access.
* apds9300
  - constify the i2c_device_id.
* at91-sama5 adc
  - add missing Kconfig dependency.
* bma180 accel
  - constify the i2c_device_id.
* rockchip_saradc
  - explicitly request exclusive reset control as part of the reset rework
    on going throughout the kernel.
* st_accel
  - fix drdy configuration for a load of accelerometers that only have
    the int1 line.  Fix is unimportant as presumably no deviec tree actually
    used the non existent hardware line.
* st_pressure
  - fix drdy configuration for LPS22HB and LPS25H by dropping int2 support
    as they don't have this. Fix is unimportant as presumably no device tree
    actually used the non existent hardware line.
* stm32-dac
  - explicitly request exclusive reset control (part of reset being reworked).
* tsl2583
  - constify the i2c_device_id.
* xadc
  - coding style fixes.

6 years agoiio: adc: rockchip_saradc: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:35 +0000 (17:25 +0200)]
iio: adc: rockchip_saradc: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-iio@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: dac: stm32-dac-core: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:36 +0000 (17:25 +0200)]
iio: dac: stm32-dac-core: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: add threshold event support
Akinobu Mita [Thu, 20 Jul 2017 15:24:27 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add threshold event support

The ADS1015 device provides programmable comparator that can issue an
interrupt on the ALERT pin.  This change adds the iio threshold event
support for that feature.

The ADS1015 device only have a single config register which contains an
input multiplexer selection, comparator settings, and etc.  So only a
single event channel can be enabled at a time.  Also enabling both buffer
and event are prohibited for simplicity.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: use iio_device_claim_direct_mode()
Akinobu Mita [Thu, 20 Jul 2017 15:24:26 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: use iio_device_claim_direct_mode()

While the iio buffer for the ti-ads1015 driver is enabled, reading the
raw ADC channel data is restricted.  We usually use the
iio_device_claim_direct_mode()/iio_device_release_direct_mode() pair for
that.

This change consequently reverses the locking order for the driver's
private lock and indio_dev->mlock which acquired by
iio_device_claim_direct_mode() internally. But it's safe because there is
no other dependency between these locks.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: use devm_iio_triggered_buffer_setup
Akinobu Mita [Thu, 20 Jul 2017 15:24:25 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: use devm_iio_triggered_buffer_setup

Use devm_iio_triggered_buffer_setup to simplify the error path in the
probe() and remove() function.

This changes the remove order, but the end result of remove function
actually does the reverse of probe.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: add helper to set conversion mode
Akinobu Mita [Thu, 20 Jul 2017 15:24:24 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add helper to set conversion mode

This adds a helper function to set conversion mode as there are a fair
number of users.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: remove unnecessary config register update
Akinobu Mita [Thu, 20 Jul 2017 15:24:23 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: remove unnecessary config register update

The ti-ads1015 driver has eight iio voltage channels and each iio channel
can hold own scale information.

The ADS1015 device only have a single config register which contains an
input multiplexer selection, PGA and data rate settings.  So the driver
should load the correct settings when the input multiplexer selection is
changed.

However, regardless of which channlel is currently selected, changing any
iio channel's scale information immediately overwrites the current PGA
setting in the config register.

It is harmless because the correct PGA settings are reloaded just before
getting adc result anyway.  But it is unnecessary register update and
should be removed.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: add adequate wait time to get correct conversion
Akinobu Mita [Thu, 20 Jul 2017 15:24:22 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: add adequate wait time to get correct conversion

This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously.  So this driver
inserts a wait time before reading the conversion register if the
configuration is changed from a previous request.

Currently, the wait time is only the period required for a single
conversion that is calculated as the reciprocal of the sampling frequency.
However we also need to wait for the the previous conversion to complete.
Otherwise we probably get the conversion result for the previous
configuration when the sampling frequency is lower.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks
Akinobu Mita [Thu, 20 Jul 2017 15:24:21 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks

pm_runtime_get_sync() and pm_runtime_put_autosuspend() return 0 on
success, 1 if the device's runtime PM status was already requested status
or error code on failure.  So a positive return value doesn't indicate an
error condition.

However, any non-zero return values from buffer preenable and postdisable
callbacks are recognized as an error and this driver reuses the return
value from pm_runtime_get_sync() and pm_runtime_put_autosuspend() in
these callbacks.  This change fixes the false error detections.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: avoid getting stale result after runtime resume
Akinobu Mita [Thu, 20 Jul 2017 15:24:20 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: avoid getting stale result after runtime resume

This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously.  So this driver
doesn't insert a wait time before reading the conversion register if the
configuration is not changed from a previous request.

This assumption is broken if the device is runtime suspended and entered
a power-down state.  The forthcoming request causes reading a stale result
from the conversion register as the device is runtime resumed just before.

Fix it by adding a flag to detect that condition and insert a necessary
wait time.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set
Akinobu Mita [Thu, 20 Jul 2017 15:24:19 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set

The ADS1015 device have two operating modes, continuous conversion mode
and single-shot mode.  This driver assumes that the continuous conversion
mode is selected by runtime resume callback when the ADC result is
requested.

If CONFIG_PM is disabled, the device is always in the default single-shot
mode and no one begins a single conversion.  So the conversion register
doesn't contain valid ADC result.  Fix it by changing the continuous mode
in probe function.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: fix scale information for ADS1115
Akinobu Mita [Thu, 20 Jul 2017 15:24:18 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: fix scale information for ADS1115

The ti-ads1015 driver supports ADS1015 and ADS1115 devices.  The same
scale information is used for both devices in this driver, however they
have actually different values and the ADS1115's one is not correct.

These devices have the same full-scale input voltage range for each PGA
selection.  So instead of adding another hardcoded scale information,
compute a correct scale on demand from each device's resolution.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads1015: fix incorrect data rate setting update
Akinobu Mita [Thu, 20 Jul 2017 15:24:17 +0000 (00:24 +0900)]
iio: adc: ti-ads1015: fix incorrect data rate setting update

The ti-ads1015 driver has eight iio voltage channels and each iio channel
can hold own sampling frequency information.

The ADS1015 device only have a single config register which contains an
input multiplexer selection, PGA and data rate settings.  So the driver
should load the correct settings when the input multiplexer selection is
changed.

However, regardless of which channlel is currently selected, changing any
iio channel's sampling frequency information immediately overwrites the
current data rate setting in the config register.

It breaks the current data rate setting if the different channel's sampling
frequency information is changed because the data rate setting is not
reloaded when the input multiplexer is switched.

This removes the unexpected config register update and correctly load the
data rate setting before getting adc result.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads7950: Allow to use on ACPI platforms
Andy Shevchenko [Fri, 28 Jul 2017 22:20:14 +0000 (01:20 +0300)]
iio: adc: ti-ads7950: Allow to use on ACPI platforms

ACPI enabled platforms do not have a mean of regulators. Instead we use
hard coded voltage value for reference pin. When value is 0 (default) we
fall back to request a regulator.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: ak8974: debug AMI306 calibration data
Michał Mirosław [Thu, 17 Aug 2017 13:56:12 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: debug AMI306 calibration data

Use AMI306 calibration data for randomness and debugging.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: ak8974: mark INT_CLEAR as precious
Michał Mirosław [Thu, 17 Aug 2017 13:56:11 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: mark INT_CLEAR as precious

Reading INT_CLEAR has side effects - disallow reading it via debugfs.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: ak8974: add_device_randomness (serial number)
Michał Mirosław [Thu, 17 Aug 2017 13:56:11 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: add_device_randomness (serial number)

Mix device-specific data into randomness pool.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: ak8974: support AMI306 variant
Michał Mirosław [Thu, 17 Aug 2017 13:56:10 +0000 (15:56 +0200)]
iio: magnetometer: ak8974: support AMI306 variant

Add support for AMI306 magnetometer - very similar to AMI305.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: light: tsl2583: constify i2c_device_id
Arvind Yadav [Sat, 19 Aug 2017 18:47:38 +0000 (00:17 +0530)]
iio: light: tsl2583: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: light: apds9300: constify i2c_device_id
Arvind Yadav [Sat, 19 Aug 2017 18:47:37 +0000 (00:17 +0530)]
iio: light: apds9300: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: accel: bma180: constify i2c_device_id
Arvind Yadav [Sat, 19 Aug 2017 18:47:36 +0000 (00:17 +0530)]
iio: accel: bma180: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: lustre: mgc: fix potential use after free in error path
Cihangir Akturk [Mon, 7 Aug 2017 10:43:00 +0000 (13:43 +0300)]
staging: lustre: mgc: fix potential use after free in error path

The config_log_add() function first calls config_log_put() with the
variable 'cld' and then jumps to label 'out_cld', which will call
the same function with the same 'cld' variable. However, at this
point, 'cld' might have been already freed by the first invocation
of config_log_put(). Even if we remove the invocation at that point,
we will still get into trouble. This is because, in the error path,
just below the label 'out_cld', we try to put 'params_cls' and
'sptlrpc_cld', which might also have been freed by config_log_put().

The point is that, config_llog_data::cld_sptlrpc and
config_llog_data::cld_params members are assigned at the beginning
of this function.

To avoid this, do not call config_log_put() inside the else block,
immediately jump to 'out_cld' instead. Moreover, remove assignments
to config_llog_data::cld_sptlrpc and config_llog_data::cld_params at
the beginning, since we already assign them below in the function
with 'cld_lock' held.

As an additional benefit, code size gets smaller.

before:
text    data     bss     dec     hex filename
26188   2256    4208   32652    7f8c drivers/staging/lustre/lustre/mgc/mgc_request.o

after:
text    data     bss     dec     hex filename
26092   2256    4208   32556    7f2c drivers/staging/lustre/lustre/mgc/mgc_request.o

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: obd: make echo_lock_ops const
Bhumika Goyal [Thu, 3 Aug 2017 09:12:48 +0000 (14:42 +0530)]
staging: lustre: obd: make echo_lock_ops const

Declare echo_lock_ops object of type cl_lock_operations as const as it
is only passed to the function cl_lock_slice_add. The corresponding
argument is of type const, so make the object const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: declare fiemap_for_stripe static
David Wittman [Wed, 2 Aug 2017 04:19:51 +0000 (23:19 -0500)]
staging: lustre: declare fiemap_for_stripe static

Declare fiemap_for_stripe as static to fix sparse warnings:

> warning: symbol 'fiemap_for_stripe' was not declared. Should it be
> static?

Signed-off-by: David Wittman <dwittman@gmail.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix minor typos in comments
NeilBrown [Wed, 2 Aug 2017 03:26:11 +0000 (13:26 +1000)]
staging: lustre: fix minor typos in comments

Fix minor typos in comments.

Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: typec: tcpm: explicit_contract is always established
Badhri Jagan Sridharan [Thu, 17 Aug 2017 19:11:21 +0000 (12:11 -0700)]
staging: typec: tcpm: explicit_contract is always established

While in SNK_READY state, the explicit_contract seems to be
set to true irrespective of whether an explicit contract
was established for the current connection. TCPM also seems
to report the pwr_opmode as TYPEC_PWR_MODE_PD always once
the port gets into SNK_READY state. This isn't completely
true as port gets into the SNK_READY state for non-pd
type-c ports as well.

This patch sets the explicit_contract flag only when
the PS_READY message is received and the vbus has been
detected by the port controller.

Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: greybus: Match alignment with open parenthesis.
Shreeya Patel [Fri, 28 Jul 2017 19:50:42 +0000 (01:20 +0530)]
Staging: greybus: Match alignment with open parenthesis.

Alignment should match with open parenthesis.
This fixes the coding style issue.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: speakup: fix async usb removal
Okash Khawaja [Sat, 12 Aug 2017 08:05:47 +0000 (09:05 +0100)]
staging: speakup: fix async usb removal

When an external USB synth is unplugged while the module is loaded, we
get a null pointer deref. This is because the tty disappears while
speakup tries to use to to communicate with the synth. This patch fixes
it by checking tty for null before using it. Since tty can become null
between the check and its usage, a mutex is introduced. tty usage is
now surrounded by the mutex, as is the code in speakup_ldisc_close which
sets the tty to null. The mutex also serialises calls to tty from
speakup code.

In case of tty being null, this sets synth->alive to zero and restarts
ttys in case they were stopped by speakup.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>