Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1646546pxb; Wed, 10 Feb 2021 13:12:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsFb8rJK90Jlu52fDpWFBamOu2wnrHsqs8NZ6DlBgzzpm7VrVFgE5+aBba6tunYALBMYy5 X-Received: by 2002:a05:6402:46:: with SMTP id f6mr5025823edu.163.1612991570937; Wed, 10 Feb 2021 13:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612991570; cv=none; d=google.com; s=arc-20160816; b=fkLz/j7+RqXEaNrh7pPTlTaiCeAS2ryTF24ndd+gxWzbyp2wx1wwcB1SjhB4DFb7lW BW16Z4TMMvEES7Z75M0w1P7ROci27hae7vQ/qDgGYYCxa8CTtl3tK/ek9Sfaxh+2IRrM 8km6a2q/IURc1IWD1E/xCpvaAwBcr7q03TF1yR49HF0Cnr6GirfHK2oiFIC2AKIYleMI HN/NYDwBy3sSt3nfatKeOMYSbjVR4wuRwotppmON2sfmjJv0C1iZVnVi+R5bkrpv4sOs GsYeVeB++N5qF2i2NuQ3msBWxYQe6Kvu20dtQsW1wM/su1fiUKSHZD4huCST1Jtxxxjz yexQ== 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=H8PnrY2q/rK59Nzk8M+976MAG+3OqGNUiRTW7+/juhI=; b=LZnvn8wzHkeTZvDf/2pfvs//kV7CJaV9kwG3sTSZ9mJskFrEJkI0DeIcEtEqxaiEM1 ki4vui3effC2+WQufklO0MBylx8byZBoaz2BkBBya9EJgWQOhsA+V7yXkiwCpyE/3Tz7 Y7mHD/FPZsTc0yoGiB5b4xa7/BmxAXH0YswppZciCIfRohbpEyiAVBJkLNXU0Zzr9Bgt B86Jp9/hVmj+7m45YEr7iqXWQ7UxOfSO6yAzqG8NpnFz6a4oMjC1fPn18QrEzAl3w3fg rmVsXebjKuQ0HFPmG7AUgE9kmc7ROpcgUhwBBbIfaOKqJSVslVBHSo/Jny8hVANDRSM9 h1OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=QJnjxaez; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si2314737edh.270.2021.02.10.13.12.25; Wed, 10 Feb 2021 13:12:50 -0800 (PST) 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=@walle.cc header.s=mail2016061301 header.b=QJnjxaez; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233624AbhBJVLC (ORCPT + 99 others); Wed, 10 Feb 2021 16:11:02 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:40715 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbhBJVJC (ORCPT ); Wed, 10 Feb 2021 16:09:02 -0500 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id CB72B23E75; Wed, 10 Feb 2021 22:08:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1612991299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H8PnrY2q/rK59Nzk8M+976MAG+3OqGNUiRTW7+/juhI=; b=QJnjxaezD+ESrQidOkSNLXLUKOjEaVC4v8D1Km+GYqLagKPjhg8i9/u5nwikjGoIoo8zjV X24kyyNUNFIcJtXVdJP0CBM8m/d2kiA01DwkCpTNs+6FSZGnOArfuNZg1QLolOIaoINZt+ lm9jLJT33zWfg2MIocY6+cPUdIuix1Q= From: Michael Walle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Michael Walle Subject: [PATCH net-next v3 4/9] net: phy: icplus: use the .soft_reset() of the phy-core Date: Wed, 10 Feb 2021 22:08:04 +0100 Message-Id: <20210210210809.30125-5-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210210210809.30125-1-michael@walle.cc> References: <20210210210809.30125-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PHY core already resets the PHY before .config_init() if a .soft_reset() op is registered. Drop the open-coded ip1xx_reset(). Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn --- Changes since v2: - none Changes since v1: - none drivers/net/phy/icplus.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index 43b69addc0ce..036bac628b11 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c @@ -120,36 +120,10 @@ static int ip175c_config_init(struct phy_device *phydev) return 0; } -static int ip1xx_reset(struct phy_device *phydev) -{ - int bmcr; - - /* Software Reset PHY */ - bmcr = phy_read(phydev, MII_BMCR); - if (bmcr < 0) - return bmcr; - bmcr |= BMCR_RESET; - bmcr = phy_write(phydev, MII_BMCR, bmcr); - if (bmcr < 0) - return bmcr; - - do { - bmcr = phy_read(phydev, MII_BMCR); - if (bmcr < 0) - return bmcr; - } while (bmcr & BMCR_RESET); - - return 0; -} - static int ip1001_config_init(struct phy_device *phydev) { int c; - c = ip1xx_reset(phydev); - if (c < 0) - return c; - /* Enable Auto Power Saving mode */ c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); if (c < 0) @@ -237,10 +211,6 @@ static int ip101a_g_config_init(struct phy_device *phydev) struct ip101a_g_phy_priv *priv = phydev->priv; int err, c; - c = ip1xx_reset(phydev); - if (c < 0) - return c; - /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */ switch (priv->sel_intr32) { case IP101GR_SEL_INTR32_RXER: @@ -346,6 +316,7 @@ static struct phy_driver icplus_driver[] = { .name = "ICPlus IP1001", /* PHY_GBIT_FEATURES */ .config_init = ip1001_config_init, + .soft_reset = genphy_soft_reset, .suspend = genphy_suspend, .resume = genphy_resume, }, { @@ -356,6 +327,7 @@ static struct phy_driver icplus_driver[] = { .config_intr = ip101a_g_config_intr, .handle_interrupt = ip101a_g_handle_interrupt, .config_init = ip101a_g_config_init, + .soft_reset = genphy_soft_reset, .suspend = genphy_suspend, .resume = genphy_resume, } }; -- 2.20.1