From patchwork Wed Feb 16 13:22:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corinna Vinschen X-Patchwork-Id: 12748599 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60DE2C433EF for ; Wed, 16 Feb 2022 13:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbiBPNXc (ORCPT ); Wed, 16 Feb 2022 08:23:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbiBPNXP (ORCPT ); Wed, 16 Feb 2022 08:23:15 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DAC629E949 for ; Wed, 16 Feb 2022 05:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645017754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=U/b62GEK2dyHC912MlELV2N7tkrAytvFeMbNC5x1Xa4=; b=dWd+L5IMzBKpY/UdJNQLEgFtP7pSogV/ZzPr8CQrUHw80KHuC+W0XW7lA2I2Eqfy1y0Avv fzoxF1PnGDzkUs9581HerQKxNjAWQa9ZUy6gAvK7Z7b417Hs7Fc7BL7aC6jAoFTFqRBX5r 6i39+b4spVaP9qS1dO+C5m446Nlep0Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-74-kgUZ2x2yPziN0t5gmb0RhA-1; Wed, 16 Feb 2022 08:22:30 -0500 X-MC-Unique: kgUZ2x2yPziN0t5gmb0RhA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73BD1802B7E; Wed, 16 Feb 2022 13:22:29 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15AFC6E1BB; Wed, 16 Feb 2022 13:22:29 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 7EACDA80D35; Wed, 16 Feb 2022 14:22:27 +0100 (CET) From: Corinna Vinschen To: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Vinicius Costa Gomes , Sasha Neftin Subject: [PATCH net] igc: igc_read_phy_reg_gpy: drop premature return Date: Wed, 16 Feb 2022 14:22:27 +0100 Message-Id: <20220216132227.356186-1-vinschen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic and if it's not 0, returns immediately. By doing this, it leaves the HW semaphore in the acquired state. Drop this premature return statement, the function returns after releasing the semaphore immediately anyway. Signed-off-by: Corinna Vinschen --- drivers/net/ethernet/intel/igc/igc_phy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c index 5cad31c3c7b0..df91d07ce82a 100644 --- a/drivers/net/ethernet/intel/igc/igc_phy.c +++ b/drivers/net/ethernet/intel/igc/igc_phy.c @@ -779,8 +779,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data) if (ret_val) return ret_val; ret_val = igc_read_phy_reg_mdic(hw, offset, data); - if (ret_val) - return ret_val; hw->phy.ops.release(hw); } else { ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr,