summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc
Commit message (Collapse)AuthorAgeFilesLines
* staging: dgnc: Fix lines longer than 80 charactersFernando Apesteguia2016-10-021-21/+46
| | | | | | | All the chunks of the patch apply to comments save the first one. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: dgnc: constify attribute_group structuresBhumika Goyal2016-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for attribute_group structures that are only passed as a second argument to the functions sysfs_remove_group and sysfs_create_group. As these arguments are constant so, attribute_group structures having this property can also be made constant. Done using coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct attribute_group i@p = {...}; @ok1@ identifier r1.i; position p; expression e1; @@ ( sysfs_remove_group(e1,&i@p) | sysfs_create_group(e1,&i@p) ) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct attribute_group i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct attribute_group i; File size before: text data bss dec hex filename 6248 1024 0 7272 1c68 drivers/staging/dgnc/dgnc_sysfs.o File size after: text data bss dec hex filename 6288 960 0 7248 1c50 drivers/staging/dgnc/dgnc_sysfs.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: introduce find_board_by_major()Daeseok Youn2016-09-271-6/+19
| | | | | | | | | | It was used to get a board structure with dgnc_BoardsByMajor array. But this driver already has the array for managing initialized board as dgap_board[]. It can be used for searching the board structure by major number. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variablesDaeseok Youn2016-09-272-42/+25
| | | | | | | | | | | The dgnc_major_serial_registered and dgnc_major_serial_registered do not need to use to check whether the tty driver is registered or not. These variables are used only in dgnc_cleanup_tty() function, This function will be called normally with initialized board structure. It means the dgnc_cleanup_tty() cannot be called with unregistered tty. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: rename dgnc_tty_uninit() to dgnc_cleanup_tty()Daeseok Youn2016-09-273-4/+4
| | | | | | | | The dgnc_tty_uninit() doesn't match with dgnc_tty_init() at all. And also the dgnc_cleanup_tty() is only called for exiting the module. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: introduce the dgnc_free_irq()Daeseok Youn2016-09-271-1/+10
| | | | | | | | The dgnc_free_irq() will free the requested IRQ from the dgnc_request_irq(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: rename dgnc_finalize_board_init() to dgnc_request_irq()Daeseok Youn2016-09-271-3/+3
| | | | | | | | The dgnc_finalize_board_init() function has only job for requesting the IRQ. It should be renamed to dgnc_request_irq() Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: introduce the dgnc_tty_unregister()Daeseok Youn2016-09-273-2/+14
| | | | | | | | The dgnc_tty_unregister() will be called when the dgnc_tty_register() is failed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: move functions unrelated with dgnc_found_board()Daeseok Youn2016-09-271-38/+43
| | | | | | | | The functions related with tty device initialization are needed to be moved from dgnc_found_board() to dgnc_init_one(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: kfree for board structure in dgnc_found_board()Daeseok Youn2016-09-271-8/+9
| | | | | | | | | The board structure should be freed when any function was failed in dgnc_found_board(). And the board strucure will be stored into dgnc_board array when the dgnc_found_board() function has no error. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: missing NULL check for ioremap in dgnc_do_remap()Daeseok Youn2016-09-271-10/+21
| | | | | | | | | The ioremap() function can be failed, so it need to have error handling in dgnc_do_remap(). And also the return type of dgnc_do_remap() should be changed from "void" to "int" Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless message bufferDaeseok Youn2016-09-272-34/+0
| | | | | | | | | There is a temporary message buffer for the boot message in dgnc_found_board() but the buffer was not used anywhere in dgnc driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant initialization for channel arrayDaeseok Youn2016-09-271-3/+0
| | | | | | | | | The channel array in board_t was initialized in dgnc_found_board() with NULL. But the channel is going to initialize in dgnc_tty_init(). So the channel array doesn't need to set NULL for initailization. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Fix comment alignmentFernando Apesteguia2016-09-251-1/+1
| | | | | | | As reported by checkpatch. Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Merge assignment with returnRehas Sachdeva2016-09-201-7/+5
| | | | | | | | | | | | | | | | | | | Instead of storing the return value of a function call into a variable and then returning it, we can club the two into a single return statement. This change was made using the following semantic patch by Coccinelle: @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: dgnc: dgnc_tty: fixed a line too long style issueCathal Mullaney2016-09-171-1/+2
| | | | | | | Fixed a coding style issue. Signed-off-by: Cathal Mullaney <chuckleberryfinn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Fix long line and spelling mistakeRehas Sachdeva2016-09-161-6/+18
| | | | | | | | This patch fixes the checkpatch.pl warning: Line over 80 characters. Also, the word 'because' was spelled as 'Becuz' and has been corrected. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Fix lines over 80 charactersRehas Sachdeva2016-09-161-7/+18
| | | | | | | | This patch fixes the checkpatch.pl warning: Line over 80 characters. Signed-off-by: Rehas Sachdeva <aquannie@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: dgnc_sysfs *_ATTR() macros convertMatias Mucciolo2016-09-121-93/+90
| | | | | | | | Convert DRIVER_ATTR() macro with DRIVER_ATTR_RO/RW and DEVICE_ATTR() macro with DEVICE_ATTR_RO() Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: Fix multi line comment alignmentFernando Apesteguia2016-09-121-25/+25
| | | | | | | | | Fix alignment in multi line comment block. Remove extra '*' to use the preferred comment style as in Documentation/CodingStyle Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: check the type of print before callingDaeseok Youn2016-09-011-13/+5
| | | | | | | | | | The dgnc_maxcps_room() function must be called only for print device. The if-statement for checking print device checks before calling dgnc_maxcps_room() and also this function doesn't need to have any data except channel_t. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: fix 'line over 80 characters'Anson Jacob2016-08-211-1/+1
| | | | | | | fix checkpatch.pl warning about 'line over 80 characters'. Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'ch_intr_rx'Daeseok Youn2016-08-153-5/+0
| | | | | | | | The 'ch_intr_rx' variable was used only for increasing. So the 'ch_intr_rx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'ch_intr_tx'Daeseok Youn2016-08-153-5/+0
| | | | | | | | The 'ch_intr_tx' variable was used only for increasing. So the 'ch_intr_tx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'ch_intr_modem'Daeseok Youn2016-08-153-11/+0
| | | | | | | | The 'ch_intr_modem' variable was used only for increasing. So the 'ch_intr_modem' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'intr_rx'Daeseok Youn2016-08-153-4/+0
| | | | | | | | The 'intr_rx' variable was used only for increasing. So the 'intr_rx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'intr_tx'Daeseok Youn2016-08-153-5/+0
| | | | | | | | The 'intr_tx' variable was used only for increasing. So the 'intr_tx' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove unused variable 'intr_modem'Daeseok Youn2016-08-153-3/+0
| | | | | | | | The 'intr_modem' variable was used only for increasing. So the 'intr_modem' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant null check inDaeseok Youn2016-08-151-3/+0
| | | | | | | | | | | | the "brd" was already checked for NULL before calling dgnc_do_remap(). the dgnc_do_remap() function was called only from the dgnc_found_board() and the DGNC_BOARD_MAGIC value was assigned to "brd->magic" in dgcn_found_board(). So it doesn't need to check about magic value. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless variable 'intr_count'Daeseok Youn2016-08-153-5/+0
| | | | | | | | The 'intr_count' variable was used only for increasing. So the 'intr_count' variable is not useful for this driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant NULL check for brdDaeseok Youn2016-08-151-3/+0
| | | | | | | | | | | | | | the "brd" value cannot be NULL in dgnc_finalize_board_init(). Because "brd" as a parameter of this function was already checked for NULL. the dgnc_finalize_board_init() as a static function was called only from dgnc_found_board() function and brd->magic value was assigned once in dgnc_found_board(). So it doesn't need to check for DGNC_BOARD_MAGIC value. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: re-arrange functions for removingDaeseok Youn2016-08-151-330/+301
| | | | | | | Re-arrange the functions for removing forward declarations in dgnc_cls.c file. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: removes redundant null check and changeDaeseok Youn2016-08-151-21/+3
| | | | | | | | | | | The dgnc_set_modem_info() used only channel_t variable. Any other variables were used only for checking NULL. So fist parameter changed from "tty_struct" to "channel_t" and useless NULL checks and variables are removed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant variable null checkDaeseok Youn2016-08-151-6/+0
| | | | | | | The unit struct(un_t) was not used in dgnc_tty_hangup(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant local variable forDaeseok Youn2016-08-151-7/+0
| | | | | | | The local variable "bd" was not used in dgnc_carrier() function. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove useless error value assignmentDaeseok Youn2016-08-151-3/+1
| | | | | | | | | | The "result" variable in dgnc_get_mstat() was initialized with "-EIO". But if the "ch" is not null, "result" will be set to zero and if the "ch" is null, dgnc_get_mstat() will return "-ENXIO" as an error. So "-EIO" error value was useless in dgnc_get_mstat(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: remove redundant NULL checks inDaeseok Youn2016-08-151-7/+2
| | | | | | | | | | The dgnc_block_til_ready() is only used in dgnc_tty_open(). The unit data(struct un_t) was stored into tty->driver_data in dgnc_tty_open(). And also tty and un were tested about NULL so these variables doesn't need to check for NULL in dgnc_block_til_ready(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgnc: add __exit macro to dgnc_driver.cJoshua Houghton2016-08-151-1/+1
| | | | | | | | Add the __exit macro to the dgnc_cleanup_module(void) function in dgnc_driver.c Signed-off-by: Joshua Houghton <josh@awful.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'staging-4.7-rc1' of ↵Linus Torvalds2016-05-208-293/+246
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO driver updates from Greg KH: "Here's the big staging and iio driver update for 4.7-rc1. I think we almost broke even with this release, only adding a few more lines than we removed, which isn't bad overall given that there's a bunch of new iio drivers added. The Lustre developers seem to have woken up from their sleep and have been doing a great job in cleaning up the code and pruning unused or old cruft, the filesystem is almost readable :) Other than that, just a lot of basic coding style cleanups in the churn. All have been in linux-next for a while with no reported issues" * tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits) Staging: emxx_udc: emxx_udc: fixed coding style issue staging/gdm724x: fix "alignment should match open parenthesis" issues staging/gdm724x: Fix avoid CamelCase staging: unisys: rename misleading var ii with frag staging: unisys: visorhba: switch success handling to error handling staging: unisys: visorhba: main path needs to flow down the left margin staging: unisys: visorinput: handle_locking_key() simplifications staging: unisys: visorhba: fail gracefully for thread creation failures staging: unisys: visornic: comment restructuring and removing bad diction staging: unisys: fix format string %Lx to %llx for u64 staging: unisys: remove unused struct members staging: unisys: visorchannel: correct variable misspelling staging: unisys: visorhba: replace functionlike macro with function staging: dgnc: Need to check for NULL of ch staging: dgnc: remove redundant condition check staging: dgnc: fix 'line over 80 characters' staging: dgnc: clean up the dgnc_get_modem_info() staging: lustre: lnet: enable configuration per NI interface staging: lustre: o2iblnd: properly set ibr_why staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini ...
| * staging: dgnc: Need to check for NULL of chDaeseok Youn2016-05-091-1/+1
| | | | | | | | | | | | | | | | the "ch" from brd structure could be NULL, it need to check for NULL. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: remove redundant condition checkDaeseok Youn2016-05-091-6/+0
| | | | | | | | | | | | | | | | dgnc_board(brd) was already checked for NULL before calling neo_parse_isr(). And also port doesn't need to check. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: fix 'line over 80 characters'Daeseok Youn2016-05-091-9/+11
| | | | | | | | | | | | | | fix checkpatch.pl warning about 'line over 80 characters'. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: clean up the dgnc_get_modem_info()Daeseok Youn2016-05-091-11/+1
| | | | | | | | | | | | | | | | | | the "ch" in dgnc_get_modem_info() was already checked before calling this function and also if "ch" is not NULL, dgnc_get_mstat() returns valid value so it doesn't need to check an error. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: Fix a NULL pointer dereferenceDaeseok Youn2016-05-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | The error handling for print_drive after calling tty_alloc_driver() was needed. But there was error handling but too late for this. Error handling code moved after tty_alloc_driver() call. Fixes: 60b3109e5e2d ("staging: dgnc: use tty_alloc_driver instead of kcalloc") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: use tty_alloc_driver instead of kcallocDaeseok Youn2016-04-292-86/+62
| | | | | | | | | | | | | | | | | | The tty_alloc_driver() can allocate memory for ttys and termios. And also allocated memory will be released easily with put_tty_driver() call. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: remove redundant NULL check inDaeseok Youn2016-04-291-13/+2
| | | | | | | | | | | | | | | | There were already checking NULL about channel_t / un_t before calling dgnc_maxcps_room(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: return -ENOMEM when kzalloc failedDaeseok Youn2016-04-291-0/+8
| | | | | | | | | | | | | | | | | | The kzalloc can be failed when memory is not enough to allocate. When kzalloc failed, it need to return error code with ENOMEM Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: remove blank lineDaeseok Youn2016-04-291-1/+0
| | | | | | | | | | | | | | | | fix checkpatch.pl warning: Blank lines aren't necessary after an open brace '{' Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: dgnc: remove parenthesis around the CONST |Daeseok Youn2016-04-291-1/+1
| | | | | | | | | | | | | | remove parenthesis around the CONST | CONST. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * drivers/staging/dgnc: Added spaces around a bitwise OR.Juanma de Hoyos2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | Coding rules request placing bitwise OR operators between empty spaces for better readibility. This patch applies this format to a line in dgnc_tty.c file. Signed-off-by: Juanma de Hoyos <juanmahv@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud