Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2632840pxx; Sun, 1 Nov 2020 04:58:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZ0RZD0Fbgxf0Zxckmn77bewrBlh9iPSS0yJKnBVYrx5Duy0X1/xZLrtELPLDs9amQHzYv X-Received: by 2002:a17:906:519e:: with SMTP id y30mr10677953ejk.186.1604235494382; Sun, 01 Nov 2020 04:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604235494; cv=none; d=google.com; s=arc-20160816; b=e4e35swugNGLf4EhyKDvXcMzhLyef3vuRQGVEVsYkMP9WEUgFK0Mz/zv4wuCBF1LPN 940JfcO6U82qbYvt4yixEIGirDS1Gz1OO6OSRDD/3N20Vn9U6fnnybfZtOet9cMJDErZ IeJWiuwPd6i5ErIkpg0xRVpV6Y+DduV3NAnnZWoHAIfL8PW4J5SRUit0RiUKROkBAQye Jz/v17/bZql04Xxi/TIqLf6HA1LyLiJ6606uDTa+jdqZOWrtzGa/DWuXHr9iuyGecVO2 jQtwPQDLUnUh2gqbIPiGLxxpi1rP/BtJ9Ri0DhNIqzMIsXO38Y3uDjYIo8ozK07FCAUG Tvxw== 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=l7XDSYM/M1bjp6B3mGcMlMpBp17+2oQJyNz+LsCC7C0=; b=cIyZ3rQ/2C2dU88rn4a/a+o/semfwN27H/mw/dBOIwEpXPaSxf2fgbejexYtvwUXuN 9gM3mT0/p1iyR+iVGDQ4GoUEFsyfuOSmszvhu+uLyPFnjN/nXnpp+BSyikwKXHRDWKOT XUO5UZ69/EA4VS8DMyfA/1wArtkPOn4g1Y5ThhhefEU9MnnwCHenXN2ovv94YTOKBKxd xdYx9rzKM0OJ+ENnRIQQ65/htkPHuW79iU2iJqI+P9fTYQMSXQTaBiVA1nS9zTeHEruV VyKLgJoHT/p+RfD81amH4hE8i5tAMXGw0jg1rHKz3bP7oL5GnfDg5ELIp5XWLnFJDF7C qzCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BkErPnIG; 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 o17si8216618ejh.535.2020.11.01.04.57.52; Sun, 01 Nov 2020 04:58:14 -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=BkErPnIG; 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 S1727112AbgKAMxt (ORCPT + 99 others); Sun, 1 Nov 2020 07:53:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbgKAMwl (ORCPT ); Sun, 1 Nov 2020 07:52:41 -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 67450C061A47; Sun, 1 Nov 2020 04:52:40 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id e18so200887edy.6; Sun, 01 Nov 2020 04:52:40 -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=l7XDSYM/M1bjp6B3mGcMlMpBp17+2oQJyNz+LsCC7C0=; b=BkErPnIGHExmK5i2T9n1bweyav+KSix7ZdkSOZVnnpP2xleH7nRWgsirkohDkSxglf E09WL/h2LeHQh+UEVkKmts9FV/0blWdVnae5CMKo3S2iau4pGvYoAgKUQU4PRtEFba3F 130fDRHP5M7nujMDHp3HVeF+I1iPK2GgxLA6r9Bwsjluhd8R42z+JA299RNQ1QWY6lZ2 q2z3tpXG6oNZBeVBttkzVFQcqgmXLJ0OQccBMl8u/ihn5HLRbxARe6h4kGU52zQaN23d 2af/XZs2hdGwdOOjaeXC83j6gLI9yZBNWPZhCj4HGm/plDDrF6/W5ByPiBf1icIIx1FN Hn8Q== 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=l7XDSYM/M1bjp6B3mGcMlMpBp17+2oQJyNz+LsCC7C0=; b=ii+9y+g5ddoe8ZJKD8pB+f2uJt5F7Km4HebuX37OPDfD4BociCgjU4ywEEFxOcTljm 4RQFaJ3wTG9dDab/eCEm48rPnVeAP8YT2xWm0y2WZYF8LQEU2SOLoQJOb3MdTMTMO+3s LPdKgmdXtbeNciRH0ULhETPHb4T5DmRpeapxUIWE+fYYmudaLbBT+AKRAjgcoGqEwvcD 1QjGFr2K6S/G5u3mMFsY8iD/HJXJoo89x0zld9bhBCa4yy8VvU82a3tyA1/GaWn+3LO6 JE8IcYIWPXIM7OiafrYWEXrtPyK22dDKrZFONMd0/1lkRphRQ4BDZhgzEtZzBcSlMzDK L67w== X-Gm-Message-State: AOAM533DYqa8qeZ1MzCE2/Bo2hNJ0UeX8vTohut2Yy2Kqlg5Kx3OhfTh O27bRwk0QO9xFNq6OHIFd/U= X-Received: by 2002:a05:6402:b28:: with SMTP id bo8mr11982363edb.57.1604235159172; Sun, 01 Nov 2020 04:52:39 -0800 (PST) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id c5sm8133603edx.58.2020.11.01.04.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 04:52:38 -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 Subject: [PATCH net-next v2 14/19] net: phy: cicada: remove the use of .ack_interrupt() Date: Sun, 1 Nov 2020 14:51:09 +0200 Message-Id: <20201101125114.1316879-15-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201101125114.1316879-1-ciorneiioana@gmail.com> References: <20201101125114.1316879-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. Signed-off-by: Ioana Ciornei --- Changes in v2: - none drivers/net/phy/cicada.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c index 086c62ff5293..ef5f412e101f 100644 --- a/drivers/net/phy/cicada.c +++ b/drivers/net/phy/cicada.c @@ -87,11 +87,20 @@ static int cis820x_config_intr(struct phy_device *phydev) { int err; - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + err = cis820x_ack_interrupt(phydev); + if (err) + return err; + err = phy_write(phydev, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); - else + } else { err = phy_write(phydev, MII_CIS8201_IMASK, 0); + if (err) + return err; + + err = cis820x_ack_interrupt(phydev); + } return err; } @@ -122,7 +131,6 @@ static struct phy_driver cis820x_driver[] = { .phy_id_mask = 0x000ffff0, /* PHY_GBIT_FEATURES */ .config_init = &cis820x_config_init, - .ack_interrupt = &cis820x_ack_interrupt, .config_intr = &cis820x_config_intr, .handle_interrupt = &cis820x_handle_interrupt, }, { @@ -131,7 +139,6 @@ static struct phy_driver cis820x_driver[] = { .phy_id_mask = 0x000fffc0, /* PHY_GBIT_FEATURES */ .config_init = &cis820x_config_init, - .ack_interrupt = &cis820x_ack_interrupt, .config_intr = &cis820x_config_intr, .handle_interrupt = &cis820x_handle_interrupt, } }; -- 2.28.0