Skip to content

RFC staging: rtl8723bs: remove struct _io_ops

Nikolay Kulikov linux-staging 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11staging: rtl8723bs: remove unused sdio_local_read()drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/sdio_ops.h+0 -420 replies
2/11staging: rtl8723bs: declare helper sdio functions in .h filesdrivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/sdio_hal.h drivers/staging/rtl8723bs/include/sdio_ops_linux.h +1 more+8 -40 replies
3/11staging: rtl8723bs: inline sd_read8() and sdio_read8() into rtw_read8()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h +1 more+17 -440 replies
4/11staging: rtl8723bs: inline sdio_read16() into rtw_read16()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h+6 -180 replies
5/11staging: rtl8723bs: inline sdio_read32() into rtw_read32()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h+38 -570 replies
6/11staging: rtl8723bs: inline sd_write8() and sdio_write8() in rtw_write8()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h +1 more+17 -450 replies
7/11staging: rtl8723bs: inline sdio_write16() into rtw_write16()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h+6 -180 replies
8/11staging: rtl8723bs: inline sdio_write32() into rtw_write32()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h+25 -480 replies
9/11staging: rtl8723bs: inline sdio_write_port() into rtw_write_port()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h+37 -590 replies
10/11staging: rtl8723bs: remove the empty function set_intf_ops()drivers/staging/rtl8723bs/core/rtw_io.c drivers/staging/rtl8723bs/hal/sdio_ops.c drivers/staging/rtl8723bs/include/rtw_io.h +2 more+3 -170 replies
11/11staging: rtl8723bs: remove empty struct _io_opsdrivers/staging/rtl8723bs/include/rtw_io.h+0 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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