staging: r8188eu: remove intf_stop pointer
authorMartin Kaiser <martin@kaiser.cx>
Mon, 6 Feb 2023 20:18:00 +0000 (21:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Feb 2023 07:41:03 +0000 (08:41 +0100)
Remove the intf_stop pointer that points to a media-specific stop
function. The r8188eu driver supports only usb.

For usb drivers, intf_stop points to usb_intf_stop, which is only
two lines long.  We can remove intf_stop and usb_intf_stop and call
the two cancel functions directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/include/drv_types.h
drivers/staging/r8188eu/os_dep/os_intfs.c
drivers/staging/r8188eu/os_dep/usb_intf.c

index 40f13f1..159990f 100644 (file)
@@ -171,7 +171,6 @@ struct adapter {
        s8      signal_strength;
 
        void *cmdThread;
-       void (*intf_stop)(struct adapter *adapter);
        struct  net_device *pnetdev;
 
        /*  used by rtw_rereg_nd_name related function */
index bd3c17f..dc419fd 100644 (file)
@@ -761,8 +761,8 @@ void rtw_ips_dev_unload(struct adapter *padapter)
 {
        rtw_fifo_cleanup(padapter);
 
-       if (padapter->intf_stop)
-               padapter->intf_stop(padapter);
+       rtw_read_port_cancel(padapter);
+       rtw_write_port_cancel(padapter);
 
        /* s5. */
        if (!padapter->bSurpriseRemoved)
index ca9a7c0..74a16d1 100644 (file)
@@ -152,17 +152,6 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
 
 }
 
-static void usb_intf_stop(struct adapter *padapter)
-{
-       /* cancel in irp */
-       rtw_read_port_cancel(padapter);
-
-       /* cancel out irp */
-       rtw_write_port_cancel(padapter);
-
-       /* todo:cancel other irps */
-}
-
 static void rtw_dev_unload(struct adapter *padapter)
 {
        if (padapter->bup) {
@@ -170,8 +159,9 @@ static void rtw_dev_unload(struct adapter *padapter)
                if (padapter->xmitpriv.ack_tx)
                        rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
                /* s3. */
-               if (padapter->intf_stop)
-                       padapter->intf_stop(padapter);
+               rtw_read_port_cancel(padapter);
+               rtw_write_port_cancel(padapter);
+
                /* s4. */
                rtw_stop_drv_threads(padapter);
 
@@ -308,8 +298,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb
        SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
        padapter = rtw_netdev_priv(pnetdev);
 
-       padapter->intf_stop = &usb_intf_stop;
-
        /* step read_chip_version */
        rtl8188e_read_chip_version(padapter);