summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-04-25staging: ks7010: remove duplicated ks_wlan_handler_def declarationSergio Paracuellos
This declaration is declared twice so just remove this one because the other one is the one which contains static struct initializers. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove WPS definition conditional codeSergio Paracuellos
WPS definition was defined by default in ks_wlan.h header file. So it makes no sense to have conditional preprocessor stuff along the code about this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix line exceding 80 characters in ks_wlan_get_rangeSergio Paracuellos
Avoid very long if condition just changing its style. This makes checkpatch script not complains about this line. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor ks_wlan_get_mode functionSergio Paracuellos
Avoid the use of switch-case block which is not necessary at all and just use a ternary operator to achieve this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor ks_wlan_set_mode functionSergio Paracuellos
Most cases which are being handled in the switch-case of ks_wlan_set_mode function are just returning EINVAL. Avoid the use of switch-case stament and just use a simple if to handle those. This decrease LOC as well as improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove some duplicated definitions in ks_wlan_net.cSergio Paracuellos
This definitions are in linux/wireless.h header so it is not necessary at all to have this compatibility stuff duplicated here. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid use of brackets in single line ifSergio Paracuellos
Singles if does not need at all to use brackets in its body so just remove them which is the preferred style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: refactor hostif_sme_power_mgmt_set functionSergio Paracuellos
Some minor changes have been done in this function to clean it a bit: - POWER_MGMT_ACTIVE and default case are the same so just handle that with the same block of code, - POWER_MGMT_SAVE1 replaces if-else with a ternary operator. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use definitions from kernel headers in ↵Sergio Paracuellos
hostif_data_indication function Function hostif_data_indication checks some hardcoded values in a switch-case block. This values are defined in uapi/linux/llc.h header. Just use them and avoid a comment in the code improving readability a bit. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: join some debug traces in get_current_ap functionSergio Paracuellos
There is a lot of netdev_dbg calls related with the access point in this function and all of them can be joined in only one call. This makes code a bit simplier. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid some if-else code in get_current_ap functionSergio Paracuellos
This commits avoid some if-else code extracting common code before its use and making use of a new variable 'size' which is assigned using a ternary operator. This improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove KSC_OPNOTSUPP related codeSergio Paracuellos
This commit reviews KSC_OPNOTSUPP related code. The preprocessor KSC_OPNOTSUPP is defined by default so related wext functions are not being used. Just clean code removing all of this stuff. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use IW_HANDLER macro in ks_wlan_handlerSergio Paracuellos
This commit make use of IW_HANDLER to set wext operations of the device. Using this, comments are not neccessary anymore and also NULL entries so readability is clearly increased. In order to avoid casting because of the use of a different prototype in all related functions, those which are affected have been updated also to make use of the union iwreq_data as third parameter updating code accordly. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review includes of ks_hostif fileSergio Paracuellos
This commit reviews includes of ks_hostif.c source file. Those which are not being used at all have been removed. Driver header includes have been moved after the kernel header includes to make style consistent in different files of the driver. The need of ks_wlan.h header include is only because of some preprocessor conditional code of WPS definition. This definition is in ks_wlan.h so this one must be included before the ks_hostif.h header file. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: removes data_buff field of ks_wlan_private structSergio Paracuellos
This commit removes data_buff array field of ks_wlan_private which is not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove two fields of ks_wlan_private structSergio Paracuellos
This commit removes l2_dev and l2_fd fields of ks_wlan_private struct because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid blank line between definitions in hostif_data_requestSergio Paracuellos
This commit removes a blank line between definition in hostif_data_request function. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix warning aout long line in init_requestSergio Paracuellos
This commit fix length of the definition line of init_request function. Warning from checkpatch script for this is fixed. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: remove superfluous comments in ks_hostif source fileSergio Paracuellos
This commit removes some comments which are not necessary at all because code is clear enough to understand its intention. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid one level indentation in devio_rec_ind functionSergio Paracuellos
This commit changes logic to handle with the status of the device at first checking for close state to return directly instead of just do the stuff when device is open. This improves readability avoiding one level indentation. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: change name and type for device_open_status fieldSergio Paracuellos
This commit changes type for device_open_status field of ks_wlan_private structure from int to bool. This variable is only be set to 1 on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this purpose it is not necessary at all to use an integer because a bool is enough. This also renames field name from device_open_status to is_device_open. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: assign dev_alloc_name() result to variable before check itSergio Paracuellos
This commit assigns dev_alloc_name() call to 'ret' variable to check it after instead of check directly the call in the if condition. This improves a bit readability. It also add an empty line before the new assignment to separate it from the previous check statement block. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: use u8 instead of unsigned char for firmware buffersSergio Paracuellos
This commit replaces type unsigned char which is the one which is being used for firmware buffers with u8 type which is preferred. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: fix error paths in ks7010_sdio_remove functionSergio Paracuellos
This commit reviews and fixes error paths in ks7010_sdio_remove driver function. It change logic to handle error directly after priv dereference to avoid one level indentation. It also removes a temporal netdev variable which wasn't being used in all of the function calls. Also if send_stop_request call fails it was making a direct 'return' instead of doing a properly cleaning. Because of this a new 'err_free_card' label has been added. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: check sdio_set_block_size return valueSergio Paracuellos
This commit checks sdio_set_block_size function return value. If it fails abort driver initialization. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: replace create_workqueue with alloc_workqueueSergio Paracuellos
This commit replaces deprecated create_workqueue call with the alloc_workqueue one which is the one to be used now for this purpose. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: move MODULE_DEVICE_TABLE related codeSergio Paracuellos
This commit moves MODULE_DEVICE_TABLE related code to the end of the file. This is not necessary at all but moving it just before its use improves readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid one extra level indentation in ks_wlan_hw_rx functionSergio Paracuellos
This commit use an and operator in a if condition to avoid one indentation level which is not needed at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review debug and error messages in ks7010_sdio sourceSergio Paracuellos
This commit reviews debug and error messages in code located in ks7010_sdio source file avoiding to use 'error' or 'ks7010' because this file is using netdev_* functions and has non sense to repeat information in log messages. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: review comment style in ks7010_sdio source fileSergio Paracuellos
This commit reviews comment style used in ks7010_sdio source file in order to be coherent with the rest of the code. Most comments in this source are before definitions but only two of them have been written at the right. So, be coherent moving this two to the top of definitions. Also fix one multiline comment style to use the normal preferred kernel style. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: add REG suffix to sdio register definitionsSergio Paracuellos
This commit adds REG suffix to register definitions related with SDIO in order to improve readability. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: delete not used definitions in ks7010_sdio sourceSergio Paracuellos
This commit removes two definitions inside ks7010_sdio source file because they are not being used at all. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: move sdio specific register definitions into source fileSergio Paracuellos
This commit moves SDIO related register definitions from header to source file. There is no need to have those into the header because they are only being used in specific SDIO code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: move ROM_FILE definition into source fileSergio Paracuellos
This commit moves ROM_FILE from header to source file because there is not being used outside this. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: ks7010: avoid casts in michael_mic_function callsSergio Paracuellos
This commit removes casts in calls to michael_mic_function. Most of them are nosense because types match perfectly function parameters. To avoid also int casting for len parameter just pass unsigned len to function which makes sense because is only being called with unsigned int len parameters. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Fix calculation typo in msdc_init_gpd_bdChristian Lütke-Stetzkamp
When refactoring the function msdc_init_gpd_bd, an error in the calculation of the bd.next address was introduced. The offset has to be added to the base address, not multiplied. Fixes: 8f2395586cf0 ("staging: mt7621-mmc: Refactor msdc_init_gpd_bd") Reported-by: NeilBrown <neil@brown.name> Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Remove unused card_workqueue from msdc_hostChristian Lütke-Stetzkamp
The card_workqueue field of msdc_host is already if 0'd out and there are no references to it in the code (not even in unused code), so remove it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Remove old references to taskletChristian Lütke-Stetzkamp
In the current code there are '#if 0' out references on using a tasklet instead of delayed_work. Removing these improves readability. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Add annotations about held locksChristian Lütke-Stetzkamp
The functions msdc_command_resp and msdc_do_request are always called with the host->lock lock held. By adding annotations, sparse is informed about that. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Correct datatypes for io and sanitize io accessChristian Lütke-Stetzkamp
Current code discard the address space information on the base address of the mmc controller, that causes sparse warnings. It uses the raw read write function, that is correct for the mips architecture (little endian), but for portability the non-raw function should be used. Also the clear/set bit macros do direct memory access, that is also correct for mips, but not portable. So the type of the base address is changed to void __iomem *, that is the type returned by the ioremap function. The set/clear bit macros are changed to functions, that use the portable read and write functions. The use of the raw access functions is changed to use the non-raw ones. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Replace dma dir with mmc_get_dma_dirChristian Lütke-Stetzkamp
Currently the dma direction is manually determined by the read status, there is a more portable function for it, mmc_get_dma_dir, use it. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Fix dma_map_sg may map to fewer entriesChristian Lütke-Stetzkamp
The dma_map_sg function may merge several sglist entries into one, the return value has to be saved to consider that. The data->sg_count field is the position, where it should be saved, like it is done in other mmc host drivers. Also the count of mapped entries is needed for the dma setup. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Remove multiple assignmentsChristian Lütke-Stetzkamp
Fix checkpatch: multiple assignments should be avoided, to improve readability. It aslo moves the second assignment out of the if/else block, that is valid, because drv_mode is of type msdc_mode, an enum with only those three elements, so one of the if/ else if statements is always taken. And the second assignment can happen after the conditions. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-25staging: mt7621-mmc: Fix dereference before check in msdc_drv_pmChristian Lütke-Stetzkamp
In the msdc_drv_pm function the variable mmc is dereferenced before checked. Reordering fixes that. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23Revert "staging: nvec: Augment TODO file with GPIO work item"Marc Dietrich
This reverts commit 5a3e59ce3acf2f52c8b4a6fc656c3b1e4a329f06, because the necessary changes were applied in the "staging: nvec: convert to use GPIO descriptors" patch. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23MAINTAINERS: add maintainer for the DPAA2 PTP clock driverYangbo Lu
This patch is to add maintainer for the DPAA2 PTP clock driver. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: fsl-dpaa2/rtc: add rtc driverYangbo Lu
This patch is to add driver for the DPAA2 1588 timer module (RTC) which interfaces to up to an unlimited number of 10/100/1000 or 10G ethernet MACs, providing current time, alarm, and fiper support. The 1588 IP control block includes these distinctive features. - External GPIO trigger for time-stamping - 2 Time-stamp alarms - 3 FIPER pulse generators - Phase adjusted output timer clock Currently this driver only supports basic functions like settime/gettime/adjtime/adjfreq. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23drivers/staging/fsl-mc: Fix DPIO error path issueRoy Pledge
Remove unneeded call to dev_set_drvdata(dev, NULL) since the device will be deallocated in any case. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23drivers/staging/fsl-mc: Use devm_memremap/devm_ioremap for DPIORoy Pledge
Change the mapping of the QBMan cache enabled area from using ioremap_wc() to devm_memremap(). This allows the __iomem attribute to be removed from the pointer (which makes sense as accesses treat this as cacheable memory not IO memory). These changes allow sparse checks to pass. Also use devm_ioremap() for the cache inhibited area so unmap occurs automatically when the device is released. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: rtl8192u: Replace mdelay with usleep_range in ↵Jia-Ju Bai
dm_TXPowerTrackingCallback_TSSI dm_TXPowerTrackingCallback_TSSI() is never called in atomic context. dm_TXPowerTrackingCallback_TSSI() is only called by dm_txpower_trackingcallback(), which is set a parameter of INIT_DELAYED_WORK() in rtl8192_init_priv_task(). Despite never getting called from atomic context, dm_TXPowerTrackingCallback_TSSI() calls mdelay() to busily wait. This is not necessary and can be replaced with usleep_range() to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. And I also manually check it Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>