Commit 2b62e1b4 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: clean up error handling in rtw_start_drv_threads()



Convert the error handling in the function rtw_start_drv_threads() to
the common logic used in the kernel. Another step to get rid of _FAIL
and _SUCCESS which uses inverted logic.

Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221106133443.8872-1-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c12b5b56
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter);
void rtw_free_drv_sw(struct adapter *padapter);
void rtw_reset_drv_sw(struct adapter *padapter);

u32 rtw_start_drv_threads(struct adapter *padapter);
int rtw_start_drv_threads(struct adapter *padapter);
void rtw_stop_drv_threads (struct adapter *padapter);
void rtw_cancel_all_timer(struct adapter *padapter);

+7 −10
Original line number Diff line number Diff line
@@ -363,18 +363,16 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
	return pnetdev;
}

u32 rtw_start_drv_threads(struct adapter *padapter)
int rtw_start_drv_threads(struct adapter *padapter)
{
	u32 _status = _SUCCESS;

	padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
	if (IS_ERR(padapter->cmdThread))
		_status = _FAIL;
	else
		return PTR_ERR(padapter->cmdThread);

	/* wait for rtw_cmd_thread() to start running */
	wait_for_completion(&padapter->cmdpriv.start_cmd_thread);

	return _status;
	return 0;
}

void rtw_stop_drv_threads(struct adapter *padapter)
@@ -627,8 +625,7 @@ static int _netdev_open(struct net_device *pnetdev)

		netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr);

		status = rtw_start_drv_threads(padapter);
		if (status == _FAIL) {
		if (rtw_start_drv_threads(padapter)) {
			pr_info("Initialize driver software resource Failed!\n");
			goto netdev_open_error;
		}