From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 983D3C433EF for ; Wed, 27 Apr 2022 10:45:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1241E83EF5; Wed, 27 Apr 2022 12:43:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="IwqB/YI2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90ABB83E4F; Wed, 27 Apr 2022 12:43:07 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C59C83EE7 for ; Wed, 27 Apr 2022 12:42:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21D20B82602; Wed, 27 Apr 2022 10:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34E11C385AF; Wed, 27 Apr 2022 10:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056165; bh=iAs9ETvJRpYB1MIZZFqPmive0id9Ryq6E/1lGLx76Lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwqB/YI2z5jjHu1XTUo4aV3aX+wk84y4PzfSwqTWTYwFNSCng7e8M5Tds/alzSxW2 WJ2+pDCxkqaAWMbZpNOJpbCfTavzrfDtsaCR4J8Hfl3RyC4P2A0k7KVx1MtDJKRyP7 uH5/NvoUpCM0lAMObew3XWdTA0qYuI83CMm48+FH0XPShmPxxPDhU9ndN8OMERSpug 92KbTQbL09G5hc9uE9bMXy6VSgwYbjJPjky9InCtBS8xsq/4gMuU3sMKL4IEvWo9nk pIUIWQItcynjdVmh4qfXdN7sIfMxMB5K+wTWv1khoaFbf++13Q0CDKd0MQBkgayhVo pg1CxQgmTgH+w== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?UTF-8?q?Pali=20Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 17/19] net: mvneta: Drop fixed_link member from private struct Date: Wed, 27 Apr 2022 12:42:00 +0200 Message-Id: <20220427104202.1205-18-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn Since this member is checked only at two places drop it and inline it's usage. Signed-off-by: Marek BehĂșn --- drivers/net/mvneta.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 4917857681..378789b632 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -273,7 +273,6 @@ struct mvneta_port { u16 rx_ring_size; phy_interface_t phy_interface; - bool fixed_link; unsigned int link; unsigned int duplex; unsigned int speed; @@ -813,7 +812,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp) mvreg_write(pp, MVNETA_SDMA_CONFIG, val); /* Enable PHY polling in hardware if not in fixed-link mode */ - if (!pp->fixed_link) { + if (pp->phydev->phy_id != PHY_FIXED_ID) { mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr); val = mvreg_read(pp, MVNETA_UNIT_CONTROL); @@ -1173,7 +1172,7 @@ static void mvneta_adjust_link(struct udevice *dev) * be added). Also, why is ADVERT_FC enabled if we don't enable * inband AN at all? */ - if (pp->fixed_link) + if (pp->phydev->phy_id == PHY_FIXED_ID) val = MVNETA_GMAC_FORCE_LINK_UP | MVNETA_GMAC_IB_BYPASS_AN_EN | MVNETA_GMAC_SET_FC_EN | @@ -1431,8 +1430,6 @@ static int mvneta_start(struct udevice *dev) return -ENODEV; } - pp->fixed_link = phydev->phy_id == PHY_FIXED_ID; - pp->phydev = phydev; phy_config(phydev); phy_startup(phydev); -- 2.35.1