RFC staging: rtl8723bs: remove struct _io_ops
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest11 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | staging: rtl8723bs: remove unused sdio_local_read()drivers/ drivers/ | +0 | 0 replies | |
| 2/11 | staging: rtl8723bs: declare helper sdio functions in .h filesdrivers/ drivers/ drivers/ +1 more | +8 | 0 replies | |
| 3/11 | staging: rtl8723bs: inline sd_read8() and sdio_read8() into rtw_read8()drivers/ drivers/ drivers/ +1 more | +17 | 0 replies | |
| 4/11 | staging: rtl8723bs: inline sdio_read16() into rtw_read16()drivers/ drivers/ drivers/ | +6 | 0 replies | |
| 5/11 | staging: rtl8723bs: inline sdio_read32() into rtw_read32()drivers/ drivers/ drivers/ | +38 | 0 replies | |
| 6/11 | staging: rtl8723bs: inline sd_write8() and sdio_write8() in rtw_write8()drivers/ drivers/ drivers/ +1 more | +17 | 0 replies | |
| 7/11 | staging: rtl8723bs: inline sdio_write16() into rtw_write16()drivers/ drivers/ drivers/ | +6 | 0 replies | |
| 8/11 | staging: rtl8723bs: inline sdio_write32() into rtw_write32()drivers/ drivers/ drivers/ | +25 | 0 replies | |
| 9/11 | staging: rtl8723bs: inline sdio_write_port() into rtw_write_port()drivers/ drivers/ drivers/ | +37 | 0 replies | |
| 10/11 | staging: rtl8723bs: remove the empty function set_intf_ops()drivers/ drivers/ drivers/ +2 more | +3 | 0 replies | |
| 11/11 | staging: rtl8723bs: remove empty struct _io_opsdrivers/ | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH RFC 00/11] staging: rtl8723bs: remove struct _io_ops
I don't have hardware. Tested only by compiling.
So, in this series I've attempted to simplify a bunch of abstractions in core/rtw_io.c (and hal/sdio_ops.c and os_dep/sdio_ops_linux.c files).
In general, the logic is as follows:
1. Functions from core/rtw_io.c (with the 'rtw_*' prefix) call functions from hal/sdio_ops.c (with the 'sdio_*' prefix), obtaining them from a pointer in 'struct _io_ops'.
2. Functions from hal/sdio_ops.c convert the passed address (call _cvrt2ftaddr()) and call functions from os_dep/sdio_ops_linux.c (with the 'sd_*' prefix).
3. Only functions from os_dep/sdio_ops_linux.c perform the work we're interested in - they call other functions from the kernel MMC subsystem (sdio_readb(), sdio_writeb(), and so on)
For the rtw_read8() (rtw_write8()) functions, I was able to remove all these abstraction layers (this is the only place where this happens) by directly calling sdio_readb() (sdio_writeb()).
For the rtw_read16() (rtw_write16()) functions, I had to retain the sd_cmd52_read() (sd_cmd52_write()) calls from os_dep/sdio_ops_linux.c, since there are no equivalents for them.
rtw_read32() (rtw_write32()) calls differet read (write) functions depending on the address alignment. I simply pasted everything from sdio_read32() (sdio_write32()) into them.
I described some details in the comments to the corresponding patches.
I also slightly formatted the modified code to avoid creating new checkpatch.pl warnings.
In any case, this will completely eliminate the 'struct _io_ops' and consolidate the reading (writing) code in one place so that error hadling can be found and corrected.
This series is marked as RFC because I need your opinion on it and also maybe someone wants to test it?
Nikolay Kulikov (11):
staging: rtl8723bs: remove unused sdio_local_read()
staging: rtl8723bs: declare helper sdio functions in .h files
staging: rtl8723bs: inline sd_read8() and sdio_read8() into
rtw_read8()
staging: rtl8723bs: inline sdio_read16() into rtw_read16()
staging: rtl8723bs: inline sdio_read32() into rtw_read32()
staging: rtl8723bs: inline sd_write8() and sdio_write8() in
rtw_write8() staging: rtl8723bs: inline sdio_write16() into rtw_write16()
staging: rtl8723bs: inline sdio_write32() into rtw_write32()
staging: rtl8723bs: inline sdio_write_port() into rtw_write_port()
staging: rtl8723bs: remove the empty function set_intf_ops()
staging: rtl8723bs: remove empty struct _io_ops
drivers/staging/rtl8723bs/core/rtw_io.c | 208 +++++++++++----- drivers/staging/rtl8723bs/hal/sdio_ops.c | 235 +----------------- drivers/staging/rtl8723bs/include/rtw_io.h | 16 +- drivers/staging/rtl8723bs/include/sdio_hal.h | 3 + drivers/staging/rtl8723bs/include/sdio_ops.h | 3 - .../rtl8723bs/include/sdio_ops_linux.h | 2 + drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 2 +- .../staging/rtl8723bs/os_dep/sdio_ops_linux.c | 55 +--- 8 files changed, 162 insertions(+), 362 deletions(-)
base-commit: 81f55766523e5293604cb96c5e98d10da345ff33
Signature · 1 line
2.54.0