]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
staging: rtl8723bs: Remove no-op netdevice_notifier()
authorHans de Goede <hdegoede@redhat.com>
Thu, 24 Oct 2024 18:10:52 +0000 (20:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Nov 2024 23:51:15 +0000 (00:51 +0100)
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>
drivers/staging/rtl8723bs/include/osdep_intf.h
drivers/staging/rtl8723bs/os_dep/os_intfs.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c

index 111e0179712ac6e0b8846c65e30f5dd3716618d0..215ece612f71570ebb4f46383b6f4c216fae7f9d 100644 (file)
@@ -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);
index aa608dee4464ab5fa566e3944626dafe2c33bf5d..4e1917c054029157b07c6d3c6e2e311c52b0aa7a 100644 (file)
@@ -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);
index d18fde4e5d6ceaf0c3e8e26a6c605ba2fa883f53..81867b98d793fe26cecb2cdf82d6aa686949bb20 100644 (file)
@@ -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);