From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:41944 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932554AbeCEVex (ORCPT ); Mon, 5 Mar 2018 16:34:53 -0500 Received: by mail-wr0-f193.google.com with SMTP id f14so18813492wre.8 for ; Mon, 05 Mar 2018 13:34:52 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 net-next 1/2] net: phy: remove phy_error from phy_disable_interrupts To: Andrew Lunn , Florian Fainelli , David Miller Cc: "netdev@vger.kernel.org" References: <7a212841-6499-18be-b646-33ea69fb7da2@gmail.com> Message-ID: <8455599b-bb1f-5710-b67f-1c48fdb9271c@gmail.com> Date: Mon, 5 Mar 2018 22:34:27 +0100 MIME-Version: 1.0 In-Reply-To: <7a212841-6499-18be-b646-33ea69fb7da2@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: All callers of phy_disable_interrupts() call phy_error() in the error case. Therefore we don't need to do this within the function too. This change also allows us to use phy_disable_interrupts() in code holding phydev->lock (because phy_error() can take this lock). Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a6f924fee..c5aa773ea 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -662,19 +662,10 @@ static int phy_disable_interrupts(struct phy_device *phydev) /* Disable PHY interrupts */ err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); if (err) - goto phy_err; + return err; /* Clear the interrupt */ - err = phy_clear_interrupt(phydev); - if (err) - goto phy_err; - - return 0; - -phy_err: - phy_error(phydev); - - return err; + return phy_clear_interrupt(phydev); } /** -- 2.16.2