Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756772AbdIRSdD (ORCPT ); Mon, 18 Sep 2017 14:33:03 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33272 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbdIRSdB (ORCPT ); Mon, 18 Sep 2017 14:33:01 -0400 X-Google-Smtp-Source: AOwi7QBagAzNtyoNA3/w6HCMJKl9qrkHkShwglERbA4zWd0KAU0Wp8U/XFlo5AmPlxZqVCQP4EB3Pw== From: Corentin Labbe To: peppe.cavallaro@st.com, alexandre.torgue@st.com, maxime.ripard@free-electrons.com, wens@csie.org Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v2] net: stmmac: dwmac-sun8i: Use reset exclusive Date: Mon, 18 Sep 2017 20:30:43 +0200 Message-Id: <20170918183043.8028-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1436 Lines: 40 The current dwmac_sun8i module cannot be rmmod/modprobe due to that the reset controller was not released when removed. This patch remove ambiguity, by using of_reset_control_get_exclusive and add the missing reset_control_put(). Note that we cannot use devm_reset_control_get, since the reset is not in the device node. Signed-off-by: Corentin Labbe --- Changes since v1: - added a note about devm_reset_control_get in commit message drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 57bb6dd7b401..1736d7cb0d96 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -854,6 +854,7 @@ static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) clk_disable_unprepare(gmac->ephy_clk); reset_control_assert(gmac->rst_ephy); + reset_control_put(gmac->rst_ephy); return 0; } @@ -1010,7 +1011,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) return -EINVAL; } - gmac->rst_ephy = of_reset_control_get(plat_dat->phy_node, NULL); + gmac->rst_ephy = of_reset_control_get_exclusive(plat_dat->phy_node, NULL); if (IS_ERR(gmac->rst_ephy)) { ret = PTR_ERR(gmac->rst_ephy); if (ret == -EPROBE_DEFER) -- 2.13.5