Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2120516rwi; Sat, 15 Oct 2022 08:14:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5omrQwfuVwDsmt5SAEdphBMwY5wp4gQL4pp/7GXVnbUkWmmJ0UTkmZR0A1J4pPwT7qsvEV X-Received: by 2002:a17:907:b07:b0:78d:ce2b:1999 with SMTP id h7-20020a1709070b0700b0078dce2b1999mr2394649ejl.267.1665846867503; Sat, 15 Oct 2022 08:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846867; cv=none; d=google.com; s=arc-20160816; b=k4uJd4TF7AEePj1KwnB9AxCorOhxWH1LWqoo5Wpr/pRhl9JKSDDX99w+1na645xpM7 Ujatqo5jESirQab9EuFcN5MVS0go0xqbTyjWh9YlPCNa7X4ufMW1WjxImXdRTemcnmk9 gW7+Cj91uDdz2P9g0UeGOELBgBGcyOZkt4cKjbUe6ylzDq/N+DsJJ2apSEyjt3daSq46 Ih4ci/wL3ErbzKUbjEGEoEYA7RxW1gNA1dda/ZeZdcCJ8eRip9khp6qgDhrwiFWUi7yf NL+h6KjI6So2QaokEWgiowYIdARd2fIFwVJthiOY1p3qHS/qaqyu66K+HsR+hvDKAqv2 EpIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0u9BVPii3t/g91G8+4Assb8fy9cWfsFpT2S8XNEP8p4=; b=PRGBv6fKwGNmgV7SGsBc7S+ztpOxJ8OFcKU0MU+OmzVKSy8SDw5iiwDvXrcR0RNf/5 5/kRXaODE7jfR123a/vDranmtu3/pCG+arGYP6Dec4e5dnWCQeGUthrcthiZ9AIELJjp geMZJd37lZ2H1WJ1RsGophejKjRIALtxt/mQSg54zfHGPnv4hSyJvDsvyAroxidoRc3h NiI/sNprJ5xEiWOVFAHy9w5407Qx2OLsaxCIlgIVkpjAJARZ8J/5BekiHYQ3Ozu08Ms3 Ei+biB9RGNR/nlMjz87t0WJEAi9bQhkPYtKDIvHcBHuUXtD4pPWjxMTAPSNFEBD3x+Zv ydng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr40-20020a1709073fa800b00780cb1272eesi5753444ejc.466.2022.10.15.08.14.02; Sat, 15 Oct 2022 08:14:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiJOPLw (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiJOPLm (ORCPT ); Sat, 15 Oct 2022 11:11:42 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA6F44CFE for ; Sat, 15 Oct 2022 08:11:38 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1ojip3-0006sp-Bf; Sat, 15 Oct 2022 17:11:33 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 03/10] staging: r8188eu: fix status updates in SwLedOff Date: Sat, 15 Oct 2022 17:11:08 +0200 Message-Id: <20221015151115.232095-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015151115.232095-1-martin@kaiser.cx> References: <20221015151115.232095-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update bLedOn only if we could update the REG_LEDCFG2 register. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 4f1cad890cae..38433296d327 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -43,10 +43,11 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) { if (padapter->bDriverStopped) - goto exit; + return; + + if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS) + return; - rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)); -exit: pLed->bLedOn = false; } -- 2.30.2