aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/pi433 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-16staging: pi433: add dependency to PA0, 1, 2 setting for output power levelSidong Yang1-6/+39
When setting output power level called, the power level should be checked by power amplifier level register and high power option. There was todo about it. Add some variables for checking power level range. The values that used for checking high power or minimum power are from rf69 datasheets. The maximum power level is always same regardless of mode. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Makefile filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Makefile files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03staging: add missing SPDX lines to Kconfig filesGreg Kroah-Hartman1-0/+1
There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-02staging: pi433: Return thread immediately when kthread_should_stop() call.Sidong Yang1-1/+1
When kthread_stop() called by removing module, running thread should return immediately. Otherwise, It is very dangerous that thread may access any released data like struct pi433_device. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-29staging: pi433: Fix rf69_set_tx_cfg() logicSidong Yang1-10/+6
Moved code to configure sync to where check enable_sync option before. There is no need to check enable_sync twice. Configuring sync should be executed immediately after enabling sync. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-26staging: pi433: remove unnecessary calling rf69_set_mode()Sidong Yang1-7/+5
Remove unnecessary rf69_set_mode() function call when rx is waiting for a telegram. There is waste to call rf69_set_mode() twice for becoming standby mode. Signed-off-by: Sidong Yang <realwakka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22staging: pi433: remove empty space to fix line over 80 characters warningJules Irenge1-4/+4
Remove empty space to solve checkpatch.pl warning: "WARNING: line over 80 characters". Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18staging: pi433: Remove unused variable.Bhagyashri Dighole1-3/+1
Remove unused variable which is used to store return value, Detected by Coccinelle semantic patch returnvar.cocci Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05staging: pi433: add missing call to cdev_del()Michael Straube1-1/+3
If cdev_add() fails, cdev_del() should be called. Add the missing cdev_del() call as pointed out by Dan Carpenter. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26staging: pi433: fix potential null dereferenceMichael Straube1-0/+4
Add a test for successful call to cdev_alloc() to avoid potential null dereference. Issue reported by smatch. Signed-off-by: Michael Straube <straube.linux@gmail.com> Fixes: 874bcba65f9a ("staging: pi433: New driver") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-20staging: pi433: remove GPL boiler plate textMichael Straube6-60/+0
The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. All source and header files have SPDX identifiers. Remove the GPL boiler plate text to reduce file size. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: pi433: eliminate a temporary variableDan Carpenter1-2/+1
We can just get rid of the "spi_address". It's not clear what the "address" part of the name means, and the type should have been a u8. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-12staging: pi433: fix error return code in pi433_probe()Wei Yongjun1-0/+1
Fix to return a negative error code from the kthread_run() error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11staging: pi433: Make only one statement per lineSophie Matter1-6/+18
Lines containing multiple statements were broken into multiple lines, increasing readability and complying with the coding standard. This also fixes several checkpatch.pl errors complaining about the lines being too long. Signed-off-by: Sophie Matter <sophie.matter@web.de> Signed-off-by: Rico Schrage <rico.schrage@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11staging: pi433: Use preferred commenting styleSophie Matter2-15/+30
For multi-line comments, the preferred commenting style from the coding style Documentation was applied to the comments, meaning almost blank lines at the beginning and end of the comment. One changed comment includes a line over 80 characters, causing checkpatch.pl to complain, however breaking this line would not make much sense, so it is kept like it is. Signed-off-by: Sophie Matter <sophie.matter@web.de> Signed-off-by: Rico Schrage <rico.schrage@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11staging: pi433: Comply with 80 character column limitSophie Matter3-8/+21
Lines have been split where it makes sense to shorten them in order to comply with the coding standards and fix checkpatch.pl warnings. There are still lines left that are too long, however breaking those would impair readability. Changes in v2: - now working on staging-next branch of the staging tree - the changes to the defines previously made are deleted due to readability Signed-off-by: Sophie Matter <sophie.matter@web.de> Signed-off-by: Rico Schrage <rico.schrage@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: pi433: cleanup comments in rf69.hValentin Vidic1-4/+5
Fixes checkpatch warning: WARNING: line over 80 characters Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: pi433: add SPDX-License-Identifier tagValentin Vidic6-4/+10
Use GPL-2.0+ based on the license text in each of the files. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: pi433: replace simple switch statementsValentin Vidic1-140/+93
Use const array to map switch cases to resulting values. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Reviewed-by: Marcus Wolf <Marcus.Wolf@Wolf-Entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: pi433: fix race condition in pi433_openHugo Lefeuvre1-29/+12
The device structure contains a useless non-atomic users counter which is subject to race conditions. It has probably been created to handle the case where remove is executed while operations are still executing on open fds but this will never happen because of reference counts. Drop the users counter and move rx buffer {de,}allocation to probe() and remove(). Remove associated dead code from open() and release(). Remove related TODO entry from ioctl(). Signed-off-by: Hugo Lefeuvre <hle@owl.eu.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: pi433: fix race condition in pi433_ioctlHugo Lefeuvre1-2/+5
In the PI433_IOC_WR_TX_CFG case in pi433_ioctl, instance->tx_cfg is modified via copy_from_user(&instance->tx_cfg, argp, sizeof(struct pi433_tx_cfg))) without any kind of synchronization. In the case where two threads would execute this same command concurrently the tx_cfg field might enter in an inconsistent state. Additionally: if ioctl(PI433_IOC_WR_TX_CFG) and write() execute concurrently the tx config might be modified while it is being copied to the fifo, resulting in potential data corruption. Fix: Get instance->tx_cfg_lock before modifying tx config in the PI433_IOC_WR_TX_CFG case in pi433_ioctl. Also, do not copy data directly from user space to instance->tx_cfg. Instead use a temporary buffer allowing future checks for correctness of copied data and simpler code. Signed-off-by: Hugo Lefeuvre <hle@owl.eu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: pi433: break long lines in pi433_if.cSimon Sandström1-4/+12
Breaks long lines in pi433_if.c, fixing checkpatch.pl warnings: "WARNING: line over 80 characters" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: Fixed typos and grammar in documentationShannon Booth2-8/+8
Some typos and grammar issues were found in the documentation. These mistakes were fixed. Signed-off-by: Shannon Booth <shannon.ml.booth@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: use help in Kconfig descriptionValentin Vidic1-1/+1
Fixes checkpatch warning: WARNING: prefer 'help' over '---help---' for new help texts Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: break long lines in rf69.cSimon Sandström1-53/+129
Breaks long lines in rf69.c, fixing checkpatch.pl warnings: "WARNING: line over 80 characters" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: break long linesSimon Sandström1-9/+19
Breaks long lines in rf69.h, fixing checkpatch.pl warnings: "WARNING: line over 80 characters" Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: pi433: cleanup tx_fifo lockingValentin Vidic1-9/+14
pi433_write requires locking due to multiple writers. After acquiring the lock check if enough free space is available in the kfifo to write the whole message. This check should prevent partial writes to tx_fifo so kfifo_reset is not needed anymore. pi433_tx_thread is the only reader so it does not require locking after kfifo_reset is removed. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Reviewed-by: Marcus Wolf <marcus.wolf@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22staging: pi433: cleanup local variableValentin Vidic1-3/+4
Rename temporary local variable and add required blank line. Fixes checkpatch warning: WARNING: Missing a blank line after declarations Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for dagc enumValentin Vidic3-6/+6
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <normalMode> CHECK: Avoid CamelCase: <improve4LowModulationIndex> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for lnaGain enumValentin Vidic5-6/+6
Fixes checkpatch warning: CHECK: Avoid CamelCase: <lnaGain> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for DIONumber variableValentin Vidic2-3/+3
Fixes checkpatch warning: CHECK: Avoid CamelCase: <DIONumber> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for bitRate variablesValentin Vidic2-9/+9
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <bitRate> CHECK: Avoid CamelCase: <bitRate_min> CHECK: Avoid CamelCase: <bitRate_reg> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for syncSize variableValentin Vidic1-3/+3
Fixes checkpatch warning: CHECK: Avoid CamelCase: <syncSize> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for preambleLength variableValentin Vidic2-4/+4
Fixes checkpatch warning: CHECK: Avoid CamelCase: <preambleLength> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: pi433: fix CamelCase for GPIO functionsValentin Vidic1-5/+5
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <setup_GPIOs> CHECK: Avoid CamelCase: <free_GPIOs> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14staging: pi433: Remove comments inside codeHariPrasath Elango1-1/+1
Remove comments inbetween code as in this case. Signed-off-by: HariPrasath Elango <hariprasath.elango@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for paRamp enumValentin Vidic5-6/+6
Fixes checkpatch warning: CHECK: Avoid CamelCase: <paRamp> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for Address variablesValentin Vidic2-6/+6
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <nodeAddress> CHECK: Avoid CamelCase: <broadcastAddress> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for address_filtering enumValentin Vidic4-15/+15
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <filteringOff> CHECK: Avoid CamelCase: <nodeAddress> CHECK: Avoid CamelCase: <nodeOrBroadcastAddress> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for afterSyncInterruptValentin Vidic3-3/+3
Fixes checkpatch warning: CHECK: Avoid CamelCase: <afterSyncInterrupt> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for flag enumValentin Vidic3-20/+20
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <modeSwitchCompleted> CHECK: Avoid CamelCase: <readyToReceive> CHECK: Avoid CamelCase: <readyToSend> CHECK: Avoid CamelCase: <pllLocked> CHECK: Avoid CamelCase: <rssiExceededThreshold> CHECK: Avoid CamelCase: <syncAddressMatch> CHECK: Avoid CamelCase: <packetSent> CHECK: Avoid CamelCase: <crcOk> CHECK: Avoid CamelCase: <batteryLow> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: pi433: fix CamelCase for packetFormat enumValentin Vidic4-12/+12
Fixes checkpatch warnings: CHECK: Avoid CamelCase: <packetFormat> CHECK: Avoid CamelCase: <packetLengthFix> CHECK: Avoid CamelCase: <packetLengthVar> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: pi433: fix CamelCase for addressFilteringValentin Vidic5-7/+7
Fixes checkpatch warning: CHECK: Avoid CamelCase: <addressFiltering> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: pi433: fix CamelCase for thresholdDecrementValentin Vidic5-6/+6
Fixes checkpatch warning: CHECK: Avoid CamelCase: <thresholdDecrement> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22staging: pi433: fix CamelCase for txStartConditionValentin Vidic4-5/+5
Fixes checkpatch warning: CHECK: Avoid CamelCase: <txStartCondition> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-20staging: pi433: Split subtraction across 2 linesEisha Chen-yen-su1-1/+2
Split a subtraction across 2 lines in order to make these lines no longer than 80 columns. Problem found with checkpatch. Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-20staging: pi433: Split some function callsEisha Chen-yen-su1-15/+30
Split some function calls on several lines in order to make these lines no longer than 80 columns. Problem found with checkpatch. Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16staging: pi433: fix CamelCase for regValueValentin Vidic1-12/+12
Local variable storing the new value for dio register so replace with dio_value. Update regaddr to dio_addr to match. Fixes checkpatch warnings: CHECK: Avoid CamelCase: <regValue> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16staging: pi433: fix CamelCase for newValueValentin Vidic1-8/+8
Local variable storing the new value for bandwidth register so replace with bandwidth. Fixes checkpatch warnings: CHECK: Avoid CamelCase: <newValue> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16staging: pi433: fix CamelCase for currentValueValentin Vidic1-3/+3
Local variable storing the value for modulation register so replace with modulation_reg. Fixes checkpatch warnings: CHECK: Avoid CamelCase: <currentValue> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>