linux/drivers/staging/ks7010
Tobin C. Harding 18bd6dd1f8 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>
2017-04-18 13:47:31 +02:00
..
eap_packet.h staging: ks7010: eap_packet: Format comments to fit in line 2017-03-09 14:01:29 +01:00
Kconfig staging: ks7010: remove custom firmware loader 2016-06-07 22:42:53 -07:00
ks7010_sdio.c staging: ks7010: move hw info into dev private data 2017-04-18 13:47:31 +02:00
ks7010_sdio.h staging: ks7010: move hw info into dev private data 2017-04-18 13:47:31 +02:00
ks_hostif.c staging: ks7010: move hw info into dev private data 2017-04-18 13:47:31 +02:00
ks_hostif.h staging: ks7010: fix complete_handler 2017-04-18 13:33:17 +02:00
ks_wlan_ioctl.h staging: ks7010: add parentheses to complex macro 2017-03-14 06:20:57 +08:00
ks_wlan_net.c staging: ks7010: fix complete_handler 2017-04-18 13:33:17 +02:00
ks_wlan.h staging: ks7010: move hw info into dev private data 2017-04-18 13:47:31 +02:00
Makefile staging: ks7010: remove cfg file handling 2016-06-18 19:45:55 -07:00
michael_mic.c staging: ks7010: fix checkpatch SPACING 2017-03-21 08:52:33 +01:00
michael_mic.h staging: ks7010: fix spelling of Michael MIC 2017-03-14 08:04:51 +08:00
TODO staging: ks7010: add task to TODO file 2017-04-11 16:05:51 +02:00