From: Bryan Brattlof <hello@bryanbrattlof.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans de Goede <hdegoede@redhat.com>,
Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Bryan Brattlof <hello@bryanbrattlof.com>
Subject: [PATCH v2] staging: rtl8723bs: remove sdio_drv_priv structure
Date: Wed, 14 Apr 2021 17:39:03 +0000 [thread overview]
Message-ID: <20210414173751.317762-1-hello@bryanbrattlof.com> (raw)
The sdio_drv_priv structure is a small wrapper around sdio_driver in
linux/mmc/sdio_func.h with an added drv_registered integer.
drv_registered is never used anywhere in the driver and only assigned to
during the sdio registering and unregistering process. We can safely
remove sdio_drv_priv and use the sdio_driver structure directly.
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
---
Changes from:
v1 -> v2: rebased to current staging-next
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 28 +++++++-------------
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index a9a9631dd23c..c235c47e735a 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -36,17 +36,12 @@ static const struct dev_pm_ops rtw_sdio_pm_ops = {
.resume = rtw_sdio_resume,
};
-struct sdio_drv_priv {
- struct sdio_driver r871xs_drv;
- int drv_registered;
-};
-
-static struct sdio_drv_priv sdio_drvpriv = {
- .r871xs_drv.probe = rtw_drv_init,
- .r871xs_drv.remove = rtw_dev_remove,
- .r871xs_drv.name = "rtl8723bs",
- .r871xs_drv.id_table = sdio_ids,
- .r871xs_drv.drv = {
+static struct sdio_driver rtl8723bs_sdio_driver = {
+ .probe = rtw_drv_init,
+ .remove = rtw_dev_remove,
+ .name = "rtl8723bs",
+ .id_table = sdio_ids,
+ .drv = {
.pm = &rtw_sdio_pm_ops,
}
};
@@ -496,13 +491,10 @@ static int __init rtw_drv_entry(void)
DBG_871X_LEVEL(_drv_always_, "rtl8723bs BT-Coex version = %s\n", BTCOEXVERSION);
#endif /* BTCOEXVERSION */
- sdio_drvpriv.drv_registered = true;
- ret = sdio_register_driver(&sdio_drvpriv.r871xs_drv);
- if (ret != 0) {
- sdio_drvpriv.drv_registered = false;
+ ret = sdio_register_driver(&rtl8723bs_sdio_driver);
+ if (ret != 0)
rtw_ndev_notifier_unregister();
- }
DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
return ret;
@@ -512,9 +504,7 @@ static void __exit rtw_drv_halt(void)
{
DBG_871X_LEVEL(_drv_always_, "module exit start\n");
- sdio_drvpriv.drv_registered = false;
-
- sdio_unregister_driver(&sdio_drvpriv.r871xs_drv);
+ sdio_unregister_driver(&rtl8723bs_sdio_driver);
rtw_ndev_notifier_unregister();
--
2.27.0
reply other threads:[~2021-04-14 17:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210414173751.317762-1-hello@bryanbrattlof.com \
--to=hello@bryanbrattlof.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).