Commit de424be4 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: remove the global DriverState



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: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220206161809.423031-10-martin@kaiser.cx


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3c4b62e3
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -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 */

+3 −5
Original line number Diff line number Diff line
@@ -454,12 +454,10 @@ 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);
	}
	}
	rtw_cancel_all_timer(if1);

	rtw_dev_unload(if1);