From patchwork Sun Jan 15 21:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 43899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp901105wrn; Sun, 15 Jan 2023 13:10:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXvaVZLo3dgB7L8IoVCGRsNaZCGCx3/L8E7Zd+T9iFaxLlobKzKAoZOBnsN5xUfjA52p1OIq X-Received: by 2002:a17:906:f8c3:b0:86e:18b4:83d1 with SMTP id lh3-20020a170906f8c300b0086e18b483d1mr5453081ejb.64.1673817057358; Sun, 15 Jan 2023 13:10:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673817057; cv=none; d=google.com; s=arc-20160816; b=0rVi6FlCehGsXDUTkgwJuJkQrV3xNVUScwXOlq4dA6lVTF/4Jvsc1nWBmW5ZIvmgZt MzyZ6XPVFBqKjmasvflb6tR+pk3JTGXPaPv4+ylbfD4GSKn7drXdcQkiN3BO+vHZjcg5 TIkO362VcqEnIuO4k1NzZ8krIuCM/AacGMx5Vu4Q6YQyz/HubsOi6E8q4lW7g+BJVDeS Igq2svMw7UVz6w9caEa12825vJOs5MkzoLSHPh5liaJL1C7RCvIfb04Ms7ToSg/jNcKd ePfDn7AeUWGlljFxjI1/Hn3FdqA0SagIr9vM3Stymm3sWmoWfCBgN6JFO95sXSkH3xlS JAsw== 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 :dkim-signature; bh=U+5N1rXSfVPzLU7ZKBzI7cYGDRpk01puVVQT6NPAi1o=; b=cSTTrLMsbzKb13ED+MuDcMPa/m7Di/tEbiOkSblfVbr1mA4XQ69eLmWUxnQTx1s8dA kWLihPBdFTwkVa7Cj3tOcSi1QfyrdM5FIt/wM6ta9w0at0iuBMOc/nAjrSBGh260FFQM y2onMBvYjfodQPXNdF4cNE12e+11ahfHk1ocxvMo57ov+8TNzt1/nBDFgpR9P8nMZ9I+ bGxW97bbZcfHFhHd5n447sYwBoh6XM6ukkKO97/rUF+HZ/DdEoUbqo+2e+NdQwHoIW1Q a5lwOoZYBQ/TzTKeDO6EQd5Yjxbh08EddI7oSCL57308Qs8I5XoIa5Yu7sD6OjLy44BW 79LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jcN9F7eX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a1709060dd400b007c0a88076d5si21453528eji.818.2023.01.15.13.10.33; Sun, 15 Jan 2023 13:10:57 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jcN9F7eX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbjAOVHw (ORCPT + 99 others); Sun, 15 Jan 2023 16:07:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbjAOVHu (ORCPT ); Sun, 15 Jan 2023 16:07:50 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215531448B for ; Sun, 15 Jan 2023 13:07:48 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id ud5so63904326ejc.4 for ; Sun, 15 Jan 2023 13:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U+5N1rXSfVPzLU7ZKBzI7cYGDRpk01puVVQT6NPAi1o=; b=jcN9F7eXKvSGmUgLLg6dzI3dRFBeoFJsef5UJB/M15r6NhBJER1HOfqzotw2DxpKXO vX5zrtjhrccQEuBUR07GhVUzObjfbuUfUhPHW48PAjR2imZH6M81m7W9I5DXoS2jFN9Y a6PtqYC8nlgCirn+hafNwZXAbuLWGl3JF13HulCDSNctv+uZaK0c0XvMmqzI6MpOkdbO 1TNKHuq5hQZUE7QW1RbmKmdjbnGmEMgqnUb6b4cVkGBzj+OhNjqhRi6n09MkfsDSdpVe o7hOe6rGLh1oNQZggDdQDhve8M7q5+2WoNCohdNbzUqUVqmr9s9+G0AHSwCyRjIuPAGu 2IqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U+5N1rXSfVPzLU7ZKBzI7cYGDRpk01puVVQT6NPAi1o=; b=4SCdR6+P9OoWgvq4W/VrTIGtlvVviB2AYKCI6dxi4jR4dSPohmjCG3Js/lEzVC1wZU wEcHbblQt3EE3i6df7UIaokE0TzzUPB+PaB+rHmxr9KW6TAEB5h5nQzWoiQU9Ii1FYUs tU+9FAjQjpfhbMKhYOrOBWbVj0v6yjTMdSYcbO1U4sqMsOa5/SAMxPNkEtadPKVvE66J mCnpkS9E0KldOb7oLtNJ9HG4AxPP3EFkB7HL7uXJAND2cP/Nv8DiefkUhaK/FWkt+nlt N+KiB7x6jFULg0NgKnUxwWvbTaSv2N8O7em4yjC8y3w0d8VQNn2AmAqSEK7n8qVzq9b/ 75yA== X-Gm-Message-State: AFqh2koXTbP+Q61Ys7gh69aAr/ErvMrXlYTu9V+GL8Fc6AqrDwZXR0qm dRyiEK7OoIjvTtmmKnOphS0= X-Received: by 2002:a17:907:3e26:b0:839:74cf:7c4f with SMTP id hp38-20020a1709073e2600b0083974cf7c4fmr103277586ejc.8.1673816866654; Sun, 15 Jan 2023 13:07:46 -0800 (PST) Received: from localhost.localdomain (ip5f5abbb0.dynamic.kabel-deutschland.de. [95.90.187.176]) by smtp.gmail.com with ESMTPSA id a11-20020aa7d74b000000b0049e08f781e3sm1010421eds.3.2023.01.15.13.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:07:46 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 1/4] staging: r8188eu: convert PHY_MACConfig8188E() to common error logic Date: Sun, 15 Jan 2023 22:07:31 +0100 Message-Id: <20230115210734.18610-2-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115210734.18610-1-straube.linux@gmail.com> References: <20230115210734.18610-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755124395067517966?= X-GMAIL-MSGID: =?utf-8?q?1755124395067517966?= Convert the function PHY_MACConfig8188E() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 9 ++++----- drivers/staging/r8188eu/hal/usb_halinit.c | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c index b7f3c7a670fb..204c1c30377b 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c @@ -315,21 +315,20 @@ rtl8188e_PHY_SetRFReg( * 08/12/2008 MHC Create Version 0. * *---------------------------------------------------------------------------*/ -s32 PHY_MACConfig8188E(struct adapter *Adapter) +int PHY_MACConfig8188E(struct adapter *Adapter) { struct hal_data_8188e *pHalData = &Adapter->haldata; - int rtStatus = _SUCCESS; + int err; /* */ /* Config MAC */ /* */ - if (ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv)) - rtStatus = _FAIL; + err = ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv); /* 2010.07.13 AMPDU aggregation number B */ rtw_write16(Adapter, REG_MAX_AGGR_NUM, MAX_AGGR_NUM); - return rtStatus; + return err; } /** diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index d28b4dc2a767..9ba6a526e90d 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -600,9 +600,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter) Adapter->pwrctrlpriv.bFwCurrentInPSMode = false; haldata->LastHMEBoxNum = 0; - status = PHY_MACConfig8188E(Adapter); - if (status == _FAIL) - goto exit; + if (PHY_MACConfig8188E(Adapter)) + return _FAIL; /* */ /* d. Initialize BB related configurations. */ From patchwork Sun Jan 15 21:07:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 43898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp900855wrn; Sun, 15 Jan 2023 13:10:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTkLXVistQPH847BSg+swaPaExHH2Pqle+Wc3m/N9AC44jbC31Mvv5z8D7I5Uuk1HVTdFp X-Received: by 2002:a05:6a00:d52:b0:585:64d2:54a0 with SMTP id n18-20020a056a000d5200b0058564d254a0mr31475659pfv.24.1673817007264; Sun, 15 Jan 2023 13:10:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673817007; cv=none; d=google.com; s=arc-20160816; b=J9foPMxCVn/jViTYbsOpXAlho/qPRZWBVXsBcbZPjqgmOJ0+myspVMaxSUxbBtm3CR qUyvDX/n8FP/sH0f1tIXQUo+lrIn0CtllPKt5rLmB1vc5BeLscqZrKtJheFb08ckv5dQ jRE48iS1AxX6WWgZkhfz9XTM3+5A8/FVz8YPcpW0Vq8ab61VpwhP035VeLzB37Pe8hl1 BpZzrZj0+K0/FsPNU8IWhcCtBWS3EdKaeCeDAJimI3qCQPZ5MP4yI7sZSbsm/F4wfyUQ N3a5b8GsAtL+FsGWSgHnO2UB0ef4tQcYAMgplP9/Rx2zobB5omFtpKuscZBdaviGdBWZ t1hw== 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 :dkim-signature; bh=rl6qXidu5WIs9nfrJNjX3YLrFPQ+UzUlEvm+lb6ejX8=; b=XPWrjc2khDPxWRTPBfJTh85lrO1zQPi4OdkbfyCJOh4iLiw2FwBqBOrMaetxBRDQCS nFHg6SfxPqkyvPwXMyLwpH219ua5ozG7SxJF5haMYBd7DLtFfxgv9YY1pxDlLJtztnCu 1o84pmHUkqPC+P2LGdh9j8nMYflH5jRyjG6za/hH9NgNyUxtUFQ/3mgkALVblZsO6Erx dKps8+vQ3NRRN8OyG45To/XOofc+2Ngzl20hogRFBVaOAjfboo9akrypypOojTflad// Qc73sCuDi43XmIGd8l0bt37uEs2/rMTsvzBrP404PSVKCigFHLU+krMyTusbVbMhUcuI 08kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aGSmoHCR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a056a00081300b005871ef7e13csi3442006pfk.46.2023.01.15.13.09.55; Sun, 15 Jan 2023 13:10:07 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aGSmoHCR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231315AbjAOVH7 (ORCPT + 99 others); Sun, 15 Jan 2023 16:07:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbjAOVHv (ORCPT ); Sun, 15 Jan 2023 16:07:51 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D901449E for ; Sun, 15 Jan 2023 13:07:48 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id w14so21034180edi.5 for ; Sun, 15 Jan 2023 13:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rl6qXidu5WIs9nfrJNjX3YLrFPQ+UzUlEvm+lb6ejX8=; b=aGSmoHCRnDPbu3N95+i267CwF+b32AnPcEYIvug5tlCBNTeM1W0fglKna1UmjjojvN crchnx4bR1DHF+8hMK4nPuHuLaLtBd5bDrq43Ki+7s0mlvNHp05bd82W50uZzKWXDqWi eUdTI8NoEIyb8BZikP7ML3RywovN2V8hr6o9EeDpdxOaH+94Ev+x+Rf2PJ8KfhDYmsby LzKgWWj2OVxe9kbfYq+Hrtw+eR9fje64hc5a33K1qIMcbImqxqDxEPRC0LOXI5ztwu2B ArN5ZR2yH4iI8gi6cIo919g3GKBxp0kR3l2OJ50v8E6xcMzgx8d7zrviJwKk0071V2lO ay8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rl6qXidu5WIs9nfrJNjX3YLrFPQ+UzUlEvm+lb6ejX8=; b=ctxIhE5F92sdESM6H36N9AGDpYZ2Jde4xrtsQB+vjbbkoPi5OpS+9UGe91RUk5jLWe i0RgyPA1/O3aEiGlW0wc3ZTypiVmHIs58gr9CcqWAaCrThzOjjfuIIb0GRxuBtvDbc6D pVx/alpktMrUFxiNHw2UXJsF/6OrhLgyRDoh2o+mCuDVSiZJ1Rq7zFCl4HD1moNgTGXh fAclpRufG+n2fTUAj/fzdO5aAJmhkLKGrUniwGONPzwz1XpfkrdfM0HS3xUvKEA6uHtJ PC3VTs+tK89bYv6ei26HRBVJAu8lkEGqyhgvVe/Z03bCDdJwg9t32k6n4pIFIqbm+n/6 Os7w== X-Gm-Message-State: AFqh2kpk949H6y/vnkBtLE3lVqdBh9PKfzrLMU5zr2PCrBdXgMe4F3fv OJUURdrxHEW9Jgo77phhhYM= X-Received: by 2002:a05:6402:380d:b0:47e:eaae:9a5b with SMTP id es13-20020a056402380d00b0047eeaae9a5bmr76135871edb.42.1673816867306; Sun, 15 Jan 2023 13:07:47 -0800 (PST) Received: from localhost.localdomain (ip5f5abbb0.dynamic.kabel-deutschland.de. [95.90.187.176]) by smtp.gmail.com with ESMTPSA id a11-20020aa7d74b000000b0049e08f781e3sm1010421eds.3.2023.01.15.13.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:07:47 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 2/4] staging: r8188eu: convert phy_RF6052_Config_ParaFile() to common error logic Date: Sun, 15 Jan 2023 22:07:32 +0100 Message-Id: <20230115210734.18610-3-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115210734.18610-1-straube.linux@gmail.com> References: <20230115210734.18610-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755124342236435912?= X-GMAIL-MSGID: =?utf-8?q?1755124342236435912?= Convert the function phy_RF6052_Config_ParaFile() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 7 +++---- drivers/staging/r8188eu/hal/usb_halinit.c | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c index e5ec6e563fbd..1988fb6e780a 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rf6052.c @@ -371,7 +371,7 @@ int phy_RF6052_Config_ParaFile(struct adapter *Adapter) struct bb_reg_def *pPhyReg; struct hal_data_8188e *pHalData = &Adapter->haldata; u32 u4RegValue = 0; - int rtStatus = _SUCCESS; + int err; /* Initialize RF */ @@ -396,11 +396,10 @@ int phy_RF6052_Config_ParaFile(struct adapter *Adapter) udelay(1);/* PlatformStallExecution(1); */ /*----Initialize RF fom connfiguration file----*/ - if (ODM_ReadAndConfig_RadioA_1T_8188E(&pHalData->odmpriv)) - rtStatus = _FAIL; + err = ODM_ReadAndConfig_RadioA_1T_8188E(&pHalData->odmpriv); /*----Restore RFENV control type----*/; rtl8188e_PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue); - return rtStatus; + return err; } diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index 9ba6a526e90d..cb36b42c5ecc 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -610,9 +610,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter) if (status == _FAIL) goto exit; - status = phy_RF6052_Config_ParaFile(Adapter); - if (status == _FAIL) - goto exit; + if (phy_RF6052_Config_ParaFile(Adapter)) + return _FAIL; status = rtl8188e_iol_efuse_patch(Adapter); if (status == _FAIL) From patchwork Sun Jan 15 21:07:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 43900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp901236wrn; Sun, 15 Jan 2023 13:11:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDv9ti314Kdtn4peDAPKmLAeSK0zQTBJmJUQFFyxPp32DxfdLTUQtpv97XE94tSi3ADpms X-Received: by 2002:a05:6402:4515:b0:49b:63ea:b5d8 with SMTP id ez21-20020a056402451500b0049b63eab5d8mr11545634edb.4.1673817092503; Sun, 15 Jan 2023 13:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673817092; cv=none; d=google.com; s=arc-20160816; b=tc3wnHpIqpjCa62XvJw94qbBbpBgxOZpl1yMCdax2bo1JanMaRZofvRYrDe9ol8voZ pZMovGP6qL7OnLVlU2FW4thN6cNrT1Kn+hgZOBiDEjza8eVc4Gs0XvE7OGC/QTyYTv6H kL68bv5GktJo1DgmvUmFlWA1rOGXTP7lFNFyzXK+Jjs4tYTGcYyypsIxy+0zPhnKDNyw YY9W7sGA26FGoH/cARR5JTxsfmle/o2cNzxSkG71j7i+cjXR8inOZckbDT+6KVS9CZ9+ TJDIGgthFo4b3bGHm7IF3KhN7DTDaaHgFdtW5BjdgQ4yI6KwLeSAd9sHCMHQP4kPEmJt JT7Q== 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 :dkim-signature; bh=9pQYkoy/qDxOSox6BoBo+SUk2rYCy0dIN6nPZeFhqyM=; b=RjVpDrNjXWWzUcLU56vIwf4EEj28uhUHVepW/zrUR1rNxFneiAqmnL1tvqrNFhqVsb iIiTM0RtOHPTveqeAa5h9cUE5by2gSCGBdFwvKu8o+tpfK+plJveGmn8fUvbAXoBwqsm EUG0Zb/ijCz9LwV0oP5hxjK6IndWm9OyBxZlPP8TREmRkB6M5d330AFNQKFHjSPqQuLF XKUsJ8n9N59EqhDtDDECv2G5m9uAZwYphvCY/9zXf4UA/fm8VkKnd6YpujI7EKpXpoJA ReoKFWGh1Y4ffqTmxvan5gozJNTt63BWzScegwW6xAvJVxFzEGGH/YcSstTWBolu7qOL V2lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLSCgdrC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a05640251d300b00485220caa05si33906574edd.597.2023.01.15.13.11.09; Sun, 15 Jan 2023 13:11:32 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XLSCgdrC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbjAOVIC (ORCPT + 99 others); Sun, 15 Jan 2023 16:08:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjAOVHu (ORCPT ); Sun, 15 Jan 2023 16:07:50 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845A95B8A for ; Sun, 15 Jan 2023 13:07:49 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id u19so63814494ejm.8 for ; Sun, 15 Jan 2023 13:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9pQYkoy/qDxOSox6BoBo+SUk2rYCy0dIN6nPZeFhqyM=; b=XLSCgdrC+GHjNNokBBmD75ZEzXi0pdUT7fNbbLuPb/XITinDsrcsYmxIDqujGA+AJU afRIE05aUjMgORuQMKTln1Fz72MgI3BZQ8RKtEp0U9jZDJmsYwKOQkNgYZn7IzfjMXxf kt/rQLmi6JUCsmzAAbK64Kfo/0wPQobFhbwJgvWc0FoLEQmCxe9jDLfwlQ72QKWFJBn9 mjWtL6SOV8rarUWRH5k3p0u8/GKnqh3VuDB61WiFg8MLYbBtZCdGdm1Zvtvg5eoRlIlG xUS6TPW+l5LpDtDGE+Fb1wy3I0b4qZlepOneZt4Xfb/XJHpNBEp+jVzSsKN9XWQjazqW KCIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9pQYkoy/qDxOSox6BoBo+SUk2rYCy0dIN6nPZeFhqyM=; b=pTUroMQfm4VGrKjSC7dYOHuxsr+4o78M8UY1ZDrhsAUj1bDbteRaFRf5P7TCHZ8qNI IL12/cRAXfYoN3jPaKCAfM/Bkzqfq2s4xlFPAl4PDAc71xfvUfb0EjA11/Xwimn/Eheh 6qmO3P7gJCKxxyuvCVP7Sq3etz1uGBnTIMkgITyVXnPTZ7AiSMi+Sx4EljWO/qAo7cP/ a1xpUdAKIFoAtUyVmyz3wNV0M7AP8lhvSGClsZu3fZY4alb9iXoXY1cwLbi6YpH21+P7 VGqEgRO+cyAqve9kl2Ls8fvyuZjl73B0pHKcbx6HuxeucKHI2yNLB7NqnTla2h1BZTA4 HpiQ== X-Gm-Message-State: AFqh2kpgTXyBjB1/o0RB8Bz1o8qkSfXmoI0r9dH+whct+laIyElW8s01 l/MP8fSCfmCBdOMQp8f+piU= X-Received: by 2002:a17:906:f8c9:b0:870:8a70:d630 with SMTP id lh9-20020a170906f8c900b008708a70d630mr1415589ejb.17.1673816868119; Sun, 15 Jan 2023 13:07:48 -0800 (PST) Received: from localhost.localdomain (ip5f5abbb0.dynamic.kabel-deutschland.de. [95.90.187.176]) by smtp.gmail.com with ESMTPSA id a11-20020aa7d74b000000b0049e08f781e3sm1010421eds.3.2023.01.15.13.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:07:47 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 3/4] staging: r8188eu: convert phy_BB8188E_Config_ParaFile() to common error logic Date: Sun, 15 Jan 2023 22:07:33 +0100 Message-Id: <20230115210734.18610-4-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115210734.18610-1-straube.linux@gmail.com> References: <20230115210734.18610-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755124431501114531?= X-GMAIL-MSGID: =?utf-8?q?1755124431501114531?= Convert the fubction phy_BB8188E_Config_ParaFile() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c index 204c1c30377b..c52af93f1669 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c @@ -449,13 +449,15 @@ static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter) { struct eeprom_priv *pEEPROM = &Adapter->eeprompriv; struct hal_data_8188e *pHalData = &Adapter->haldata; + int err; /* */ /* 1. Read PHY_REG.TXT BB INIT!! */ /* We will separate as 88C / 92C according to chip version */ /* */ - if (ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv)) - return _FAIL; + err = ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv); + if (err) + return err; /* 2. If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */ if (!pEEPROM->bautoload_fail_flag) { @@ -464,10 +466,11 @@ static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter) } /* 3. BB AGC table Initialization */ - if (ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv)) - return _FAIL; + err = ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv); + if (err) + return err; - return _SUCCESS; + return 0; } int @@ -497,7 +500,8 @@ PHY_BBConfig8188E( rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); /* Config BB and AGC */ - rtStatus = phy_BB8188E_Config_ParaFile(Adapter); + if (phy_BB8188E_Config_ParaFile(Adapter)) + rtStatus = _FAIL; /* write 0x24[16:11] = 0x24[22:17] = CrystalCap */ CrystalCap = pHalData->CrystalCap & 0x3F; From patchwork Sun Jan 15 21:07:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 43901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp901321wrn; Sun, 15 Jan 2023 13:11:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXtJSNzAaKuJESzGnugG33c7SytvowjjoK/C6IsVmpNHP/rE7CjSl7JxPjDp9ce44PR+y/35 X-Received: by 2002:aa7:c856:0:b0:499:c083:fd2e with SMTP id g22-20020aa7c856000000b00499c083fd2emr7729547edt.36.1673817106326; Sun, 15 Jan 2023 13:11:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673817106; cv=none; d=google.com; s=arc-20160816; b=A2ZIY5w+wNgrmOhCMqWDjnuBvk//BoOa1ysmkKbhw1YYfAdxdIyK5glnYJ01EQR5g2 AO8VYDbxG6I6dyD1luZbUk5vtQOzMZw6ctscnIBy8ovzgGK24RMZBfLyS0f8Tx7kOeoB 9ukP6/9pLO9VwX0Rvz1JkaZ1WNQJjCKfolLJtryZW8nsp/rn3VwsZevXNpewCPmfW6yy u/YjrM/5dctzvTKE8/lkwz5LWfa7S1Bk7Aq08PTO/WMnW5EcHM1SLoS5k1I7mBFOnHF9 yWxgfsuDDW09wQgcoZz3F/Cc7h/SQSGaWpWeTsKC5HmlAp1QrPIDhXhHK9lnc4qR+MU7 Iahw== 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 :dkim-signature; bh=HgoF6Yn8695zBMkTSi4Lbg1WNVYK5ieGNugObJcQ8Z4=; b=JWnDuLiLgDTFcOHC9k3rEtvd9wyumgkIv4LAFyTk5b0tQu2zYlXFJSXZzQcfbMzBl/ K9MN6zpEtsv6PmVVEjD1X9MacNlJCO1uPJbJB0Eq1v4CkyLqj0aHHLsK86aLxVG0j9oT 3okZx0KlBISOHxvDCto8fujQdhJ10kpe0PhuqI6UfDrxWu1zWI4ECY+jlQVMuWDoq35l Vovv4LxdYsK2GBCzlXOF5/BBzkJ9hAwbdBv09Jela05OP0CSC/RZP/L/CvIskT9wE5eS NrTXIslJQ162SRxKzqyhbwNXnZu42PWAk9+Xlg1STMBoT+oMuyC3ZUqyoV9oSrXd5fEm WEnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fBVQUEjr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh23-20020a0564020f9700b0046b1d405d4asi26264714edb.206.2023.01.15.13.11.23; Sun, 15 Jan 2023 13:11:46 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fBVQUEjr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbjAOVIF (ORCPT + 99 others); Sun, 15 Jan 2023 16:08:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231642AbjAOVHx (ORCPT ); Sun, 15 Jan 2023 16:07:53 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ECB414488 for ; Sun, 15 Jan 2023 13:07:50 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id v10so37143876edi.8 for ; Sun, 15 Jan 2023 13:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HgoF6Yn8695zBMkTSi4Lbg1WNVYK5ieGNugObJcQ8Z4=; b=fBVQUEjrppTt6brIUzcXyf7TbCnuWrZP3D/yM/oPP3cVbVix7Iv7j0KCnV1u626wOG serum4zDSVIlU/ObY0dKlbL0Fy3WXR+kdPiWYXUfjcxc1jrquKw+02Ma4DCuwjJqu3hG WeVHnyw97ZnXiguZuvBXQB3B1nCLuvoeUpuUZ8u2DtvOOBIj4TtsRZUEqs9nxeKJKIKV c1nPw6s0ECJSqDPdTiGRVC6dj7oehlgeIkBmfCt3aYOdhfo0jjxb3j9fwndSIOqdJVZY g3cNerpw89r7n2HEYAQF7sbP7ce8PdrU3OUXnmKg57Ml9MBjrjVDBoFLUa2lQm39DUF0 xgFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HgoF6Yn8695zBMkTSi4Lbg1WNVYK5ieGNugObJcQ8Z4=; b=mmOgBEK7+ehQLMBBHXM6MnBuH9NPxPquwPwxJdtU79J3jC0hIn4AKkItAoTkGjZNj2 0Ozs8fzhuFEtJPz40oveYWyZSZ8Hbo76ibxs6xhvktd6+lHl4V6zJmNBdrYomL6uFozS A91XqO/PlQiWjrSLlgaPYoLQ03b51cMwfuZuveHgewk3vD40rpy43os7XjCSt1ChZsse qsvJLb2OfTLgP9W96wJP/rZ1HwQpxC1MHF0Q5jaIllIjdnAA4CohEEnmiw63anS3IEQX yWEq+FOmVxKLBmduLSGcSW/WK2qr+z61nJACmurGU0+BMz+15qjKUFhCieFubVoFWN/+ 6S9A== X-Gm-Message-State: AFqh2krCq+V/Z81HeaJuzYl2ZgPlKo6ib8R7nDko1QDzzWVpoAtHXitK AqrlbkJend1hJBFKoomaCl8= X-Received: by 2002:a05:6402:48d:b0:46f:d386:117d with SMTP id k13-20020a056402048d00b0046fd386117dmr7427368edv.33.1673816868693; Sun, 15 Jan 2023 13:07:48 -0800 (PST) Received: from localhost.localdomain (ip5f5abbb0.dynamic.kabel-deutschland.de. [95.90.187.176]) by smtp.gmail.com with ESMTPSA id a11-20020aa7d74b000000b0049e08f781e3sm1010421eds.3.2023.01.15.13.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:07:48 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 4/4] staging: r8188eu: convert PHY_BBConfig8188E() to common error logic Date: Sun, 15 Jan 2023 22:07:34 +0100 Message-Id: <20230115210734.18610-5-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230115210734.18610-1-straube.linux@gmail.com> References: <20230115210734.18610-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755124445876335551?= X-GMAIL-MSGID: =?utf-8?q?1755124445876335551?= Convert the function PHY_BBConfig8188E() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 14 ++++++-------- drivers/staging/r8188eu/hal/usb_halinit.c | 5 ++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c index c52af93f1669..f4edf4a8f5c2 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c @@ -478,18 +478,17 @@ PHY_BBConfig8188E( struct adapter *Adapter ) { - int rtStatus = _SUCCESS; struct hal_data_8188e *pHalData = &Adapter->haldata; u16 RegVal; u8 CrystalCap; - int res; + int err; phy_InitBBRFRegisterDefinition(Adapter); /* Enable BB and RF */ - res = rtw_read16(Adapter, REG_SYS_FUNC_EN, &RegVal); - if (res) - return _FAIL; + err = rtw_read16(Adapter, REG_SYS_FUNC_EN, &RegVal); + if (err) + return err; rtw_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal | BIT(13) | BIT(0) | BIT(1))); @@ -500,14 +499,13 @@ PHY_BBConfig8188E( rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); /* Config BB and AGC */ - if (phy_BB8188E_Config_ParaFile(Adapter)) - rtStatus = _FAIL; + err = phy_BB8188E_Config_ParaFile(Adapter); /* write 0x24[16:11] = 0x24[22:17] = CrystalCap */ CrystalCap = pHalData->CrystalCap & 0x3F; rtl8188e_PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6))); - return rtStatus; + return err; } static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel, diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index cb36b42c5ecc..b7c9e5fd9a59 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -606,9 +606,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter) /* */ /* d. Initialize BB related configurations. */ /* */ - status = PHY_BBConfig8188E(Adapter); - if (status == _FAIL) - goto exit; + if (PHY_BBConfig8188E(Adapter)) + return _FAIL; if (phy_RF6052_Config_ParaFile(Adapter)) return _FAIL;