aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/dgap
AgeCommit message (Collapse)Author
2014-05-29Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"Greg Kroah-Hartman
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>
2014-05-28staging: dgap: Use EIO instead of ENXIOMark Hounschell
Replaces ENXIO with EIO errno Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28staging: dgap: Simplify dgap_find_configMark Hounschell
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>
2014-05-28staging: dgap: misc cleanup of NULL conditionalsMark Hounschell
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>
2014-05-26staging: dgap: move tty_port_init() for serial_ports.Daeseok Youn
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>
2014-05-26staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()Daeseok Youn
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>
2014-05-26staging: dgap: remove unneeded kfree() for ttys in tty_driverDaeseok Youn
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>
2014-05-25Staging: dgap: Fixed iomem accesses in dgap.cPascal COMBES
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>
2014-05-24staging: dgap: Change GFP_ATOMICs to GFP_KERNELMark Hounschell
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>
2014-05-24staging: dgap: Simplify get_altpin and get_useintr functionsMark Hounschell
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>
2014-05-24staging: dgap: Replace double negative conditionalsMark Hounschell
This patch replaces double negativeconditionals Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: Remove more extra white space and tabsMark Hounschell
Removes more extra white space and tabs Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: Remove unnecessary initialization of variables in declarationsMark Hounschell
Removes unnecessary initialization of variables in declarations Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: replace dgap_savestring function with kstrdupMark Hounschell
Removes dgap_savestring function to use kstrdup 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>
2014-05-24staging: dgap: Remove unnecessary test on countMark Hounschell
This patch removes an unnecessary test. We've already tested it by the time we get here with no possiblity of it being changed. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: Remove erroneous commentMark Hounschell
This patch removes a false comment Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: Remove dead sniff buffer codeMark Hounschell
The sniff buffer was a /proc filesystem file. This module no longer uses /proc. This patch removes the deaed code associated with the sniff buffer. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: fix smatch warn: unsigned var is never less than zeroMark Hounschell
This patch fixes a smatch warning about an unsigned integer being tested for less than zero. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24staging: dgap: implement error handling in dgap_tty_register()Daeseok Youn
- alloc_tty_driver() is deprecated so it is changed to tty_alloc_driver() - Pointers which are allocated by alloc_tty_driver() and kzalloc() can be NULL so it need to check NULL for them. - If one of those is failed, it need to add proper handler for avoiding memory leak. - If both of drivers are registered normally, and then set TRUE to dgap_major_serial{print}_registered. If one of drivers is failed to register, leave a default value as FALSE. 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>
2014-05-16staging: dgap: Get rid of CamelCaseMark Hounschell
This patch gets rid of the obvious CamelCases from both dgap.c and dgap.h Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: refactor ugly dgap_init_one functionMark Hounschell
This patch just cleans up the ugly dgap_init_one function Signed-off-by: Mark Hounschell <markh@compro.net> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: Add check for MAXBOARDS in .probe (dgap_init_one)Mark Hounschell
Insure we don't allow configuring more than MAXBOARDS (32). Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: remove two unnecessary conditionalsMark Hounschell
Remove 2 unnessessary conditionals. They are always false in this code path. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: check unchecked return valuesMark Hounschell
Check the return values of dgap_tty_register and dgap_finalize_board_init. If they fail for a particular board we should not be able to try to use that board. IE. no device entries shall be created for that board. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix a few more sparse warningsMark Hounschell
This patch fixes a few more sparse warnings related to __iomem version 2 excludes a change that actually caused a new sparse warning. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix sparse warnings Using plain integer as NULL pointerMark Hounschell
This patch fixes sparse warnings: warning: Using plain integer as NULL pointer Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix sparse warning about dgap_poll_lockMark Hounschell
This patch fixes a sparse warning: warning: symbol 'dgap_poll_lock' was not declared. Should it be static? Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix a few misc sparse warningsMark Hounschell
This patch fixes a few misc sparse warnings related to __iomem Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix sparse warnings for the entire cm_t structureMark Hounschell
This patch fixes sparse warnings for the entire cm_t structure This entire structure defines a hardware segment Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix sparse warnings for the entire bs_t structureMark Hounschell
This patch fixes sparse warnings for the entire bs_t structure This entire structure defines a hardware segment Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: fix sparse warnings for re_map_membase and re_map_portMark Hounschell
This patch fixes sparse warnings for the re_map_membase and re_map_port variables. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: Fix BUG in processing config fileMark Hounschell
This patch fixes an OOPS caused by a pointer being changed between the malloc and free. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Reported-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-16staging: dgap: Fix how we insure config data is a stringMark Hounschell
This patch changes the way we insure the config data is a string. Clearly this was just wrong. After a certain number of loads/unloads various OOPs were generated indicating something other than this driver had a problem. It was this driver. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Reported-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: remove uchar typedef and replace use with u8Mark Hounschell
This patch removes the uchar typedef in dgap.h and changes all uses of it to u8. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: rename and fixup dgap_wait_for_xxx functionsMark Hounschell
This patch renames and changes the dgap_wait_for_bios and dgap_wait_for_fep functions from boolean functions to return zero on success and a negative error code on error. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: fix/change a pr_infoMark Hounschell
This patch just fixes a pr_info. brd->state is not proper at this point in time. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: remove volatiles from dgap.hMark Hounschell
This patch fixes checkpatch warnings about using volatiles in dgap.h Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Macros with complex values should be enclosed in parenthesisMark Hounschell
This patch fixes a checkpatch warning "Macros with complex values should be enclosed in parenthesis" Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Only read config file dgap.conf onceMark Hounschell
The config file is currently read for each board found. It only needs to be read one time. The buffer it is read into can now be freed immediately after it is parsed instead of at driver unload time. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Removes excessive empty lines from dgap.hMark Hounschell
This patch removes excessive empty lines from dgap.h not previously caught. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: remove some unused code in dgap.hMark Hounschell
This patch removes some unused code in dgap.h Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Fix several 80+ line warnings in dgap.hMark Hounschell
This patch fixes several 80+ char line warnings as reported by checkpatch in dgap.h Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: fix some whitespace warnings in dgap.hMark Hounschell
This patch fixes some whitespace warnings as reported by checkpatch in dgap.h. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Remove some unneeded commentsMark Hounschell
This patch removes some unneeded comments from dgap.c Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-14staging: dgap: Remove some unused code in dgap.cMark Hounschell
This patch removes some unused code in dgap.c. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19staging: dgap: fix the rest of the checkpatch warnings in dgap.cMark Hounschell
This patch fixes all the simple_strtol and simple_strtoul warnings as reported by checkpatch. After this patch, checkpatch will report zero errors or warnings on dgap.c. Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19staging: dgap: re-factor some more code for 80+ linesMark Hounschell
This patch fixes more 80+ char lines as reported by checkpatch Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19staging: dgap: get rid of DGAP_LOCK and DGAP_UNLOCK macrosMark Hounschell
This patch replaces the DGAP_LOCK and DGAP_UNLOCK macros with spin_lock_irqsave spin_unlock_irqrestore. Signed-off-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19staging: dgap: re-factor some code for 80+ lines as reported by checkpatchMark Hounschell
This patch re-factors some code to fix some 80+ lines as reported by checkpatch. This patch was suggested and authored by Dan Carpenter. A test case for this patch has been written and used to show the patch to be correct. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Hounschell <markh@compro.net> Tested-by: Mark Hounschell <markh@compro.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18staging: dgap: Fixed sparse error: same symbol redeclared with different typeMasood Mehmood
sparse reported dgap_do_fep_load is redeclared with different type. while fixing, I noticed __user attribute is used incorrectly in declaration. There is no need to define __user for firware->data. Replaced the __user with 'const uchar *' from function dgap_do_fep_load and did the same for function dgap_do_bios_load patch generated against: next-20140318 Signed-off-by: Masood Mehmood <ody.guru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>