From patchwork Sun Jan 3 11:25:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11995689 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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5026DC433E0 for ; Sun, 3 Jan 2021 11:27:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15CED20B1F for ; Sun, 3 Jan 2021 11:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbhACL0z (ORCPT ); Sun, 3 Jan 2021 06:26:55 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:35751 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbhACL0w (ORCPT ); Sun, 3 Jan 2021 06:26:52 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id C195D548; Sun, 3 Jan 2021 06:25:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 03 Jan 2021 06:25:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=+FVXHJywYn5HO +Q77R6/9hCLYI494XIlo4EmogXhRdk=; b=PfPGRuggemNVUlTt69LBqOFkYHinX a5BFY9pKFmvRoRw6LJppKoyYMBTpbpHP+8vrP91bXsOXjVbp1Is3ywpytwN2WbKs yOGCWMKqYeIxuS224gTeszjz+fnD+9F2i1MB5Am+mPI7x6X3DOZJNq14gynGS56X AMm1TOOLBHznQo8tb3ujB7SbmczQwEI7uKJUie7/6gbeCBIoJo0uifV1oxONqDQF 5VKMSdYWf1XG5+hTQMG01+EpUfP/rO2IjZ2JEriOc1x5fAwLxsP0y2eybMMXLrfN YyHG2/EMElSBh+FCCzlSC7wSnbXnkJJm7Rmuw5lXrzciAjO22KtIZjCKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=+FVXHJywYn5HO+Q77R6/9hCLYI494XIlo4EmogXhRdk=; b=Ac6pZWA6 eOWbsT/9McwQafA8yumTCGoGusZkn2MDhONWamLvNCB+Sl5CzRF7Dy0iET6tACYC BxWvSYIkDZhozOn3jtTp1dkzEyNfw24rEyyS1fvvQ7k/05f7Y0bkBOlHFKjfMvIC /wMQTQwrcplywpXScgrP3dACJRj/4jECy31U6C7KU0S8aDDuDYNqvyfp8fLKxxeK kcWSMgYlDPFdEf2mrYIUDTPxWLKHWIqD6+0XRq8o8OEcB5qG1HXIlplUN8OgAbVi DO2zaWOjS19fMUWvlLRAaO0ZPWQzosGhf7EPTqiejYGLY9psTXw+1TUxLPQsYwCo NQ1mWmXOW+TRyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 258F3108005B; Sun, 3 Jan 2021 06:25:43 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next 1/5] net: stmmac: dwmac-sun8i: Return void from PHY unpower Date: Sun, 3 Jan 2021 05:25:38 -0600 Message-Id: <20210103112542.35149-2-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210103112542.35149-1-samuel@sholland.org> References: <20210103112542.35149-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This is a deinitialization function that always returned zero, and that return value was always ignored. Have it return void instead. Signed-off-by: Samuel Holland Reviewed-by: Chen-Yu Tsai --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index a5e0eff4a387..8e505019adf8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -820,15 +820,14 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) return 0; } -static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) +static void sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) { if (!gmac->internal_phy_powered) - return 0; + return; clk_disable_unprepare(gmac->ephy_clk); reset_control_assert(gmac->rst_ephy); gmac->internal_phy_powered = false; - return 0; } /* MDIO multiplexing switch function From patchwork Sun Jan 3 11:25:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11995673 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 X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,TVD_SUBJ_WIPE_DEBT, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C123C433E6 for ; Sun, 3 Jan 2021 11:26:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEE47207FB for ; Sun, 3 Jan 2021 11:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbhACL0e (ORCPT ); Sun, 3 Jan 2021 06:26:34 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:49277 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbhACL0c (ORCPT ); Sun, 3 Jan 2021 06:26:32 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id B76CC52C; Sun, 3 Jan 2021 06:25:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 03 Jan 2021 06:25:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=s0u0iw4NXUklB tchF6xGq/pKW5YBdSZTP5OnSimeOLk=; b=sphcgAim3lcd6mwB/ux61x4dTrkfg riL2UosJfHrVDA3nrTZm/VQByJEdHkHLF2VT0oihehi7ZTN5UBGWL0YqXaTUrdLZ pfbKkX8nJY/NQT24y/P4vOBtSaA8V5l8ab2iV0uERBTJb3QQMM6mAkj9rR2hVa/G RdsMEsPxCl1GANlkQ69/7WEW1x7HonErpGlxI5f7frgt+tI0LVGEWp/COwNYTpu1 qtJBRxxOiyhvZXkH0PXBlNCAo5Ei1JgKJhzByccJa3lic1tiCaxW9V/CYvPLvwAG Wz4naIKj/ZCKhb8zd6A675/ZNux0Epy9asxJTi2mOIgGOovKo11nJRvmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=s0u0iw4NXUklBtchF6xGq/pKW5YBdSZTP5OnSimeOLk=; b=VgHTlXKh p5zz+qBdWN4xn2ejP40GDXG7zn2WtPFCwSloSalpwhqtkjrVD8SWxjv/WZGPeGrS yq3Hk3o9bCXo3XFINMFswEDFZXPDAR0PEJH1dxtKHmf282nf0gBfzvEVl5VI0dre ojL/mQQDXoBxfK0/AiKi6pQp7oMCakrYGh9x8mKVzX6EjPHYuzeL9X2+jKn90ckO 3ko/FQb3E2eYjy8Ws8Hd5tujuwh5edqRIzR+voa2CrvI1fUr6dKv/hjIflyYPnw5 O5/0X0SFyjcseRcRYwnEzQlplVwrekFbaEsuA99bLdvATPB947uoTepjFD6MSFWw uLOGvxPaVVf0ZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id B2BCF108005C; Sun, 3 Jan 2021 06:25:43 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next 2/5] net: stmmac: dwmac-sun8i: Remove unnecessary PHY power check Date: Sun, 3 Jan 2021 05:25:39 -0600 Message-Id: <20210103112542.35149-3-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210103112542.35149-1-samuel@sholland.org> References: <20210103112542.35149-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org sun8i_dwmac_unpower_internal_phy already checks if the PHY is powered, so there is no need to do it again here. Signed-off-by: Samuel Holland Reviewed-by: Chen-Yu Tsai --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 8e505019adf8..3c3d0b99d3e8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1018,10 +1018,8 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) { struct sunxi_priv_data *gmac = priv; - if (gmac->variant->soc_has_internal_phy) { - if (gmac->internal_phy_powered) - sun8i_dwmac_unpower_internal_phy(gmac); - } + if (gmac->variant->soc_has_internal_phy) + sun8i_dwmac_unpower_internal_phy(gmac); clk_disable_unprepare(gmac->tx_clk); From patchwork Sun Jan 3 11:25:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11995691 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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E4EC433E9 for ; Sun, 3 Jan 2021 11:27:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A8FD21E92 for ; Sun, 3 Jan 2021 11:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbhACL0y (ORCPT ); Sun, 3 Jan 2021 06:26:54 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:43401 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbhACL0w (ORCPT ); Sun, 3 Jan 2021 06:26:52 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id B8381542; Sun, 3 Jan 2021 06:25:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 03 Jan 2021 06:25:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=xMlquvf3yzLui EN8mbFrfPmz2sg7YCp1DdhC7ccdm/c=; b=eEIciF+9rZgKJxlYNf7F6ftlaJ58l wS8D5yUbr9D9PZdCHxFpjB9GWls0UA+CeMDMeByNw8CWMBL4FAasZ7aR/IjCQsCG pzgziJgSpLEPDkvbX1XsFrg1/kyqM9PkFAt2EKbModk2saX4eN0P+d3Be/kzAJ+z CJqw93xmBkjgRVgWlOM0IWVpEBRQA+FgTHYVM1gRWDdLwVVYGVp/2+BKltsygA4y xg75/UxU+Oujdnw5ZhjHJQFgi2FN4PgoJh6ky6zk+X4XmyfKMfTMNC1WelZybvBQ WjSABS2J3rbaF4T39VqtqTUNWMGjjaxpFS14saOr23t1kIaF6pljUmIWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=xMlquvf3yzLuiEN8mbFrfPmz2sg7YCp1DdhC7ccdm/c=; b=DcyZIdxT DDpLLCCnPKy1f1Zo5+SvZ6iiImF/OsTyibXoMKd2ok2aEgxl3HlGmC/rUNE+AfYa bg/sTK+5TSeSpmIYFWkHA995xsy5LydpVisFwedO2v6VX5ZiezYpAzBSsy0SJMJt okYBL3dg8waK2zTuXFM269nPI0v66NA6cFeM7i/lMKQZfWtwKDKkTyPGleav4GH1 NgDNoq5cJZYuMhv+UBSzxFJKPsw4DS0FDrYRuZf1gOu93KJzNxHnIkIIdVBiOr4E 147g25gT7PNoA6S09mKZUVlkePR1Fl260l2Cn/x6ZW3JWr1UFHnlaV101BXH6QdK Gi94FinsYY3Kjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B2C0108005F; Sun, 3 Jan 2021 06:25:44 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next 3/5] net: stmmac: dwmac-sun8i: Use reset_control_reset Date: Sun, 3 Jan 2021 05:25:40 -0600 Message-Id: <20210103112542.35149-4-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210103112542.35149-1-samuel@sholland.org> References: <20210103112542.35149-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use the appropriate function instead of reimplementing it, and update the error message to match the code. Signed-off-by: Samuel Holland Reviewed-by: Chen-Yu Tsai --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 3c3d0b99d3e8..0e8d88417251 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -806,11 +806,9 @@ static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) /* Make sure the EPHY is properly reseted, as U-Boot may leave * it at deasserted state, and thus it may fail to reset EMAC. */ - reset_control_assert(gmac->rst_ephy); - - ret = reset_control_deassert(gmac->rst_ephy); + ret = reset_control_reset(gmac->rst_ephy); if (ret) { - dev_err(priv->device, "Cannot deassert internal phy\n"); + dev_err(priv->device, "Cannot reset internal PHY\n"); clk_disable_unprepare(gmac->ephy_clk); return ret; } From patchwork Sun Jan 3 11:25:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11995675 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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F298C433E9 for ; Sun, 3 Jan 2021 11:26:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16B0120773 for ; Sun, 3 Jan 2021 11:26:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726653AbhACL0j (ORCPT ); Sun, 3 Jan 2021 06:26:39 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:38673 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbhACL0d (ORCPT ); Sun, 3 Jan 2021 06:26:33 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 4BA8D559; Sun, 3 Jan 2021 06:25:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 03 Jan 2021 06:25:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=0jMm0S9SFKrwV SbdgBC8QS4qosT0AHHQhVFIOD733mE=; b=dVSFOhyvJ5+f1s1NtlmtNQFbFRm10 oY49OrmV6U3T/IiCJMxBV3IKwUtHYBuPmSt/2Ct3zUM4HuwhmbRYEqRiz6aByd17 nc/2dMsXNkdr0sWgqB+ihdfXvyyGF19VTdO4SyhuU/4YWyrWg2bb1md+aF9FygTK wBPSsrVQih3TxcmcahyiKFHDtxpCA5llMv2/IiMe5GxoUK5XIyJW4FoRelds4+B8 yvw+O5570zNZQLNN2G+3uBVAGdG5zjliCRiKzdg+Btq/q8A2Tntbn31GyEIQKdr+ Cff5g9x2VfexswyPgtS1kLXFPzfNVWKwiXLVimweEIFy4KFde875RMgfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=0jMm0S9SFKrwVSbdgBC8QS4qosT0AHHQhVFIOD733mE=; b=YzoJWflS I2cVnsGvTjyYmD5+jt00BuB0PPvAm3o3jpu0+CqUJwu09sVTVVIDMqOfr6owdbiw cbo7IELcbzJBT3r6QTsEfN+tvI04T0Exb2K8+WIuW3bfwjO2475tpxOLNd2SCX+h 0ZSu+10MzoD2oNGUtuJqX8pgXu4sO6y4sAout1LbFCpzRHmA1yzliXnprnARiT7X 2kZZc4rj3RbFz6dK3ypVYoQ+RUaNBOT2w1TxYT88t/SEubtOn5iGSz6TILDy2XEw igCK9Svn1ZVn2wBkaDpP3vweKlqOH3or15SDjKewtiWpZk3zQdX2otwMeHkbUwdU +VZOfuFdgzfHQw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 25BA41080063; Sun, 3 Jan 2021 06:25:45 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next 4/5] net: stmmac: dwmac-sun8i: Minor probe function cleanup Date: Sun, 3 Jan 2021 05:25:41 -0600 Message-Id: <20210103112542.35149-5-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210103112542.35149-1-samuel@sholland.org> References: <20210103112542.35149-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Adjust the spacing and use an explicit "return 0" in the success path to make the function easier to parse. Signed-off-by: Samuel Holland Reviewed-by: Chen-Yu Tsai --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 0e8d88417251..4638d4203af5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1227,6 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) ndev = dev_get_drvdata(&pdev->dev); priv = netdev_priv(ndev); + /* The mux must be registered after parent MDIO * so after stmmac_dvr_probe() */ @@ -1245,7 +1246,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) goto dwmac_remove; } - return ret; + return 0; + dwmac_mux: reset_control_put(gmac->rst_ephy); clk_put(gmac->ephy_clk); From patchwork Sun Jan 3 11:25:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 11995695 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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65F57C433E0 for ; Sun, 3 Jan 2021 11:27:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A6872080D for ; Sun, 3 Jan 2021 11:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbhACL1U (ORCPT ); Sun, 3 Jan 2021 06:27:20 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:51585 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbhACL1S (ORCPT ); Sun, 3 Jan 2021 06:27:18 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 9A7DA560; Sun, 3 Jan 2021 06:25:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 03 Jan 2021 06:25:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=tlnaBS7FSiuy8 9dtVFPSHFaRijf3RFl2XE8UL3ebeVg=; b=A9e8wgKMfa37hxsHSSJiRVBTIrFZI 1HT8//uK1OtNmGQGz/g/3IWs9q3N84SV5Sy2jmlFYdroFCj2DUQDVVKc14hyTt9f Qi6w7wYnp4qTmzU2JYom0kWTrlPv186lePm+HJBLRCBygqbehAcAlvNtnjKyzZYR b94wySQDqnE4RxAQcdPBeiov7UrzPpSHuWPy0DU5NkWKRvF//epwkhBRATJwROZ1 7dyc8xP/3kBSuShzCQOCQWcmv5n2nkVv3JxeY72eOnoRW0RaZ7aB9yaedU4rIF6k EKNQJk8yjHExW40KbUP/eIuRlIbk/LbAiFH3Zqgu4R5fxIHFZnA7SejFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=tlnaBS7FSiuy89dtVFPSHFaRijf3RFl2XE8UL3ebeVg=; b=q3idQXzM OEXMQd8zvA3a/jW1H/U7Fkg1PUoRWRqch+rYReTm7/S8mSZps/0Ym2wrmSPBtCRu 16CBUuz8yeLQdj5nNAhW0zxqCg3Ot91Xu7tAnLldX9F29AS8Edetl/yVF2wuboes NgQuf6ZGgPZ4wvJKn1fEMIhSvKuRI0+KhNRZ0QJK0LKW0iGz+x6CE5y7bQAaRY7p ECLwxi5pVtRz4Lty0I24jX82Isz/EX7W+yJj5GPkJygeIfj4149/7NBIKxtxs9mw /Sh37xvRjWF6K8c4/5sKAQA5IjCsTN3xizURaW2zteQgo4Q6uY2KHwdZhyUZGmqB RywOVHvTprK9NQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdefuddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrhfuih iivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghn ugdrohhrgh X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id B3E8C1080064; Sun, 3 Jan 2021 06:25:45 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Cc: Ondrej Jirman , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland Subject: [PATCH net-next 5/5] net: stmmac: dwmac-sun8i: Add a shutdown callback Date: Sun, 3 Jan 2021 05:25:42 -0600 Message-Id: <20210103112542.35149-6-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210103112542.35149-1-samuel@sholland.org> References: <20210103112542.35149-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The Ethernet MAC and PHY are usually major consumers of power on boards which may not be able to fully power off (that have no PMIC). Powering down the MAC and internal PHY saves power while these boards are "off". Signed-off-by: Samuel Holland Reviewed-by: Chen-Yu Tsai --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 4638d4203af5..926e8d5e8963 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1282,6 +1282,15 @@ static int sun8i_dwmac_remove(struct platform_device *pdev) return 0; } +static void sun8i_dwmac_shutdown(struct platform_device *pdev) +{ + struct net_device *ndev = platform_get_drvdata(pdev); + struct stmmac_priv *priv = netdev_priv(ndev); + struct sunxi_priv_data *gmac = priv->plat->bsp_priv; + + sun8i_dwmac_exit(pdev, gmac); +} + static const struct of_device_id sun8i_dwmac_match[] = { { .compatible = "allwinner,sun8i-h3-emac", .data = &emac_variant_h3 }, @@ -1302,6 +1311,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); static struct platform_driver sun8i_dwmac_driver = { .probe = sun8i_dwmac_probe, .remove = sun8i_dwmac_remove, + .shutdown = sun8i_dwmac_shutdown, .driver = { .name = "dwmac-sun8i", .pm = &stmmac_pltfr_pm_ops,