staging: r8188eu: remove the global DriverState
authorMartin Kaiser <martin@kaiser.cx>
Sun, 6 Feb 2022 16:18:04 +0000 (17:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 09:29:02 +0000 (10:29 +0100)
DriverState in struct adapter is never set. It remains 0 (DRIVER_NORMAL)
all the time, DriverState != DRIVER_DISAPPEAR is always true.

Both DriverState and the check can be removed. enum driver_state contains
the possible values of DriverState. This enum can be removed as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220206161809.423031-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/include/drv_types.h
drivers/staging/r8188eu/os_dep/usb_intf.c

index a07bcf0b6358c49198d17fd96274c41da1cc7bb7..1260cacbae64eab1e636356e4924d3cdb9a60605 100644 (file)
@@ -159,15 +159,7 @@ static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
        return &dvobj->pusbintf->dev;
 };
 
-enum driver_state {
-       DRIVER_NORMAL = 0,
-       DRIVER_DISAPPEAR = 1,
-       DRIVER_REPLACE_DONGLE = 2,
-};
-
 struct adapter {
-       int     DriverState;/* for disable driver using module, use dongle toi
-                            * replace module. */
        int     pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
        int     bDongle;/* build-in module or external dongle */
 
index 1a67486ff5fb7dae2d4fcaa6e587984e8b86556e..b20d0eca12fad597e293c8916710a0e1b9c167c3 100644 (file)
@@ -454,11 +454,9 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
 
        free_mlme_ap_info(if1);
 
-       if (if1->DriverState != DRIVER_DISAPPEAR) {
-               if (pnetdev) {
-                       /* will call netdev_close() */
-                       unregister_netdev(pnetdev);
-               }
+       if (pnetdev) {
+               /* will call netdev_close() */
+               unregister_netdev(pnetdev);
        }
        rtw_cancel_all_timer(if1);