Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp460640pxb; Thu, 12 Nov 2020 08:00:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf0CYOq4LJSMa/8LMpvj5xBuvppTuhB22Kb9TJUR41dv6BaBWmDPTzZpo8ptr3poSjggs4 X-Received: by 2002:a19:c60c:: with SMTP id w12mr4629630lff.244.1605196848141; Thu, 12 Nov 2020 08:00:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605196848; cv=none; d=google.com; s=arc-20160816; b=ZC6vRVGZQi67/6vc1KTllyNxl7V8zs3fYalcz2TSFbz0Gh4aEikndc5YxczzJlzz0v 3qpQCYvpJC+grWopPRziMoyXpvCzgR7RBhIi8ZM1aOyvqExVIr9uw3GPDq7hjDzqiTYf LtyFebTw9ImSTdBbwxDPv/d0UEfKE3pcHWLbLh/z1gqRfPHn/rzbQ6hy0xcLDzJq7Fyy GMrbQHHh4/LU18ZM8e0/DxJ78R5aRLYC2JbgpmMtEx/QnRKmecnWPmFcomP67ibLhC4T c4cWGhWhWmtH7NXVZwSyqAWzbqLJ0q7gtrb8GShntC8byr5oFdIZdk/017NHXb3FZ2F6 Ty2Q== 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=EHyQQOuXf5BU03as2u/ud2yF/KPxzFMDQ2v3ffUTBGc=; b=zfnuuO7P6WkI2JgrEquXpmd6Rnmuf8M2mMeWb+i3tSjRYi1CSwZK2HVJ8WM1DWW0lt erGrAlWLbG1SqEZj1HoaLdiKWH2YEpVYv8dL2X9YYp3YvIdAuYtWGw5n13BHr0tgFj/3 vNybaQ10FmrAQ0cBXeccgxZK8PcOBbuSUcY8GEU0PUPmeMilSCWNKLXcb/MZoWgIraVi YDtr3GPI6mmA/ltaMOdTIYfKa1D5OrUXJ6sqnE7zGFpiWnCMoNAI54hWitipafUENgx6 y8iv5pURLvKhA6PlOyYAMeWJ62FalzALaDnTP9aep1yq+fAHUMtLyzrURjGU4LSzsxe+ ZsiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Utq/OY7X"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si4181698edo.577.2020.11.12.08.00.22; Thu, 12 Nov 2020 08:00:48 -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=@gmail.com header.s=20161025 header.b="Utq/OY7X"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728887AbgKLP6a (ORCPT + 99 others); Thu, 12 Nov 2020 10:58:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728867AbgKLP61 (ORCPT ); Thu, 12 Nov 2020 10:58:27 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 624BFC0613D1; Thu, 12 Nov 2020 07:58:27 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id a15so6882796edy.1; Thu, 12 Nov 2020 07:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EHyQQOuXf5BU03as2u/ud2yF/KPxzFMDQ2v3ffUTBGc=; b=Utq/OY7XRc/1p3xa6RHABkxuywYkGAebNmi4tUghrLQjwkT+P7YgNrGip2HfcBH39l idwnT3O57BEwpdF0Ks7RzAIfd2j2HQrw/k8kk2fHLNkO6YFqtwf6q8mYLAu4zzuAL5gO qn2VRmGUd/mYVHcJvdXu2SsSar0PzR3/QGv5yAtbxewQmS8Q5isxuxwp4o4k9LvmNI1Y Rp4BarqCdTMaarkQGuyhf1PoP0KI6WL2BeMKK3Dy9jrUJMUuPlbiASdYLMakmmIf0fas sWUDShjF7Glc0iO+Ut+qrpglv1sqhy/MJnqFVzAn+lZ/BfvKqz1OXFUzCfr8IvJzIXbz +LUg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EHyQQOuXf5BU03as2u/ud2yF/KPxzFMDQ2v3ffUTBGc=; b=QTmtzIGS6zQHANrppfLYlshDTf5ASwJXdBwHTmn/zeK7s6g4cV7PfPxnX97o8SCjV4 p3iNoX+RoHFhWh3IcuEB9ja7Entl3fYpv/am7DFlEzDWqeEVDQZywpKVxrP4ktRuuxP6 Nn0KeKaR2FNT/XSWV6XMj6i3yH0USaHvi5jiyVcqQP5dF7+goKylyNcAZjyvybQjHhnW i3e0jQDnyW0rn2RmBPOpVDD+FHfnaTT8kQsx4K0fPxM5GpHgZEbV8JoTCkLOUyzK0dZr c8mkA8h7yjnEYNKkw+HZ0ugRk8Pkop/1FX4jZczfXpM1PW+sbXvRWTiXCHMd6lU4ko5j HGnw== X-Gm-Message-State: AOAM531/hw29KGSl96W6gmRENStA5n06Paq4YOFF/7AjDFWT06f3Kbwy BoBQl26LUbysR9MPTrp4XOE= X-Received: by 2002:a50:ab5e:: with SMTP id t30mr413639edc.314.1605196706153; Thu, 12 Nov 2020 07:58:26 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id q15sm2546540edt.95.2020.11.12.07.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:58:25 -0800 (PST) From: Ioana Ciornei To: Andrew Lunn , Heiner Kallweit , Russell King , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ioana Ciornei , Christophe Leroy Subject: [PATCH net-next 08/18] net: phy: lxt: remove the use of .ack_interrupt() Date: Thu, 12 Nov 2020 17:55:03 +0200 Message-Id: <20201112155513.411604-9-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201112155513.411604-1-ciorneiioana@gmail.com> References: <20201112155513.411604-1-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ioana Ciornei In preparation of removing the .ack_interrupt() callback, we must replace its occurrences (aka phy_clear_interrupt), from the 2 places where it is called from (phy_enable_interrupts and phy_disable_interrupts), with equivalent functionality. This means that clearing interrupts now becomes something that the PHY driver is responsible of doing, before enabling interrupts and after clearing them. Make this driver follow the new contract. Cc: Christophe Leroy Signed-off-by: Ioana Ciornei --- drivers/net/phy/lxt.c | 44 +++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c index 716d9936bc90..0ee23d29c0d4 100644 --- a/drivers/net/phy/lxt.c +++ b/drivers/net/phy/lxt.c @@ -78,10 +78,23 @@ static int lxt970_ack_interrupt(struct phy_device *phydev) static int lxt970_config_intr(struct phy_device *phydev) { - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) - return phy_write(phydev, MII_LXT970_IER, MII_LXT970_IER_IEN); - else - return phy_write(phydev, MII_LXT970_IER, 0); + int err; + + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + err = lxt970_ack_interrupt(phydev); + if (err) + return err; + + err = phy_write(phydev, MII_LXT970_IER, MII_LXT970_IER_IEN); + } else { + err = phy_write(phydev, MII_LXT970_IER, 0); + if (err) + return err; + + err = lxt970_ack_interrupt(phydev); + } + + return err; } static irqreturn_t lxt970_handle_interrupt(struct phy_device *phydev) @@ -129,10 +142,23 @@ static int lxt971_ack_interrupt(struct phy_device *phydev) static int lxt971_config_intr(struct phy_device *phydev) { - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) - return phy_write(phydev, MII_LXT971_IER, MII_LXT971_IER_IEN); - else - return phy_write(phydev, MII_LXT971_IER, 0); + int err; + + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + err = lxt971_ack_interrupt(phydev); + if (err) + return err; + + err = phy_write(phydev, MII_LXT971_IER, MII_LXT971_IER_IEN); + } else { + err = phy_write(phydev, MII_LXT971_IER, 0); + if (err) + return err; + + err = lxt971_ack_interrupt(phydev); + } + + return err; } static irqreturn_t lxt971_handle_interrupt(struct phy_device *phydev) @@ -285,7 +311,6 @@ static struct phy_driver lxt97x_driver[] = { .phy_id_mask = 0xfffffff0, /* PHY_BASIC_FEATURES */ .config_init = lxt970_config_init, - .ack_interrupt = lxt970_ack_interrupt, .config_intr = lxt970_config_intr, .handle_interrupt = lxt970_handle_interrupt, }, { @@ -293,7 +318,6 @@ static struct phy_driver lxt97x_driver[] = { .name = "LXT971", .phy_id_mask = 0xfffffff0, /* PHY_BASIC_FEATURES */ - .ack_interrupt = lxt971_ack_interrupt, .config_intr = lxt971_config_intr, .handle_interrupt = lxt971_handle_interrupt, .suspend = genphy_suspend, -- 2.28.0