Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH RFC 00/11] staging: rtl8723bs: remove struct _io_ops
@ 2026-05-08 19:38 Nikolay Kulikov
  2026-05-08 19:38 ` [PATCH RFC 01/11] staging: rtl8723bs: remove unused sdio_local_read() Nikolay Kulikov
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Nikolay Kulikov @ 2026-05-08 19:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, Nikolay Kulikov

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
-- 
2.54.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-05-08 19:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 19:38 [PATCH RFC 00/11] staging: rtl8723bs: remove struct _io_ops Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 01/11] staging: rtl8723bs: remove unused sdio_local_read() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 02/11] staging: rtl8723bs: declare helper sdio functions in .h files Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 03/11] staging: rtl8723bs: inline sd_read8() and sdio_read8() into rtw_read8() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 04/11] staging: rtl8723bs: inline sdio_read16() into rtw_read16() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 05/11] staging: rtl8723bs: inline sdio_read32() into rtw_read32() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 06/11] staging: rtl8723bs: inline sd_write8() and sdio_write8() in rtw_write8() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 07/11] staging: rtl8723bs: inline sdio_write16() into rtw_write16() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 08/11] staging: rtl8723bs: inline sdio_write32() into rtw_write32() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 09/11] staging: rtl8723bs: inline sdio_write_port() into rtw_write_port() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 10/11] staging: rtl8723bs: remove the empty function set_intf_ops() Nikolay Kulikov
2026-05-08 19:38 ` [PATCH RFC 11/11] staging: rtl8723bs: remove empty struct _io_ops Nikolay Kulikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox