mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 15:08:25 -04:00
staging: rtl8723bs: Remove no-op netdevice_notifier()
rtw_ndev_notifier_call() does not do anything other then a netdev_dbg() + always returning NOTIFY_DONE. Remove the no-op notifier. This also fixes a WARN() when unbinding + rebinding the driver which was caused by the remove() method not unregistering the notifier. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20241024181052.67031-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
39dace7072
commit
037f9a6df3
@@ -55,9 +55,6 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj);
|
||||
|
||||
u16 rtw_recv_select_queue(struct sk_buff *skb);
|
||||
|
||||
int rtw_ndev_notifier_register(void);
|
||||
void rtw_ndev_notifier_unregister(void);
|
||||
|
||||
void rtw_ips_dev_unload(struct adapter *padapter);
|
||||
|
||||
int rtw_ips_pwr_up(struct adapter *padapter);
|
||||
|
||||
@@ -381,34 +381,6 @@ u16 rtw_recv_select_queue(struct sk_buff *skb)
|
||||
return rtw_1d_to_queue[priority];
|
||||
}
|
||||
|
||||
static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr)
|
||||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
|
||||
if (dev->netdev_ops->ndo_do_ioctl != rtw_ioctl)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
netdev_dbg(dev, FUNC_NDEV_FMT " state:%lu\n", FUNC_NDEV_ARG(dev),
|
||||
state);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static struct notifier_block rtw_ndev_notifier = {
|
||||
.notifier_call = rtw_ndev_notifier_call,
|
||||
};
|
||||
|
||||
int rtw_ndev_notifier_register(void)
|
||||
{
|
||||
return register_netdevice_notifier(&rtw_ndev_notifier);
|
||||
}
|
||||
|
||||
void rtw_ndev_notifier_unregister(void)
|
||||
{
|
||||
unregister_netdevice_notifier(&rtw_ndev_notifier);
|
||||
}
|
||||
|
||||
|
||||
static int rtw_ndev_init(struct net_device *dev)
|
||||
{
|
||||
struct adapter *adapter = rtw_netdev_priv(dev);
|
||||
|
||||
@@ -382,7 +382,6 @@ static int rtw_drv_init(
|
||||
if (sdio_alloc_irq(dvobj) != _SUCCESS)
|
||||
goto free_if1;
|
||||
|
||||
rtw_ndev_notifier_register();
|
||||
status = _SUCCESS;
|
||||
|
||||
free_if1:
|
||||
@@ -484,22 +483,12 @@ static int rtw_sdio_resume(struct device *dev)
|
||||
|
||||
static int __init rtw_drv_entry(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = sdio_register_driver(&rtl8723bs_sdio_driver);
|
||||
if (ret != 0)
|
||||
rtw_ndev_notifier_unregister();
|
||||
|
||||
return ret;
|
||||
return sdio_register_driver(&rtl8723bs_sdio_driver);
|
||||
}
|
||||
module_init(rtw_drv_entry);
|
||||
|
||||
static void __exit rtw_drv_halt(void)
|
||||
{
|
||||
sdio_unregister_driver(&rtl8723bs_sdio_driver);
|
||||
|
||||
rtw_ndev_notifier_unregister();
|
||||
}
|
||||
|
||||
|
||||
module_init(rtw_drv_entry);
|
||||
module_exit(rtw_drv_halt);
|
||||
|
||||
Reference in New Issue
Block a user