linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: remove sdio_drv_priv structure
@ 2021-04-13 17:11 Bryan Brattlof
  2021-04-14  8:27 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Brattlof @ 2021-04-13 17:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Hans de Goede, Larry Finger
  Cc: linux-staging, linux-kernel, kernel-janitors, Bryan Brattlof

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>
---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 32 ++++++--------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index a8ef95ab14da..816b5bf6e3ed 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,
 	}
 };
@@ -498,18 +493,11 @@ 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();
-		goto exit;
-	}
 
-	goto exit;
-
-exit:
 	DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
 	return ret;
 }
@@ -518,9 +506,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



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

* Re: [PATCH] staging: rtl8723bs: remove sdio_drv_priv structure
  2021-04-13 17:11 [PATCH] staging: rtl8723bs: remove sdio_drv_priv structure Bryan Brattlof
@ 2021-04-14  8:27 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-14  8:27 UTC (permalink / raw)
  To: Bryan Brattlof
  Cc: Hans de Goede, Larry Finger, linux-staging, linux-kernel,
	kernel-janitors

On Tue, Apr 13, 2021 at 05:11:39PM +0000, Bryan Brattlof wrote:
> 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>
> ---
>  drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 32 ++++++--------------
>  1 file changed, 9 insertions(+), 23 deletions(-)

Does not apply to my tree :(

Please rebase and resend.

thanks,

greg k-h

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

end of thread, other threads:[~2021-04-14  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 17:11 [PATCH] staging: rtl8723bs: remove sdio_drv_priv structure Bryan Brattlof
2021-04-14  8:27 ` Greg Kroah-Hartman

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).