Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp633185pxb; Tue, 9 Feb 2021 08:45:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdjUSf9vm0TwmNWXywslyUXnT6Yqs5bTRHUlIxNuSgJbPRMrsC3Rre6MJ9uwzZmN9NC9J3 X-Received: by 2002:a17:906:15c7:: with SMTP id l7mr23327478ejd.226.1612889101236; Tue, 09 Feb 2021 08:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612889101; cv=none; d=google.com; s=arc-20160816; b=MVb1RfTWbMhanNGyeCPAFdMdB/meZbT55UkQhT1VlLpQbeixylRfPe+1GU40gaZ4ef hKq2pTkFsnp2le4+dFbUqiZivVcnqKCsGuabnv+Jl1c5D65TjLq2FCHb2/Py/MDEbMJn ZBJkLA0mm4VR3S8TOTAxP0k3chgnspItkYl7b1SO+4O8twnRpSM7hj6qHvPT43r0LyeN eKV0QPECDm4OmXSZJ0fk073MgThGW7q9Vbn4DSJl6CPx35ajioM2N9gwTnSeQayr06hc cya6yXfC95JeZGDoQCk8wSMcqDpvteFudJF6/k7OCXcAazYeiGZ9kVRCC557x079fBFy Sncg== 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=Bxc9KRh8pbUNYXBUDxUS9794Kzu6uOVSNNkAcgWJUD8=; b=Pdxb8oGv606fG68YIEPgNyPiyzRqhHBYqpZqtvMpJ/5+hAk5M2vb3RqEzUFHvj8sEF urV6WHpD4fcFPzmKvmBK3xsMt+gIqD5/RymjzsdPXY+CDmf7cwOMHnSZONUIDXXR26mX /NzgNOvDYzajIqQeycZmNxxbal5baE+9xW5jSur5eB18iocQO1Z3VBFgkStWnPYV9gKj L+vY6RVDRX5Z9VznHVDSDnpv2w4ydYGiKii8tTt9Wqh492vHsNmOKxAwEQOInmzVT3BE Km6mCWa0XElpeLVD+ewSjBdhqPoh1A79uyEKQvokUFRiml5Ka3ah+5y09/EJc5MdkosC lPeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=fJJEePwu; 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 q17si13938544eja.654.2021.02.09.08.44.33; Tue, 09 Feb 2021 08:45:01 -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=fJJEePwu; 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 S233052AbhBIQmh (ORCPT + 99 others); Tue, 9 Feb 2021 11:42:37 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:42063 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbhBIQll (ORCPT ); Tue, 9 Feb 2021 11:41:41 -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 87FF023E71; Tue, 9 Feb 2021 17:40:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1612888859; 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=Bxc9KRh8pbUNYXBUDxUS9794Kzu6uOVSNNkAcgWJUD8=; b=fJJEePwuubcMfqTMq/ADvCggymC4t+CkNxkq6F1ZnSwfvoPJVwwbH6gmSKPQAPwI6tqr3S 9qL21rDTtwlXZ7DFZ2WlQ6PerzTYB1xvqxFf5hwxtlJnvZ1uRo7iuT+yKR7aUO0/CTmzUT lHYUJHgfS0ga9JSNRMcegQ2fR/bsg7o= 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 4/9] net: phy: icplus: use the .soft_reset() of the phy-core Date: Tue, 9 Feb 2021 17:40:46 +0100 Message-Id: <20210209164051.18156-5-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210209164051.18156-1-michael@walle.cc> References: <20210209164051.18156-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 --- 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