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;