aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgap
AgeCommit message (Collapse)Author
2014-11-26Drivers:staging:dgap: Added a blank line after declarationAnjana Sasindran
This patch fixes the checkpatch.pl warning: WARNING:Missing a blank line after declaration Signed-off-by: Anjana Sasindran <anjanasasindran123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07staging: dgap: introducing find_board_by_major()Daeseok Youn
use find_board_by_major function instead of getting a brd from static arrary. Becasue tty's major number doesn't start zero and we can find a brd from dgap_board[]. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07staging: dgap: remove useless variables for saving tty's majorDaeseok Youn
The board_t has a tty_struct(serial_driver and print_driver) that has a major number. When major number is compared in dgap_tty_open(), just use brd->serial_driver{print_driver}->major. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07staging: dgap: fix memory leak caused by double allocation of tty_structsDaeseok Youn
The tty_struct of serial_driver and print_driver were getting allocated twice. One is allocated in tty_alloc_driver(), the other is in dgap_tty_register(). So remove these in dgap_tty_register(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07staging: dgap: set tty's flags by tty_alloc_driver()Daeseok Youn
tty's flags can be set by calling tty_alloc_driver(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05staging: dgap: remove unnecessary functionDaeseok Youn
The dgap_init_global() initialize the dgap_board that is a global variable as static and dgap_poll_timer. But init_timer() is called twice in dgap_start() and dgap_board doesn't need to be initialized to NULL. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03staging: dgap: re-arrange functions for removing forward declarationsDaeseok Youn
Re-arrange the functions for removing forward declarations. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30staging: dgap: Remove useless cast on NULLTapasweni Pathak
Cast on NULL to a pointer type is not required. This patch removes NULL casted to some pointer type. The sematic patch used is: @r@ type T; @@ - (T *)NULL + NULL Build tested it. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30staging: dgap: Remove useless cast on void pointerTapasweni Pathak
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Build tested it. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28staging: dgap: Use unsigned for loop indexTapasweni Pathak
The following semantic patch is used to do this @r exists@ // find anything that might decrement the variable identifier i; expression E; position p; @@ int i@p; ... ( &i | i-- | --i | i-=E | i+=E ) @x disable decl_init@ identifier r.i; expression E; position p1 != r.p; @@ ( volatile int i = 0; | volatile int i; | + unsigned int i@p1 = 0; | + unsigned int i@p1; ) <... when != i = E ( i = 0 | i = 1 ) ...> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: dgap: introduce dgap_stop()Daeseok Youn
The dgap_init_module() need to unwind for cleanup variables properly. Because dgap_init_module() calls dgap_cleanup_module() for freeing variables but this function is possible to free variables which are not allocated. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: dgap: change function names properlyDaeseok Youn
dgap_do_remap() and dgap_release_remap() names could be changed to dgap_remap() and dgap_unmap(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: dgap: remove unnecessary if statement for checking NULLDaeseok Youn
dgap_release_remap() function is only called after the memory has been remapped so if statement for checking NULL doesn't need. And also release_mem_region() calls are moved after iounmap() calls. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: dgap: remove unused variable 'orig_count'Rahul Bedarkar
This patch fixes sparse warning warning: variable ‘orig_count’ set but not used [-Wunused-but-set-variable] Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: dgap: use dgap_release_remap() in dgap_cleanup_board()Daeseok Youn
Just simply use dgap_release_remap() in dgap_cleanup_board() for releasing map memory. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: dgap: adds missing iounmap for re_map_port in dgap_release_remap()Daeseok Youn
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: dgap: remove unused 'runwait' variableDaeseok Youn
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: dgap: use schedule_timeout_interruptible() instead of dgap_ms_sleep()Daeseok Youn
Using schedule_timeout_interruptible() is exactly same as setting a status of current process and calling schedule_timeout(). Removes dgap_ms_sleep(), because this function is used only when closing tty channel on dgap_tty_close(). And also removes ch_close_delay that is always set to 250 on dgap_tty_init(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06drivers: staging: dgap: fix the checkpatch.pl issue "Warning: line over 80 ↵Piotr Witoslawski
characters" Break lines exceeding 80 characters Signed-off-by: Piotr Witoslawski <pwitos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: dgap: remove useless a variable within board_tDaeseok Youn
The use_interrupts is used only in dagp_request_irq() for checking a value from user config file. It doesn't need in board_t struct. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: dgap: remove redundant setting a variableDaeseok Youn
The brd(board_t) is initialized with zero, so "intr_used" is not needed to set zero when request_irq() is failed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: cleanup print messages for dgap driverDaeseok Youn
* use dev_{warn,err} instead of pr_{warn,err} * removes dgap_err() and just use pr_err(). pr_err() used in dgap_parsefile() not dev_err() because if dgap_parsefile() is failed, just one message is printed. * removes "out of memory" messages. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: Simplify to set a module typeDaeseok Youn
It is same manner with setting a board type. After allocating a type of "MNODE", get a token value set to "module.type". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: Simplify to set a concentrator typeDaeseok Youn
It is same manner with setting a board type. For example of config file for concentrator, "conc ccon" or "conc epcon" After allocating a type of "CNODE" then set a type of concentrator. So remove cases in swith statement, just get a token from string and set to "conc.type". And also it doesn't need to "conc.v_type". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: Simplify set a board type from configration fileDaeseok Youn
Board types need to separate normal command like IO, MEM and so on. And the board type will come after "board" string in config file normally. (If it is not, dgap_gettok returns an error with zero) After that, set a variable of a number which is matched with specific a board number to "board.type". The dgap_gettok() returns that number so just set to "board.type" and also "v_type" can be removed. In case of boards of PCI type are set variables to zero. These can be removed because "p" as cnode get memory from kzalloc so already set to zero. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: cleanup duplicated warning message on dgap_tty_init()Daeseok Youn
If true_count is not same with brd->nasync, warning messages are printed. But it has duplicated messages within if statement. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: remove redundant declarations.Daeseok Youn
These are already defined in dgap.h. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: remove useless variableDaeseok Youn
dgap_major_serial_registered and dgap_major_transparent_print_registered could be checked whether a board is initialized. But it doesn't need to check that variables becasue dgap module isn't calling the dgap_cleanup_tty() without initializing for a board completely. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: dgap: introduce dgap_cleanup_nodes()Daeseok Youn
When a configration file is parsed with dgap_parsefile(), makes nodes for saving configrations for board. Making a node will allocate node memory and strings for saving configrations with kstrdup(). So these are freed when dgap is unloaded or failed to initialize. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: dgap: remove dgap_newnode()Daeseok Youn
The dgap_newnode() is useless for creating new node. So just use kzalloc and set a type in case statement. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: dgap: remove unused a parameter in dgap_gettok()Daeseok Youn
The "p" as parameter is unused. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: dgap: fix a typo in dgap_gettok()Daeseok Youn
The "boar" should be "board". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: dgap: remove unused case value in dgap_parsefile()Daeseok Youn
If rc is zero, this function will returns with an error and cannot reach switch-case statement. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: dgap: remove redundant error value checkDaeseok Youn
The retval in dgap_block_til_ready() is initialized to zero, and if no error has occurred in this function, the retval has a zero. So it doesn't need to check "retval" itself. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_tty_digisetcustombaud() Null checks in dgap_tty_digisetcustombaud() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch", "bd and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_tty_digigetcustombaud() Null checks in dgap_tty_digigetcustombaud() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch" and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_tty_digisetedelay() Null checks in dgap_tty_digisetedelay() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch", "bd and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_set_modem_info() Null checks in dgap_set_modem_info() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch", "bd" and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_tty_digigeta() Null checks in dgap_tty_digigeta() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch" and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_tty_digiseta() Null checks in dgap_tty_digiseta() are already done by dgap_tty_ioctl() and change "tty" as a paramter of this function to "ch" and "bd" which are used in dgap_tty_digiseta(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: removes redundant null check and change the paramter for ↵Daeseok Youn
dgap_param() The dgap_param() has a paramter which is tty_struct and use variables in that struct. That variables which are "ch", "bd", "bs" and "un" do not need to check NULL so these statements are removed. And also change the parameter of this function because it is possible to let someone know what paramters are needed for this function. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: remove unused variable in dgap_param()Daeseok Youn
The "ts" is not used in dgap_param(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: dgap: redundant NULL and magic check in dgap_get_modem_info()Daeseok Youn
The "ch" is already checking in caller. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn
dgap_maxcps_room() Null checks for tty, un and ch are already done by caller, so replace parameter "tty" with "ch" and "un". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: remove redundant NULL check in dgap_tty_init()Daeseok Youn
The brd is already checked by earlier function in dgap_init_one(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: use kzalloc instead of kmalloc/memsetDaeseok Youn
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: remove unused waitqueuesDaeseok Youn
dgap_dl_wait and kme_wait are not used in dgap. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: remove unneccessary dgap_init_pci() functionDaeseok Youn
The dgap_init_pci() calls only pci_register_driver(). It doesn't need to make a function for that. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: Adds a blank line after declarationDaeseok Youn
clean up checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09staging: dgap: remove "return" statement in void functionDaeseok Youn
clean up checkpatch warning: WARNING: void function return statements are not generally useful Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>