Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1293275pxb; Fri, 13 Nov 2020 08:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyseBRbQX7NQLb7pWY9gWejvuq85jpjQr6FW2G0xnlFhDkYpoCXeo//O8EZID4mK0QJzS2p X-Received: by 2002:aa7:c2c3:: with SMTP id m3mr3393277edp.361.1605286719856; Fri, 13 Nov 2020 08:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605286719; cv=none; d=google.com; s=arc-20160816; b=JltNtV+MfC4eg+FK3fJEgNBlcuhgTcThWBqAxkOwAhYU6rVPt89M14UkSrGG7arT9V /Y72g/zWIVO8xuqOUfQKfd7c2yD1LZO5yY5V8vy5f00MtUlUV577wwUW288K7oDsUKxS tpbnnuGKwXhd87ERUCsJP3Q+2aC4PMkOYUNRVsFt4EUt+L5fS4HIzdcSbu1OiNdyrQXb xSO9oRXHYbMSmqLdfhuD6b0yRa25baQMpYXTd6dSp7F76RNGeG7utdE9QUrbLNYtR9nN cFlmI4QrELbf1j501teSSAIrSZ7oAAaEGG+sQJNl9D9Vo+XvyfGTTFtJXbnAeIaPwnlH 39DA== 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=vge37vqiU02CgdPucOmXsSEj8xXBY0lNHblegu8uTf+n4TdPottMgw9QhNOLTzYv4n dByxfem5KA0I4MIWGYb+7nxIKJPg2yNU+FpOoOy79rvLiAwkA75Dr3AjMYKnBEgyiY6b lZApiHoH0zebtTnnzxyknfIPJd09OHGu6AJielBr1B8ToyGCqXZz+h+jwNog34zzdyyR /IHcP5FH5NARqcQQmlcCOSMNp2Uupo3yASNweyjvR6v7sP+RPPkpQQm1NQ9CAxVfXKv7 ZIX4ao7jDs0O7X1g7SZ354YB4jfJc8E/qSwRbOIrD2METk84TxZkCa1EIzyXFUQPvicp PiHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Oac01yGw; 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 cw10si6312878edb.135.2020.11.13.08.58.17; Fri, 13 Nov 2020 08:58:39 -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=Oac01yGw; 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 S1726795AbgKMQyM (ORCPT + 99 others); Fri, 13 Nov 2020 11:54:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgKMQw7 (ORCPT ); Fri, 13 Nov 2020 11:52:59 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A6F2C0613D1; Fri, 13 Nov 2020 08:52:59 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id za3so14422269ejb.5; Fri, 13 Nov 2020 08:52:58 -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=Oac01yGweCMZw6kb246TzAFc9ilEewb/HZbnmGUX6zedWmsgFK6tX58LKExOjTv7LY sR0/1GNxFdcbYbIz6xUB5rJRMST1LCVK7WwOpOz4A9YnAM8BUO1u6gMrxEwMBpKNjoLo C9CP7xNg7iKQszCoRt68u3Kkuegldndix+cdW/bTbsx9CubAQufzvL80B0unkThyAefg NDjjKoaEmWBfc/h4KJr8ZSM2OzB7NQA//rjWuJQLd7C9GwMq+ynmihP+Ii96/YKSMMMa sk1W5xCQ2FfY55epYqPM2jib/8udUoUefM8R8Hcdbd/tDTNhRXk6sZ5PJ5DhmrJOt50Y H0xw== 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=JXtKmmTzA/aS/C7jyY15n+/th3C7jSExn+/mvv7ZGVdlBMy/NeOYZnz4wUb0qMOZMm bC0ac+cBde3nQR5/muCCytC2vOhw7rkJayRSXygUIDAj/9WfygWFlD+sv6GXb5EtNY3/ LGwBHeU36blja9uZdu0vadpsn1CxR9D3dGzXR9W+TYG13MWHqe8eKi15bA2cAfq44ycc 20EvfMriVErHnmtWFkSGxiiDX52a+uD4eZNPfmvdfuMN9NyEhUvp0GdV7y9ZBYe3PUId ePWHh5wX5s46sISGCLLQc8OJW7Csn94NkrLFjPRzz9KyUii8P9DNkozPGfrEt4xtNqIg GpcA== X-Gm-Message-State: AOAM533bxIosjlhSV1rxWfb5FnKT1zacq9B23LVs4VbmYmL9RDMeusMU SjzxGuxsEPMG24+zhA4k7gtB4HGFF0Jo4w== X-Received: by 2002:a17:906:57cc:: with SMTP id u12mr2840322ejr.163.1605286377686; Fri, 13 Nov 2020 08:52:57 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id rp28sm4076570ejb.77.2020.11.13.08.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:52:57 -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 RESEND net-next 08/18] net: phy: lxt: remove the use of .ack_interrupt() Date: Fri, 13 Nov 2020 18:52:16 +0200 Message-Id: <20201113165226.561153-9-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201113165226.561153-1-ciorneiioana@gmail.com> References: <20201113165226.561153-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