From: Nikolay Kulikov <nikolayof23@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, Nikolay Kulikov <nikolayof23@gmail.com>
Subject: [PATCH RFC 00/11] staging: rtl8723bs: remove struct _io_ops
Date: Fri, 8 May 2026 22:38:29 +0300 [thread overview]
Message-ID: <20260508193909.16015-1-nikolayof23@gmail.com> (raw)
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
next reply other threads:[~2026-05-08 19:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 19:38 Nikolay Kulikov [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508193909.16015-1-nikolayof23@gmail.com \
--to=nikolayof23@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox