From: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
ethantidmore06@gmail.com, guojy.bj@gmail.com, error27@gmail.com,
knavaneeth786@gmail.com, dvdh12707@gmail.com,
m.steinmoetzger@gmail.com, fliegbert2@gmail.com,
enelsonmoore@gmail.com, nikolayof23@gmail.com,
khushalchitturi@gmail.com, samasth.norway.ananda@oracle.com,
dennylin0707@gmail.com,
Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
Subject: [PATCH v5] staging: rtl8723bs: Remove manual ifname allocation
Date: Thu, 1 Oct 2026 16:01:27 +0300 [thread overview]
Message-ID: <20261001130127.3655-1-nsvatoslav515@gmail.com> (raw)
The manual ifname allocation via dev_alloc_name() is redundant because
the networking core handles interface naming automatically during
register_netdev().
Remove the ifname module parameter, the corresponding field from
struct registry_priv, and the rtw_init_netdev_name() callpath.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
---
Changes in v5:
- Rebased onto latest staging-testing to resolve merge conflicts caused by recent tree updates.
Changes in v4:
- Rebased onto latest staging-testing branch.
Changes in v3:
- Added missing changelog.
Changes in v2:
- Removed rtw_init_netdev_name() and the entire manual naming callpath
instead of hardcoding "wlan%d", as suggested by Greg KH.
---
drivers/staging/rtl8723bs/include/drv_types.h | 2 --
.../staging/rtl8723bs/include/osdep_intf.h | 1 -
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 26 +++----------------
3 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 0db276d46b1c..7f7d4fbad4bd 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -151,8 +151,6 @@ struct registry_priv {
u8 enable80211d;
- u8 ifname[16];
-
u8 notch_filter;
/* define for tx power adjust */
diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h
index 83a25598e962..f1e7a303a286 100644
--- a/drivers/staging/rtl8723bs/include/osdep_intf.h
+++ b/drivers/staging/rtl8723bs/include/osdep_intf.h
@@ -20,7 +20,6 @@ u32 rtw_start_drv_threads(struct adapter *padapter);
void rtw_stop_drv_threads(struct adapter *padapter);
void rtw_cancel_all_timer(struct adapter *padapter);
-int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname);
struct net_device *rtw_init_netdev(struct adapter *padapter);
void rtw_unregister_netdevs(struct dvobj_priv *dvobj);
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index d11d0cdd023a..d220df325fa9 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -106,10 +106,6 @@ static int rtw_80211d;
static int rtw_qos_opt_enable;/* 0: disable, 1:enable */
module_param(rtw_qos_opt_enable, int, 0644);
-static char *ifname = "wlan%d";
-module_param(ifname, charp, 0644);
-MODULE_PARM_DESC(ifname, "The default name to allocate for first interface");
-
char *rtw_initmac; /* temp mac address if users want to use instead of the mac address in Efuse */
module_param(rtw_initmac, charp, 0644);
@@ -249,8 +245,6 @@ static void loadparam(struct adapter *padapter)
registry_par->enable80211d = (u8)rtw_80211d;
- strscpy(registry_par->ifname, ifname, sizeof(registry_par->ifname));
-
registry_par->notch_filter = (u8)rtw_notch_filter;
registry_par->reg_enable_tx_power_limit = (u8)rtw_tx_pwr_lmt_enable;
@@ -394,17 +388,6 @@ static const struct net_device_ops rtw_netdev_ops = {
.ndo_get_stats = rtw_net_get_stats,
};
-int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
-{
- if (dev_alloc_name(pnetdev, ifname) < 0) {
- pr_err("dev_alloc_name, fail for %s\n", ifname);
- return 1;
- }
- netif_carrier_off(pnetdev);
-
- return 0;
-}
-
struct net_device *rtw_init_netdev(struct adapter *old_padapter)
{
struct adapter *padapter;
@@ -726,14 +709,12 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
return _SUCCESS;
}
-static int _rtw_drv_register_netdev(struct adapter *padapter, char *name)
+static int _rtw_drv_register_netdev(struct adapter *padapter)
{
int ret = _SUCCESS;
struct net_device *pnetdev = padapter->pnetdev;
- /* alloc netdev name */
- if (rtw_init_netdev_name(pnetdev, name))
- return _FAIL;
+ netif_carrier_off(pnetdev);
eth_hw_addr_set(pnetdev, padapter->eeprompriv.mac_addr);
@@ -758,9 +739,8 @@ int rtw_drv_register_netdev(struct adapter *if1)
{
struct dvobj_priv *dvobj = if1->dvobj;
struct adapter *padapter = dvobj->padapters;
- char *name = if1->registrypriv.ifname;
- return _rtw_drv_register_netdev(padapter, name);
+ return _rtw_drv_register_netdev(padapter);
}
static int _netdev_open(struct net_device *pnetdev)
--
2.47.3
next reply other threads:[~2026-10-01 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 13:01 Svyatoslav Nikolenko [this message]
2026-10-01 13:48 ` Greg KH
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=20261001130127.3655-1-nsvatoslav515@gmail.com \
--to=nsvatoslav515@gmail.com \
--cc=dennylin0707@gmail.com \
--cc=dvdh12707@gmail.com \
--cc=enelsonmoore@gmail.com \
--cc=error27@gmail.com \
--cc=ethantidmore06@gmail.com \
--cc=fliegbert2@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=guojy.bj@gmail.com \
--cc=khushalchitturi@gmail.com \
--cc=knavaneeth786@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=m.steinmoetzger@gmail.com \
--cc=nikolayof23@gmail.com \
--cc=samasth.norway.ananda@oracle.com \
/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
all inboxes | Powered by JetHome®