summaryrefslogtreecommitdiffstats
path: root/drivers/staging/pi433/pi433_if.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: pi433: break long lines in pi433_if.cSimon Sandström2018-04-251-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>
* staging: pi433: cleanup tx_fifo lockingValentin Vidic2018-04-231-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>
* staging: pi433: cleanup local variableValentin Vidic2018-03-221-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>
* staging: pi433: fix CamelCase for GPIO functionsValentin Vidic2018-03-191-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>
* staging: pi433: Remove comments inside codeHariPrasath Elango2018-03-141-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>
* staging: pi433: fix CamelCase for address_filtering enumValentin Vidic2018-03-061-3/+3
| | | | | | | | | | | 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>
* staging: pi433: fix CamelCase for afterSyncInterruptValentin Vidic2018-03-061-1/+1
| | | | | | | | | 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>
* staging: pi433: fix CamelCase for flag enumValentin Vidic2018-03-061-2/+2
| | | | | | | | | | | | | | | | | 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>
* staging: pi433: fix CamelCase for packetFormat enumValentin Vidic2018-03-061-4/+4
| | | | | | | | | | | 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>
* staging: pi433: fix CamelCase for addressFilteringValentin Vidic2018-02-221-2/+2
| | | | | | | | | 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>
* staging: pi433: Split subtraction across 2 linesEisha Chen-yen-su2018-02-201-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>
* staging: pi433: Split some function callsEisha Chen-yen-su2018-02-201-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>
* staging: pi433: fix CamelCase for Ohm identifiersValentin Vidic2018-02-161-1/+1
| | | | | | | | | | Fixes checkpatch warnings: CHECK: Avoid CamelCase: <fiftyOhm> CHECK: Avoid CamelCase: <twohundretOhm> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: align function parameters with open parenthesisValentin Vidic2018-01-091-5/+5
| | | | | | | | | Fixes checkpatch warnings: CHECK: Alignment should match open parenthesis Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: replace shifting with BIT macroValentin Vidic2018-01-091-1/+1
| | | | | | | | | Fixes checkpatch warnings: CHECK: Prefer using the BIT macro Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: pi433 - fix ccheckpatch issue, updated include line.Derek Robson2018-01-081-1/+1
| | | | | | | Updated the include of compat.h to fix checkpatch error Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: fix CamelCase for payload identifiersValentin Vidic2018-01-081-1/+1
| | | | | | | | | | Fixes checkpatch warnings: CHECK: Avoid CamelCase: <payloadLength> CHECK: Avoid CamelCase: <payloadReady> Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: pi433_write fixed the return valueOliver Graute2017-12-211-1/+1
| | | | | | | | The pi433_write function should return the number of processed bytes Reported-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: replace printk calls with dev_dbgValentin Vidic2017-12-191-2/+2
| | | | | | | | | Fixes checkpatch warning: WARNING: printk() should include KERN_<LEVEL> facility level Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: avoid logging ENOMEM messagesValentin Vidic2017-12-191-3/+1
| | | | | | | | | Fixes checkpatch warning: WARNING: Possible unnecessary 'out of memory' message Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: replace unsigned with unsigned intValentin Vidic2017-12-191-1/+1
| | | | | | | | | Fixes checkpatch warning: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: collapse else block after return statementValentin Vidic2017-12-191-7/+7
| | | | | | | | | Fixes checkpatch warning: WARNING: else is not generally useful after a break or return Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: Pi433: Bugfix for wrong argument for sizeof() in TX threadMarcus Wolf2017-12-191-7/+6
| | | | | | | | | sizeof(array) != sizeof(pointer to array) Fixes: "staging: pi433: reduce stack size in tx thread" Fixes: 62f39d49d168 ("staging: pi433: reduce stack size in tx thread") Signed-off-by: Marcus Wolf <linux@wolf-entwicklungen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove multiple blank linesValentin Vidic2017-12-191-11/+0
| | | | | | | Fixes checkpatch warning for multiple blank lines in source. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove comparison with trueValentin Vidic2017-12-131-1/+1
| | | | | | | Fixes checkpatch warning for error prone comparison. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove comparison with falseValentin Vidic2017-12-131-1/+1
| | | | | | | Fixes checkpatch warning for error prone comparison. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: add blank line after functionValentin Vidic2017-12-131-0/+1
| | | | | | | | Fixes checkpatch warning for blank line after function/struct/union/enum declarations. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: rewrite comparison with NULLValentin Vidic2017-12-131-2/+2
| | | | | | | Fixes checkpatch warning for comparing value with NULL. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove return from a void functionValentin Vidic2017-12-131-1/+0
| | | | | | | Fixes checkpatch warning for void function return statements. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove spaces before tabsValentin Vidic2017-12-131-1/+1
| | | | | | | Fixes checkpatch warning for hidden spaces before tabs. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: move trailing statements to next lineValentin Vidic2017-12-131-14/+31
| | | | | | | Fixes checkpatch error for trailing if statements. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: use tabs for code indentValentin Vidic2017-12-131-4/+4
| | | | | | | Fixes checkpatch error for whitespace idents. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: use consistent brace styleValentin Vidic2017-12-131-88/+41
| | | | | | | Fixes checkpatch error for open/close braces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: remove space inside parenthesisValentin Vidic2017-12-131-17/+17
| | | | | | | Fixes checkpatch error for prohibited spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: add space around operatorsValentin Vidic2017-12-131-5/+4
| | | | | | | Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: add space after commaValentin Vidic2017-12-131-2/+2
| | | | | | | Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: add space before open parenthesisValentin Vidic2017-12-131-2/+2
| | | | | | | Fixes checkpatch error for missing spaces. Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: pi433_if.c remove SET_CHECKED macroNguyen Phan Quang Minh2017-12-081-54/+139
| | | | | | | | | | The macro calls its argument -a function- twice, makes the calling function return prematurely -skipping resource cleanup code- and hurts understandability. Signed-off-by: Nguyen Phan Quang Minh <minhnpq16@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Remove SET_CHECKED usage from pi433_probeSimon Sandström2017-12-061-7/+21
| | | | | | | | SET_CHECKED returns from the function on failure and in pi433_probe it is necessary to free the GPIOs and the device on failure. Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Combine all rf69_set_amplifier_x()Simon Sandström2017-12-061-3/+3
| | | | | | | | | Replaces the functions rf69_set_amplifier_1, _2, _3 with two functions: rf69_enable_amplifier(dev, amp_mask) and rf69_disable_amplifier(dev, amp_mask). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Remove enum data_modeSimon Sandström2017-12-061-1/+1
| | | | | | | Call rf69_set_data_mode with DATAMODUL_MODE value directly. Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Split rf69_set_sync_enabled into two functionsSimon Sandström2017-12-061-2/+19
| | | | | | | | Splits rf69_set_sync_enabled(dev, enabled) into rf69_enable_sync(dev) and rf69_disable_sync(dev). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Split rf69_set_crc_enabled into two functionsSimon Sandström2017-12-061-2/+20
| | | | | | | | Splits rf69_set_crc_enabled(dev, enabled) into rf69_enable_crc(dev) and rf69_disable_crc(dev). Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Rename enum modShaping in rf69_enum.hSimon Sandström2017-12-061-1/+1
| | | | | | | | Renames enum modShaping and its values to get rid of checkpatch.pl warnings: "Avoid CamelCase: <modShaping>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Rename enum optionOnOff in rf69_enum.hSimon Sandström2017-12-061-17/+17
| | | | | | | | | Renames the enum optionOnOff and its values optionOn, optionOff to enum option_on_off and OPTION_ON, OPTION_OFF. Fixes checkpatch.pl warnings: "Avoid CamelCase: <optionOnOff>, <optionOn>, <optionOff>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Rename variable in struct pi433_rx_cfgSimon Sandström2017-12-061-1/+1
| | | | | | | | | Renames variable thresholdDecrement in struct pi433_rx_cfg to threshold_decrement to get rid of checkpatch.pl warning "Avoid CamelCase: <thresholdDecrement>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: Capitalize constant definitionsSimon Sandström2017-12-061-16/+16
| | | | | | | Fixes checkpatch.pl warnings "Avoid CamelCase <DIO_x>". Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: pi433_if.c codestyle fixOliver Graute2017-11-281-3/+2
| | | | | | | | | | | | | | | This patch fixes the following checkpatch.pl error: ERROR: spaces required around that '>=' (ctx:VxV) #930: FILE: pi433_if.c:930: + for (i--; i>=0; i--) ERROR: spaces required around that '=' (ctx:VxV) #970: FILE: pi433_if.c:970: + for (i=0; i<NUM_DIO; i++) Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: pi433_if.c fix codestyle on two long linesOliver Graute2017-11-281-2/+4
| | | | | | | | | | | | | | | This patch fixes the following checkpatch.pl warning: WARNING: line over 80 characters #1233: FILE: pi433_if.c:1233: + unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name); WARNING: line over 80 characters #1240: FILE: pi433_if.c:1240: + unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name); Signed-off-by: Oliver Graute <oliver.graute@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: pi433: fix naming when more than one radio is usedMarcin Ciupak2017-11-281-2/+4
| | | | | | | | | When using more than one hardware radio module pi433_probe fails as the same name is used for all modules. Create unique name by adding minor number to the device name. Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud