From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 381611868 for ; Wed, 28 Dec 2022 14:44:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF2E4C433F0; Wed, 28 Dec 2022 14:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672238687; bh=TTbUjmos0mrL6aksfxvhZr6XlWf+XeBxivJnlqDpiGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LP6PieJW+U3oxVU3DSb2mQ4KVfVztN9irFRauQnp/zVWrWjFS5/mRIQ/L+/5KovTK QzaftzaQwlHpkpAzPGGAAS6h823w0Xzu8TLkQb3CEqsXQ0OcYKLqUDSSUG+QDgdyJZ JNabCI0JR5a4NcpX6brHJlMFu3MpiRAYuLWNz1Ew= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Martin Kaiser , Sasha Levin , Philipp Hortmann Subject: [PATCH 6.0 0002/1073] staging: r8188eu: dont check bSurpriseRemoved in SwLedOff Date: Wed, 28 Dec 2022 15:26:30 +0100 Message-Id: <20221228144328.235088630@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228144328.162723588@linuxfoundation.org> References: <20221228144328.162723588@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Martin Kaiser [ Upstream commit 647085006beb2cc41bef27a24f249f4dec3c1e15 ] The SwLedOff function calls rtw_read8 which in turn calls usb_read. bSurpriseRemoved is checked in usb_read. We don't have to check it again in SwLedOff. Tested-by: Philipp Hortmann # Edimax N150 Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220925140406.112991-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman Stable-dep-of: 12c6223fc180 ("staging: r8188eu: fix led register settings") Signed-off-by: Sasha Levin --- drivers/staging/r8188eu/core/rtw_led.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index e889e7861706..42e35953fd7b 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -53,7 +53,7 @@ static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) u8 LedCfg; int res; - if (padapter->bSurpriseRemoved || padapter->bDriverStopped) + if (padapter->bDriverStopped) goto exit; res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ -- 2.35.1