aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm724x/gdm_mux.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-18staging: gdm724x: Do not break expressionsIgnacio Losiggio1-4/+3
When the entire expression can be shown in the same line breaking it makes it more difficult to read. Signed-off-by: Ignacio Losiggio <iglosiggio@dc.uba.ar> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: gdm724x: remove redundant license informationGreg Kroah-Hartman1-12/+1
Now that the SPDX tag is in all gdm724x files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-26staging: gdm724x: add SPDX identifiers to all files.Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the all of the staging gdm724x files to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19Staging: gdm724x: mux: Check return value of register_lte_tty_driver().Quytelda Kahja1-1/+5
Check the return value of of the register_lte_tty_driver() call in the module initialization function. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: gdm724x: gdm_mux: fix use-after-free on module unloadJohan Hovold1-2/+1
Make sure to deregister the USB driver before releasing the tty driver to avoid use-after-free in the USB disconnect callback where the tty devices are deregistered. Fixes: 61e121047645 ("staging: gdm7240: adding LTE USB driver") Cc: stable <stable@vger.kernel.org> # 3.12 Cc: Won Kang <wkang77@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: gdm724x: Drop useless initialisationsimran singhal1-2/+2
Removed initialisation of a varible if it is immediately reassigned. Changes were made using Coccinelle. @@ type T; constant C; expression e; identifier i; @@ T i - = C ; i = e; Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-09staging/gdm724x: fix "alignment should match open parenthesis" issuesBruno Carvalho1-2/+3
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis" Signed-off-by: Bruno Carvalho <brunocarvalhofarias@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05Staging: gdm724x: Use min instead of ternary operatorBhumika Goyal1-1/+1
This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min return the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14staging: gdm724x: gdm_mux: Remove create_workqueue()Amitoj Kaur Chawla1-15/+3
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop mux_rx_wq by using system_wq. Since there is only one work item per mux_dev and different mux_devs do not need to be ordered, increase of concurrency level by switching to system_wq should not break anything. cancel_work_sync() is used to ensure that work is not pending or executing on any CPU. Lastly, since all devices are suspended, which shutdowns the work item before the driver can be unregistered, it is guaranteed that no work item is pending or executing by the time exit path runs. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: remove multiple blank linesIoana Ciornei1-4/+0
This patch removes multiple blank lines in order to follow linux kernel coding style. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: correct kzalloc/kmalloc sizeof argumentIoana Ciornei1-4/+4
This patch converts sizeof(TYPE) to sizeof(VAR) when used as a kzalloc/kmaloc argument. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: add spaces around binary operatorsIoana Ciornei1-2/+2
This patch add spaces around binary operators in order to follow kernel coding style. Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24stating: gdm724x: remove explicit NULL comparisonIoana Ciornei1-2/+2
This patch converts explicit NULL comparison to its shorter equivalent form. Done with coccinelle semantic patch: @@ expression e; @@ - e == NULL + !e Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: gdm724x: properly indent to match open paranthesisIoana Ciornei1-1/+1
Indent parameters and arguments passed to function calls to match open paranthesis Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: gdx724x: gdm_mux: Remove explicit castShivani Bhardwaj1-1/+1
Compiler can typecast variables implicitly so, explicit type cast is not required and should be removed. Semantic patch used: @@ type T; T e; identifier x; @@ * T x = (T)e; Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16Staging: gdm724x: Remove unnecessary cast on void pointerShraddha Barke1-2/+2
void pointers do not need to be cast to other pointer types. Semantic patch: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-10staging: gdm724x: Correction of variable usage after applying ALIGN()SÅ‚awomir Demeszko1-9/+7
Fix regression introduced by commit <29ef8a53542a>. After it writing AT commands to /dev/GCT-ATM0 is unsuccessful (no echo, no response) and dmesg show "gdmtty: invalid payload : 1 16 f011". Before that commit value of dummy_cnt was only a padding size. After using ALIGN() this value is increased by its first argument. So the following usage of this variable needs correction. Signed-off-by: SÅ‚awomir Demeszko <s.demeszko@wireless-instruments.com> Cc: stable <stable@vger.kernel.org> # 3.14+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18Staging: gdm724x: replace pr_* with dev_*Haneen Mohammed1-2/+2
This patch replace pr_err/pr_info with dev_err/dev_info, when appropriate device structure is found. Issue found and resolved using the following Coccinelle script. pr_err/dev_err was substituted with pr_info/dev_info in the later case. @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, s2, fld; @@ struct s { ... struct s2 *fld; ... }; @rrr@ identifier rr.s2, fld2; @@ struct s2 { ... struct device fld2; ... }; @@ identifier r.i, r.s, rr.fld, rrr.fld2; position r.p; @@ -pr_err@p +dev_err ( + &i->fld->fld2, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18Staging: gdm724x: replace pr_err with dev_errHaneen Mohammed1-2/+2
This patch replace pr_err with dev_err, when appropriate device structre is found. Issue found using the following Coccinelle script: @r exists@ identifier f, s, i; position p; @@ f(...,struct s *i,...) { <+... when != i == NULL pr_err@p(...); ...+> } @rr@ identifier r.s, fld; @@ struct s { ... struct device *fld; ... }; @@ identifier r.i, rr.fld; position r.p; @@ -pr_err@p +dev_err ( + i->fld, ...) Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17Staging: gdm724x: fix space before comma coding style issue in gdm_mux.cRobert Nachlinger1-1/+1
This is a patch to the gdm_mux.c file that fixes a space before comma coding style issue found by the checkpatch.pl tool. Signed-off-by: Robert Nachlinger <robert.nachlinger@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: gdm724x: Fix missing blank line warning.Gulsah Kose1-0/+1
Fixes "Missing a blank line after declarations" checkpatch.pl warning in gdm_mux.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17Staging: gdm724x: gdm_mux.c: fixed coding styleDaniel Ngu1-10/+16
Line over 80 characters Signed-off-by: Daniel Ngu <daniel.dy.ngu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10Staging: gdm724x: Use ALIGN() macro for dummy_cnt in gdm_mux.cRashika Kheria1-6/+2
As suggested in TODO list, this patch uses ALIGN() macro for variable dummy_cnt in functions up_to_host() and gdm_mux_send() in file gdm_mux.c. The macro has already been defined in include/linux/kernel.h, hence is not defined again. Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11staging: gdm7240: fix memory leak on failure pathAlexey Khoroshilov1-2/+2
init_usb() may fail after some of mux_rxes already allocated. So we need to release them on the failure path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11staging: gdm7240: alloc_mux_rx() does not need GFP_ATOMICAlexey Khoroshilov1-3/+3
As far as alloc_mux_rx() is called from probe() only there is no need in GFP_ATOMIC here. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11staging: gdm724x: Fix sparse warnings regarding static functions/variablesValentina Manea1-2/+2
This fixes sparse warnings for functions and variables, e.g.: * drivers/staging/gdm724x/gdm_mux.c:29:25: warning: symbol 'mux_rx_wq' was not declared. Should it be static? Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com> Reviewed-by: Zach Brown <zab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21staging: gdm7240: fix error handling of probe()Dan Carpenter1-32/+25
The error handling is messy and not in kernel style. On some paths it frees "mux_dev" twice. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19staging: gdm7240: a TTY rewrite according to the latest TTY APIsWon Kang1-5/+4
Fixed mis-use of mutex for gdm_table. gdm_table is refered to only inside tty_install and port destrcut, and usb callbacks use internal reference which was saved during urb submission Signed-off-by: Won Kang <wonkang@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26staging: gdm724x: use GFP_ATOMIC under spin lockWei Yongjun1-1/+1
A spin lock is taken here so we should use GFP_ATOMIC. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25staging: gdm724x: Remove version.h header inclusion in gdm_mux.cSachin Kamat1-1/+0
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24staging: gdm724x: Update loggingJoe Perches1-21/+20
Make the logging prefixes match the module names by adding #define pr_fmt(fmt) KBUILD_MODNAME and converting printks to netdev_<level> when a struct netdevice * is available and and pr_<level> when not. Remove embedded prefixes. Add missing terminating newlines. Remove an unnecessary rx-dropped message. Remove an unnecessary temporary variable. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-24staging: gdm7240: adding LTE USB driverWon Kang1-0/+700
GCT Semiconductor GDM7240 is 4G LTE chip. This driver supports GCT reference platform as a USB device. Signed-off-by: Won Kang <wonkang@gctsemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>