Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3491845pxf; Mon, 29 Mar 2021 03:53:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0nCwqGas6YgeLJp+Ea8A7DU40+UG/bmgtopSKLMNR0bhqs9iXlF5wJ3mqb9CiRoSu1Bv1 X-Received: by 2002:a17:906:d790:: with SMTP id pj16mr27291465ejb.255.1617015226057; Mon, 29 Mar 2021 03:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015226; cv=none; d=google.com; s=arc-20160816; b=Hl5wlR2+IwKu4NOZ/Pvxe4qP+J5ywAa2c4TL7agf80tc9+uw3UrxaUyGb5+KmHTF2k 1bWcvWnbchqpxRZ38vaxyKaIPeiDNpBzyFYVXk+ulIraVLVxzplbVbk3uJCu2NwxAIRx fe+bjQ9VM4FWXCq/TgzUw5YeooTQgGDic04W4Pj2R54dvu6RiSjWeEtjbsgbN19+WYe5 tqOJ+vsDCwzvEv11dlB0qQarm6rFMrtVxQNOSkgRW4MtfeJsivkHkuDrO/h7MSvTDWmc 8RaFiFB0q0tDXICUlfSEEHgD+vgAiTRSM9ZWGFSsFt2U/shbmyNGPer3/AE3av2nlJTJ KUEg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bZCSF1TyOXBKvYdr+5pvtL6xpZ47XwUGmx0cjnF8ZSY=; b=PnJqrJDQyBpg/kHqUHXBw9NGWRz8U01s9De0dwKRLR7E/2DBZs0jC5TLf7Zi35fTpc fmX41qM7PGvWNrJlrzFkCHo/tgkt26lo42T7yT6AAODMgBbFPoX1T/Gd6pZNOqjjqxYe 7VwukpaFKQ4aTDeFZIEsW71n658Xd9fheh2aPwPmXvRGwjefrcvPl3vYYbFUMR0ijgb+ kiispaA127738jVmPh7oJBMt94regMLFMjzA2CVyvAX+CRDcVeOXsCfCVOQPt2FEZbLe hX5AunXjhS7JqRC8pfOICc1FVoLl50yzDAFMDskSudFT0iA/uXGo9jGCU7AIRku3rXCD +Ilg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jonJr/hy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 40si12467776edq.26.2021.03.29.03.53.24; Mon, 29 Mar 2021 03:53:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jonJr/hy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235464AbhC2Im4 (ORCPT + 99 others); Mon, 29 Mar 2021 04:42:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233001AbhC2IYy (ORCPT ); Mon, 29 Mar 2021 04:24:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85C1B619B4; Mon, 29 Mar 2021 08:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006285; bh=eyBy7NQX+haWMqdNHTQLb7bD6fRAY9Lnc9ZIE3KEXC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jonJr/hyaWRMJu4v69Mlmgwl/iEEA3ra+6/0JvNlRZTBQc9LUHNfJfpNXnCbNyyLI ZjSGq2JEv0zTwAiF2j5W8OlFqHANA0hRCBmoHVjrh3JhDwdkll3PXu7IyaSxNS8OVb sRCm/cH0NJZENnArlLVAD+IxdCV7lmAfHqzE12AQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 186/221] net: phy: broadcom: Avoid forward for bcm54xx_config_clock_delay() Date: Mon, 29 Mar 2021 09:58:37 +0200 Message-Id: <20210329075635.336327630@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli [ Upstream commit 133bf7b4fbbe58cff5492e37e95e75c88161f1b8 ] Avoid a forward declaration by moving the callers of bcm54xx_config_clock_delay() below its body. Signed-off-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/broadcom.c | 74 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 739efcce6dd5..88e9708e0562 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -26,44 +26,6 @@ MODULE_DESCRIPTION("Broadcom PHY driver"); MODULE_AUTHOR("Maciej W. Rozycki"); MODULE_LICENSE("GPL"); -static int bcm54xx_config_clock_delay(struct phy_device *phydev); - -static int bcm54210e_config_init(struct phy_device *phydev) -{ - int val; - - bcm54xx_config_clock_delay(phydev); - - if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { - val = phy_read(phydev, MII_CTRL1000); - val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; - phy_write(phydev, MII_CTRL1000, val); - } - - return 0; -} - -static int bcm54612e_config_init(struct phy_device *phydev) -{ - int reg; - - bcm54xx_config_clock_delay(phydev); - - /* Enable CLK125 MUX on LED4 if ref clock is enabled. */ - if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { - int err; - - reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0); - err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0, - BCM54612E_LED4_CLK125OUT_EN | reg); - - if (err < 0) - return err; - } - - return 0; -} - static int bcm54xx_config_clock_delay(struct phy_device *phydev) { int rc, val; @@ -105,6 +67,42 @@ static int bcm54xx_config_clock_delay(struct phy_device *phydev) return 0; } +static int bcm54210e_config_init(struct phy_device *phydev) +{ + int val; + + bcm54xx_config_clock_delay(phydev); + + if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { + val = phy_read(phydev, MII_CTRL1000); + val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; + phy_write(phydev, MII_CTRL1000, val); + } + + return 0; +} + +static int bcm54612e_config_init(struct phy_device *phydev) +{ + int reg; + + bcm54xx_config_clock_delay(phydev); + + /* Enable CLK125 MUX on LED4 if ref clock is enabled. */ + if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { + int err; + + reg = bcm_phy_read_exp(phydev, BCM54612E_EXP_SPARE0); + err = bcm_phy_write_exp(phydev, BCM54612E_EXP_SPARE0, + BCM54612E_LED4_CLK125OUT_EN | reg); + + if (err < 0) + return err; + } + + return 0; +} + /* Needs SMDSP clock enabled via bcm54xx_phydsp_config() */ static int bcm50610_a0_workaround(struct phy_device *phydev) { -- 2.30.1