From patchwork Fri Aug 25 14:38:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9922245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 572336022E for ; Fri, 25 Aug 2017 14:41:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49589283B0 for ; Fri, 25 Aug 2017 14:41:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E333283C5; Fri, 25 Aug 2017 14:41:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC052283B0 for ; Fri, 25 Aug 2017 14:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=15v12JgHrA9s3/PvidD72J5fQ+rS/Zgt5ADLL705edE=; b=bU+ gvmQiNlfFbteZbKxjmupRFnBOet3y1BRJ9e+0RHerdmsnCqgxknQmEIKfi1vFXmkNQiQqaw9tN0Jh GeaOnqoqwk5cXPQWCAyv5HUcsTscySl3DCKtVunVRsU2EA9tZfLz2PT9rDX6lF2uRNF0vPirMBQmZ NNYg2ztgJGK0Q0x+4WM90Gn04DgJSGEvuXJwYLfC7NSSbyEn//H92ltjciZqnPcIa8rwJgQjFeD7Y 6pO8TXc7CJwFdijATp5sFkA1VKQj01STb1f8f17jnMAvpCQR/ShsK3aZzh3TpJwP444f7aqxBmZnq l8jjk9VieSh2eY+4Yv8qp3MQh97wgyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dlFn7-0007AP-8q; Fri, 25 Aug 2017 14:40:57 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dlFmt-0006ac-Cr for linux-arm-kernel@lists.infradead.org; Fri, 25 Aug 2017 14:40:46 +0000 Received: by mail-wr0-x243.google.com with SMTP id p14so1607591wrg.4 for ; Fri, 25 Aug 2017 07:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3BXrJv8zP4XEFEzPLrDU/mO6bAo77tUoLLbUfz4qlOE=; b=OYbLFCpwnAip6QlBNVQwBUgcsCaGgwa9CNO8M+xTh4qfeB/mGgN4bjjO6qqcVoztX7 /J6f2ZBZVEJkSDEDiHIDb01aInj5teeyA23Or8noL/hNDktu6955rAjSRxZJ5P32AlFQ hXqkBTDLi0q/xQZsGs9PNVHbYW3szAY8SwIrKTHqQtd5TlzW+0iEFmzFa01Eb6d+XdL4 VzK1o7ZC7kXGMWGQlNkrpCNvx4A6kc5TbefYkn35Y8eARRPr/br85U3AfxyRJfu3gyyu ec6bcaZuj8kEpuMpL+9KQ2NolOUhzWm41DneLQ6+XZh1U1wHK7ML9AbrGG6SqzFD/Un4 xB6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3BXrJv8zP4XEFEzPLrDU/mO6bAo77tUoLLbUfz4qlOE=; b=I0slBT2JBzkDaCpJqrDJAVSf12YeXZ2UfPXDpNM5HpNq8iqp599clcfDWPeYSVnbVQ 1qKMDF8QThjn84+ZETskZcOoRWWGiHLflyY9sGgLgAeOGfw+Oh2+8o0C6s8lyV46MBKm 6Y+VJdc+IkHVlZ3X9uPUS9S2PYaJaFb2BxCRr2QLGeWCsiLdaB+oQQaV2xCDtk/pNm8M ZM/wWY/dzauIppJK3pNiee8r2NqHczUQJraWX1HBNrBLqlt3xp2xHz4s9d/n/BXK36Sz uMnxVvyWSdZ9spDv1/4Zif60EOeBqvRHWIb5UpG2BpoF4IgyyE0n2sfqzzvNZTRjyEOz g13Q== X-Gm-Message-State: AHYfb5gm4SkK2+FY9rHvdHYpcwLuwfi7XoKHpWsimO45h9vRUs3g4K+L rM/cuI1BUdOO5w== X-Received: by 10.223.136.39 with SMTP id d36mr5621383wrd.136.1503672021622; Fri, 25 Aug 2017 07:40:21 -0700 (PDT) Received: from Red.local (LFbn1-1-65-78.w90-118.abo.wanadoo.fr. [90.118.156.78]) by smtp.googlemail.com with ESMTPSA id h66sm1549071wmd.38.2017.08.25.07.40.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Aug 2017 07:40:20 -0700 (PDT) From: Corentin Labbe To: peppe.cavallaro@st.com, alexandre.torgue@st.com, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH] net: stmmac: dwmac-sun8i: Use reset exclusive Date: Fri, 25 Aug 2017 16:38:05 +0200 Message-Id: <20170825143805.21733-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170825_074043_728045_AB5D178C X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Corentin Labbe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(). Signed-off-by: Corentin Labbe --- 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 fffd6d5fc907..675a09629d85 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -782,6 +782,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; } @@ -942,7 +943,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)