summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgap
Commit message (Collapse)AuthorAgeFilesLines
* staging: dgap: remove dgap_newnode()Daeseok Youn2014-07-151-30/+74
| | | | | | | | 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>
* staging: dgap: remove unused a parameter in dgap_gettok()Daeseok Youn2014-07-151-4/+4
| | | | | | | The "p" as parameter is unused. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: fix a typo in dgap_gettok()Daeseok Youn2014-07-151-1/+1
| | | | | | | The "boar" should be "board". Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove unused case value in dgap_parsefile()Daeseok Youn2014-07-151-4/+0Star
| | | | | | | | 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>
* staging: dgap: remove redundant error value checkDaeseok Youn2014-07-151-4/+1Star
| | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-24/+5Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-18/+5Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-21/+5Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-28/+8Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-18/+5Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-121-23/+5Star
| | | | | | | | | | | 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>
* staging: dgap: removes redundant null check and change the paramter for ↵Daeseok Youn2014-07-121-36/+13Star
| | | | | | | | | | | | | | | 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>
* staging: dgap: remove unused variable in dgap_param()Daeseok Youn2014-07-121-3/+0Star
| | | | | | | 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>
* staging: dgap: redundant NULL and magic check in dgap_get_modem_info()Daeseok Youn2014-07-121-3/+0Star
| | | | | | | 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>
* staging: dgap: removes redundant null check and change paramter for ↵Daeseok Youn2014-07-101-17/+4Star
| | | | | | | | | | 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>
* staging: dgap: remove redundant NULL check in dgap_tty_init()Daeseok Youn2014-07-091-3/+0Star
| | | | | | | 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>
* staging: dgap: use kzalloc instead of kmalloc/memsetDaeseok Youn2014-07-091-4/+2Star
| | | | | Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove unused waitqueuesDaeseok Youn2014-07-092-9/+0Star
| | | | | | | 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>
* staging: dgap: remove unneccessary dgap_init_pci() functionDaeseok Youn2014-07-091-10/+1Star
| | | | | | | | 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>
* staging: dgap: Adds a blank line after declarationDaeseok Youn2014-07-091-0/+3
| | | | | | | | 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>
* staging: dgap: remove "return" statement in void functionDaeseok Youn2014-07-091-2/+0Star
| | | | | | | | 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>
* staging: dgap: fixed "foo* bar should be foo * bar" in dgap.cDaeseok Youn2014-07-091-3/+3
| | | | | | | | clean up checkpatch.pl error: ERROR: "foo* bar" should be "foo *bar" Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: make dgap_found_board() return a brd pointerDaeseok Youn2014-06-201-13/+13
| | | | | | | | | Make dgap_found_board() return a brd pointer and that brd pointer assign to dgap_board[] in the end of the dgap_init_one(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: unwind on error in dgap_init_one()Daeseok Youn2014-06-201-9/+44
| | | | | | | | | | | | | The dgap_init_one() needs to handle error properly if one of functions in dgap_init_one() is failed. Introduce some functions for handling error in dgap_init_one() - dgap_tty_unregister() : unregister tty driver - dgap_free_flipbuf() : free flip buffer - dgap_release_remap() : release memory region and unmapped memory. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: move unrelated functions in dgap_firmware_load()Daeseok Youn2014-06-201-31/+39
| | | | | | | | | The dgap_firmware_load() has a lot of stuff which are unrelated with loading firmware. So just moved to dgap_init_one(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: rename dgap_after_config_loaded() to dgap_alloc_flipbuf()Daeseok Youn2014-06-201-3/+3
| | | | | | | | dgap_after_config_loaded() as function name doesn't tell what it does. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: introduce dgap_free_irq()Daeseok Youn2014-06-201-2/+8
| | | | | | | | dgap_free_irq() will free the irq which is requested in dgap_request_irq(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: introduce dgap_tty_free() for freeing channels.Daeseok Youn2014-06-201-1/+16
| | | | | | | | It should be called after dgap_tty_register_ports() is failed. So channels which are allocated in dgap_tty_init() will be freed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: get rid of brd->firstminor because it is 0Daeseok Youn2014-06-202-6/+4Star
| | | | | | | | firstminor in struct borad_t is always zero, so it can be removed. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove unused paramter in dgap_parsefile()Daeseok Youn2014-06-201-3/+3
| | | | | | | "remove" parameter is not used in dgap_parsefile(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: rename dgap_tty_uninit() to dgap_cleanup_tty()Daeseok Youn2014-06-201-4/+4
| | | | | | | | | - dgap_tty_uninit() doesn't match dgap_tty_init() at all. so rename it. It is just used for cleanup when this module is exited or failed to initialize by dgap_init_module. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: rename dgap_finalize_board_init() to dgap_request_irq()Daeseok Youn2014-06-201-3/+3
| | | | | Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: pass "brd" as a paramter to dgap_after_config_loaded()Daeseok Youn2014-06-201-9/+9
| | | | | | | | Pass "brd" to dgap_after_config_loaded() instead of passing "dgap_numboards" and looking up brd again. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: pass "dgap_numboards" as a paramter to dgap_found_board()Daeseok Youn2014-06-201-7/+7
| | | | | | | | - Pass "dgap_numboards" to dgap_found_board() instead of using a global variable. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: make dgap_config_buf a local bufferDaeseok Youn2014-06-201-2/+2
| | | | | | | The dgap_config_buf is only used in dgap_firmware_load(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: unwind on error in dgap_tty_register_ports()Daeseok Youn2014-06-201-2/+42
| | | | | | | | - The dgap_tty_register_ports() needs to handle if the tty_port_register_device() fails. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: unwind on error in dgap_tty_init()Daeseok Youn2014-06-201-5/+13
| | | | | | | | | | | | If the kzalloc() fails for channels, it need to handle that error. It should free channels which were already allocated. And also removes the call to dgap_tty_uninit() in dgap_firmware_load(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove bogus null test in dgap_tty_init()Daeseok Youn2014-06-201-9/+4Star
| | | | | | | | | | - The channels array were set to NULL in dgap_found_board(). - Removes redundant null check for channels array in for loop, if one of the channel cannot be allocated, dgap_tty_init() just returns an error. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: unwind on error in dgap_found_board()Daeseok Youn2014-06-201-5/+14
| | | | | | | | | | Adds a label for "kfree(brd)". And also remove a state value as BOARD_FAILED in brd when dgap_do_remap() is failed. Because "brd" will free after failure. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove useless dgap_probe1() functionDaeseok Youn2014-06-201-7/+1Star
| | | | | | | | The dgap_probe1() function is just calling dgap_found_board(). So it is removed and dgap_found_board() is called directly. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"Greg Kroah-Hartman2014-05-291-1/+3
| | | | | | | | | This reverts commit 0ade4a34fd439d62df46937e8f3e584eb0879579 as it was wrong. Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: Use EIO instead of ENXIOMark Hounschell2014-05-281-22/+22
| | | | | | | Replaces ENXIO with EIO errno Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: Simplify dgap_find_configMark Hounschell2014-05-281-41/+43
| | | | | | | | Simplify ugly dgap_find_config function Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: misc cleanup of NULL conditionalsMark Hounschell2014-05-281-32/+32
| | | | | | | | refactors NULL conditionals Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: move tty_port_init() for serial_ports.Daeseok Youn2014-05-261-3/+3
| | | | | | | | | If printer_ports which is allocated after serial_ports is failed to allocate, tty_port_init for serial_ports doesn't need anymore. So move this after allocating memory for printer_ports. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()Daeseok Youn2014-05-261-3/+2Star
| | | | | | | | When it failed to allocate for printer_ports, serial_ports can be freed in dgap_tty_uninit(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: remove unneeded kfree() for ttys in tty_driverDaeseok Youn2014-05-261-4/+0Star
| | | | | | | | In destruct_tty_driver() from put_tty_driver() will free the ttys in tty_driver. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: dgap: Fixed iomem accesses in dgap.cPascal COMBES2014-05-251-8/+8
| | | | | | | I changed dereferences from iomem into the adequate ioread function. Signed-off-by: Pascal COMBES <pascom@orange.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: Change GFP_ATOMICs to GFP_KERNELMark Hounschell2014-05-231-4/+4
| | | | | | | | | We don't need to use GFP_ATOMIC at driver load time so use GFP_KERNEL instead. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: dgap: Simplify get_altpin and get_useintr functionsMark Hounschell2014-05-231-8/+2Star
| | | | | | | | | Simplify dgap_config_get_useintr and dgap_config_get_altpin changing the case statement to an if statement. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>