summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_wlan.h
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-04-18 10:35:35 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-18 13:47:31 +0200
commit18bd6dd1f849105b0aca7666d8eb3528b8cd8a8e (patch)
tree1cb3619397fbc7eb3a7d213371ccfa7755c384d5 /drivers/staging/ks7010/ks_wlan.h
parent321dabdc746d995a962d02dd81ecf23ddc3b3169 (diff)
downloadop-kernel-dev-18bd6dd1f849105b0aca7666d8eb3528b8cd8a8e.zip
op-kernel-dev-18bd6dd1f849105b0aca7666d8eb3528b8cd8a8e.tar.gz
staging: ks7010: move hw info into dev private data
Currently driver uses a hardware information struct description to group some SDIO related functionality (work, work queue, sdio private data pointer). This structure is then embedded in the device private data structure. Having nested structures described in different header files means that to view the device private data programmers must open two header files. This structure could be embedded anonymously in the device private data and achieve the same result (grouping of function specific to SDIO) without the need to open multiple headers. However, the SDIO private data structure already has various different data and pointers, adding the embedded structure adds little extra meaning and lengthens all the dereferences throughout the driver, often meaning addition line breaks and braces. We can increase readability and reduce code complexity by moving the hardware information data and pointers to directly be within the device private data structure description. While preparing for this refactoring it was noted that the identifier currently used for the delayed work is 'rw_wq', this is confusing since the 'wq' suffix typically means 'work queue'. This identifier would be more meaningful if it used the suffix 'dwork' as does the declaration of queue_delayed_work() (include/linux/workqueue.h). The identifier for the work queue is currently 'ks7010sdio_wq'. This identifier can be shortened without loss of meaning because there is only one work queue within the driver. Identifier 'wq' is typical within in-tree driver code and aptly describes the pointer. Current pointer to the SDIO private data is identified by 'sdio_card', this is sufficiently meaningful from within the hw_info structure but once the hw_info_t structure is removed the pointer would be better to have a prefix appended to it to retain the prior level of meaning. Move members from struct hw_info_t to struct ks_wlan_private. Rename identifiers; struct delayed_work pointer 'rw_wq' to 'rw_dwork'. struct workqueue_struct pointer 'ks7010sdio_wq' to 'wq'. struct ks_sdio_card pointer 'sdio_card' to 'ks_sdio_card'. Remove structure description hw_info_t. Fix init/destroy calls. Fix all call sites, SDIO private data access calls, and queuing calls. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ks7010/ks_wlan.h')
-rw-r--r--drivers/staging/ks7010/ks_wlan.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index b0bc7a8..eb15db9 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -413,7 +413,10 @@ struct wps_status_t {
#endif /* WPS */
struct ks_wlan_private {
- struct hw_info_t ks_wlan_hw; /* hardware information */
+ /* hardware information */
+ struct ks_sdio_card *ks_sdio_card;
+ struct workqueue_struct *wq;
+ struct delayed_work rw_dwork;
struct tasklet_struct rx_bh_task;
struct net_device *net_dev;
OpenPOWER on IntegriCloud