Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp308458pxx; Thu, 29 Oct 2020 03:14:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ1k+XPWsz4oGhvlJ13TIJ4fZom3M1haOqknhTVTPseHgajF2k1r3QyH9fiT3AYy+Dw5Eg X-Received: by 2002:a05:6402:1615:: with SMTP id f21mr3265833edv.257.1603966456528; Thu, 29 Oct 2020 03:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603966456; cv=none; d=google.com; s=arc-20160816; b=m3lUaEgJEPaaiyuaIJ4YoI31+Mkxv6tKN9NxBFj9kEqVjREaNHy+kxYiK48ELJoTCt 8MIt54q8aNQEvXs2csVM88k/XifqMHQgIfH8j4ieqK5k364jUCSgmN0lKNN3YXUZs6tF qCkovcx0WnU2QqvyiMhp9Oa0gdAh8VPOI/qaEZymFhslh5kCiRvJb7ehdLwIMdPBJDhF whu/9TzewCoGOSRku1tZITxqGKn3q8BWHvu5nL0sxjAe4QUURwcR8axpC87HixjT3Jme JCwtrJrz0RQNJUJwu/Bx4OSF89KnyTmmusWW14LLjaLZCYZ6Iqb9EGzjoroFlB+QJrQ/ 7vuA== 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=CRDXjdq7k2ZUfERILal+mcfDKo9tm5bE4JR2tkEJbc0=; b=FXmoHGOe3J659M2m7opxJdf4qIOVuYoaPizrWicgKzKLuxniyaNzmFNruiru1jMgpy 5m0TLaZd5fhteqIseyocFOj43UGUq8uQ6E61q61B8x+7wW10b6GN7mGg1cZVsB4aYTNK u4JY0DZ1nQkKCBfUgbqzZ7O+hR78vhq7t8zA3cpLbKeKNOeefSqzGoM3p9Btf1qyq+FE mIpW/QtmBdkQybK8v/tuxyoQKw9xBxj9YRO6liXcX4f1EBj5numZdQXEgyb+rV776VCL svkjfpkGCMbh1zPx2Q2Qbjh84+zQvMI0chdS6wwW0bzDl2GH9z6I02JzGRQ0bKSgdkfU oKUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U6OZo3vC; 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 f2si1428703ejc.542.2020.10.29.03.13.53; Thu, 29 Oct 2020 03:14:16 -0700 (PDT) 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=U6OZo3vC; 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 S1726890AbgJ2KJq (ORCPT + 99 others); Thu, 29 Oct 2020 06:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbgJ2KI7 (ORCPT ); Thu, 29 Oct 2020 06:08:59 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A0E4C0613D2; Thu, 29 Oct 2020 03:08:59 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id p9so3024060eji.4; Thu, 29 Oct 2020 03:08:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=CRDXjdq7k2ZUfERILal+mcfDKo9tm5bE4JR2tkEJbc0=; b=U6OZo3vCS2JK6FXlRnj3ScqcncSzdqY+4mXs3vnyVmL+qPC8Tcj8F0WNrlkG6hQhSs arISjM2PGBiWlFwiag99q+A4QDY+vYDzkF5501ScZ3FbKENkXvz3hfVvPTMGW7DL4leh 6L9cfOo66fumFkFmajLoYuHdwjk6mz1sMXm8vpLRA4Osu2ttK0IjfpwJ+fh0oO1W79kC kcWi3j3e33NQkteOFwZhi/9CsaTLeh6gMexUXiuBzVp5zr9vNCLxKX3vEelTc5J7++IQ +EH35WK/wQKi0uR+w0dgV0eg3PHSmS8gzT0vyVJI/a+yNH0zP3OV7V8WZZNlPoQ1vASn HbeQ== 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=CRDXjdq7k2ZUfERILal+mcfDKo9tm5bE4JR2tkEJbc0=; b=ik/ZQaT/HZF+GZqqrBrfYNpjR2CwzcBHvV+imLl3BvfOHQexkjsmmVzlv3kAFPd/zJ YpJvCyOj42XfF8sjmTe2qTduJbpEtH+zll14i4OwjRyEbYhCJ4XM9Y3puyBJh5kHFvNa 9Esmo9GgeP1jbsdzvwiehjluLZq82lUZ9qfYkSOKOV/y6pVPhHisFJOSmDUY3rL9ziSJ eiEJV0e1oqAXxQlfgO1BKA37ujJPIiQieHZHjy6bfXzn56au8BGKkz+q8d5oN83PSUYF tWxWrIH85xVinXu1b5TGGwmr16rUU17pEH4CnZPtn63KhDFNOUTMp791uZCNEJ2PBKf4 XWQg== X-Gm-Message-State: AOAM533MQmzYj5snBZFETqAHxciqyARq5Xa+8bSCTznDzhwPaeddhbUT cvuHewlvLT1jG9fx72lQoZA= X-Received: by 2002:a17:906:70cf:: with SMTP id g15mr1484853ejk.323.1603966137875; Thu, 29 Oct 2020 03:08:57 -0700 (PDT) Received: from yoga-910.localhost ([188.25.2.177]) by smtp.gmail.com with ESMTPSA id m1sm1198650ejj.117.2020.10.29.03.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 03:08:57 -0700 (PDT) From: Ioana Ciornei To: Andrew Lunn , Heiner Kallweit , Russell King , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next 14/19] net: phy: cicada: remove the use of .ack_interrupt() Date: Thu, 29 Oct 2020 12:07:36 +0200 Message-Id: <20201029100741.462818-15-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029100741.462818-1-ciorneiioana@gmail.com> References: <20201029100741.462818-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 --- 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 03b957483023..5252ad320254 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