Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1290916pxb; Fri, 13 Nov 2020 08:54:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJymyy0kxOZMsSmwWKKGEgBZleJ1aWaAT+HhUYcKYkzStdxwF3i7KIpN16oR1KWeeSREDsSn X-Received: by 2002:a17:906:d8a8:: with SMTP id qc8mr2777650ejb.149.1605286490193; Fri, 13 Nov 2020 08:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605286490; cv=none; d=google.com; s=arc-20160816; b=C56noRtB7cy/io5w2ULODvny4aMe9ymYX7fPufRWa2WOpBZWD+iuveAmDjx77000Ve LS/o4Ihh7Xt57L0WBgDMDIMaOIQ6E7X41FV91t8SRjAwTqR0t+uQ6gIXSB86cMImx+Gm 0SyVBhXX981zSotVXS4bj3vMzdsOHGbbZbGrdghWncuVuke91BMEQB/SMc6bZzIJCoAb jY97ifQMbBoB57R/fvlzehDYetVdR38m31szgabteamyjoZ2tezBo9q10J35E1YxVedn SuFuYOiMKTFGm9rnseAiaCnbk90fScYkvthoj2pFtImz3/RxUWEnegB67YTfeL+gjTP9 2L1g== 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=5eEkZyJuYqDgw3qo/V0uy1CW8YE9RreYkILxojzWYTQ=; b=Bb43rb8HAymADRJbnz+Zzh72DG6zjmn8ir+tL/ai2NhSfQrNVLATVVyCsblEjiGBx7 tAjqoJqnCd3LsJUNR8SBDTatY2eEsBSijtth1UM8ViFxGxLrpd0BxUZAjnmorQMl/88K A56ZUVwnDfsVio/DqyITBQlBLNGITPlgBohEozgMIsUAXQ1KLL16IacQTbk3C0iKBumH TLIDqmN5lfptfYR+JghH8qhpfz8unNGWM7MMxSEhULtGigsMh5S7/2r5Ds7UG/lWBN1i lHXc1Wj5Q9L40zR9eKH07rY4J9zRu60VqUGvR4n3UYzXaYdb/1QFnmOTl82Cgh432myl IDUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yrv2YuWO; 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 s17si5841284edt.578.2020.11.13.08.54.27; Fri, 13 Nov 2020 08:54:50 -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=Yrv2YuWO; 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 S1726221AbgKMQw5 (ORCPT + 99 others); Fri, 13 Nov 2020 11:52:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgKMQwz (ORCPT ); Fri, 13 Nov 2020 11:52:55 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3355C0613D1; Fri, 13 Nov 2020 08:52:54 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id p93so11457564edd.7; Fri, 13 Nov 2020 08:52:54 -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=5eEkZyJuYqDgw3qo/V0uy1CW8YE9RreYkILxojzWYTQ=; b=Yrv2YuWOhbVzXh1LBqv1pj5PXOMpRA9ov8YzdJ5CniscasZ7AJ+tNSk0hYQNnYLHJf 8YVStB40Eu6+ON5xr2Yslu8VpJOGtMbCK/rXWOTJXd3o3kvUIPrqzzcWuFT5H6Z4LR1M cDSdthAZKWKgPO3x3jQ9ifQ4Q+gMOadEcb82oOQD/j6dzRa1HE89SZ0emwCPAn3lAPo/ oZyNUrvpcZvNJIEFz+PxUqKr+tGbrd8esSteuEe66eq9DuKK0PeawKj0MY+hPLYSGEms xlHqUcIrMACl+seKzPYnvddWVlOlY0UcLHN5F5oVvU0a6IbrQ/qBB1oh3qF2JStaBBKe PFfA== 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=5eEkZyJuYqDgw3qo/V0uy1CW8YE9RreYkILxojzWYTQ=; b=TvgF1Ao91pkoNxOPokdEMPH2fOLDBw7fJxCb/TDcBBM+WGAFPWuvY3rS3JCHJWrAoi Q2rV4V3cgA/DhHYts5EPjSRyGUxDudOOt/MgLAV9Slg/xrgCNZ1D1xk12WYappKmZ0Cq oY0kt3R4SucSwk+tZbDs+Z5yZYtD0lmz4MD/XJ/SBu9tL6MZIBEnUpf179fH8WPKBoiZ ElTZf65MdT0EQ21CpQCoB0rSFDK6PURzJQI6opOk0jjM0XVOfpVkRYjZpaMk2/Dmtapd rOMckJ8GvGfiwVsBz9KcCVR4jsq4A48H3pnQSS+BskTJy2q3Vya3hjd4qO8jqaIcxOon l3SQ== X-Gm-Message-State: AOAM530gaZN/VUfkjzgxuiBlDi9PN008UU8CpTjL1+5w6M/oDp/D9u7S d3MGuKv8GNj4acEQx8AcFt0= X-Received: by 2002:a05:6402:755:: with SMTP id p21mr3447192edy.349.1605286368789; Fri, 13 Nov 2020 08:52:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:52:47 -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 , Kavya Sree Kotagiri , Linus Walleij Subject: [PATCH RESEND net-next 02/18] net: phy: vitesse: remove the use of .ack_interrupt() Date: Fri, 13 Nov 2020 18:52:10 +0200 Message-Id: <20201113165226.561153-3-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: Kavya Sree Kotagiri Cc: Linus Walleij Signed-off-by: Ioana Ciornei --- drivers/net/phy/vitesse.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 9f6cd6ec9747..16704e243162 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c @@ -275,25 +275,14 @@ static int vsc8601_config_init(struct phy_device *phydev) return 0; } -static int vsc824x_ack_interrupt(struct phy_device *phydev) -{ - int err = 0; - - /* Don't bother to ACK the interrupts if interrupts - * are disabled. The 824x cannot clear the interrupts - * if they are disabled. - */ - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) - err = phy_read(phydev, MII_VSC8244_ISTAT); - - return (err < 0) ? err : 0; -} - static int vsc82xx_config_intr(struct phy_device *phydev) { int err; if (phydev->interrupts == PHY_INTERRUPT_ENABLED) + /* Don't bother to ACK the interrupts since the 824x cannot + * clear the interrupts if they are disabled. + */ err = phy_write(phydev, MII_VSC8244_IMASK, (phydev->drv->phy_id == PHY_ID_VSC8234 || phydev->drv->phy_id == PHY_ID_VSC8244 || @@ -420,7 +409,6 @@ static struct phy_driver vsc82xx_driver[] = { /* PHY_GBIT_FEATURES */ .config_init = &vsc824x_config_init, .config_aneg = &vsc82x4_config_aneg, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -430,7 +418,6 @@ static struct phy_driver vsc82xx_driver[] = { /* PHY_GBIT_FEATURES */ .config_init = &vsc824x_config_init, .config_aneg = &vsc82x4_config_aneg, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -440,7 +427,6 @@ static struct phy_driver vsc82xx_driver[] = { /* PHY_GBIT_FEATURES */ .config_init = &vsc824x_config_init, .config_aneg = &vsc82x4_config_aneg, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -449,7 +435,6 @@ static struct phy_driver vsc82xx_driver[] = { .phy_id_mask = 0x000ffff0, /* PHY_GBIT_FEATURES */ .config_init = &vsc8601_config_init, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -495,7 +480,6 @@ static struct phy_driver vsc82xx_driver[] = { /* PHY_GBIT_FEATURES */ .config_init = &vsc824x_config_init, .config_aneg = &vsc82x4_config_aneg, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -505,7 +489,6 @@ static struct phy_driver vsc82xx_driver[] = { .name = "Vitesse VSC8221", /* PHY_GBIT_FEATURES */ .config_init = &vsc8221_config_init, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, }, { @@ -515,7 +498,6 @@ static struct phy_driver vsc82xx_driver[] = { .name = "Vitesse VSC8211", /* PHY_GBIT_FEATURES */ .config_init = &vsc8221_config_init, - .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, .handle_interrupt = &vsc82xx_handle_interrupt, } }; -- 2.28.0