Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp461780pxb; Thu, 12 Nov 2020 08:02:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxo4UZVqEv7xnSSK5fyW47Z+JMaFpxyiouKFKobQgSHrdg/6yJSgI2aouiZPEHqiXDSwQ0A X-Received: by 2002:a17:906:888b:: with SMTP id ak11mr30547342ejc.278.1605196924434; Thu, 12 Nov 2020 08:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605196924; cv=none; d=google.com; s=arc-20160816; b=mQB75iV6BqErPa4dl5dCnxCwOnlM1cfACsom4zV2tRVGYz9Wb3xFl7HFFl3v4XIjFZ pEu1v7outnWJGPg6pGmjYEeKetbt2qNfvlGzF248xnXrAjv+MTZdh0rQUDh6EY+US3OY Wdi8/4WjLocQsamsRrOpPuMZJ1+lWtlzdffVaPnGgDGdrMiZlfdQpXwGJxBXN+odjW5M t0htolD+b8pntNOmHfeJfOlAgk7gV68NB72f3ZVBxNVlS0H4c7zuWBWZRRsjPWTtvC7U xIlG1by4hYN1Rj41jyK0Utww4Bd4Vv26GfWuJAqe8WBvG0SNJLlj8A9SUEsWM0cG5tS7 fDvQ== 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=aWtwI+k7UCBs0l74OtNTgocL7WE2uWiSxbu1sqlhGi0=; b=DVioT9BKWQAlKVHqr1aqv1QzXnvMF92AXIWXLLML1HRXFT3xC6Q0KAYYvzxslmnLmQ Bw312G1Rv38xARH1D0NgMl/ayq1kdmUK/+E/E6enhs7RaUKaOyeYCErrm+brFLHhEHnP iJakc9i9fhPXo/44JY6AU0nsYjtWNfQA8R8Xen4ETIeO/jJsmdHud51EqsbnoMQAHm20 7kR62LcJH/rO+Gt6mgzOc8vLr5vrhAAGRCOrE4wpcF3utsCtW0tW5quDYvdTlU1/XE4r 1RYDH/To+JAX6guIr0GL1SNWAsZyKETmGKF3AZXEi2/PEd9QylevR+QTnbve7K5xSRhO 3pbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J1itocdu; 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 h13si4446400edn.268.2020.11.12.08.01.34; Thu, 12 Nov 2020 08:02:04 -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=J1itocdu; 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 S1729008AbgKLP7G (ORCPT + 99 others); Thu, 12 Nov 2020 10:59:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728925AbgKLP6i (ORCPT ); Thu, 12 Nov 2020 10:58:38 -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 ECF1AC0613D1; Thu, 12 Nov 2020 07:58:37 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id f20so8585354ejz.4; Thu, 12 Nov 2020 07:58:37 -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=aWtwI+k7UCBs0l74OtNTgocL7WE2uWiSxbu1sqlhGi0=; b=J1itocdu74iBJHe9bC3lu+mulg15sQhTODrKNljLmDe1HbchhgOGq1zytThZ2AVlv7 uWoZb1MNv1JeN6xii6ltpfx3c/deg7GAQw6nBBacDVRloIPaKvlCQGrCSFPmQlFts3Dv 9Brme+ZJs91T0AOPL+UI2oVnYNmIhJuJOXghGc/oUpQN3mLZPv+YoRcVAnDvWndIURqv E0pb/KKwbmfrMfcmabMilIV6ZJcEFAIGTkocrNUqxLD3vF02yGjR1EQTLBmmr/Ng1U5O JT1EQ2QPpwnMf2Ok2dPPc7xnlt8uWu4xL+vcx8xp/mTU4jyHf5soCpafgGaCbCBlohzU 1feA== 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=aWtwI+k7UCBs0l74OtNTgocL7WE2uWiSxbu1sqlhGi0=; b=nzUK/Acoxjk2ghwefNdYbwiQOYqhm9Hy7oheW1OEXfQpjVRDWK1bDAMfnjaMWpY+Ni dFrPXkLcD3w5YJKgQ7nj7lcLMWOVJl1i+EpWyYMCYSHKUuvM2Qo0tIMwGEFvdm41z9EW pLZ7i/7LJhwWCdk28EIz0a7fiBmp4snqlA4fax5oCeAI7OR5bnKsQDc59EN4EA47QmVi gzWL84SCriiDUxjwc/5cGZ8C3ua9eCLsuCwlywK9TQhT8JeUE3oKU44echsqiolzm21d JMQWxneyeIGDkrc19LdvCN4n8RNlelTSVbq8dh7WkkskQcoruSiAnYXnFsBx8RGo21R+ J1Rw== X-Gm-Message-State: AOAM532CU+Js6CvDRWs28lpqcX0uUessRjbDlpLFTuvh4EuqxEEo71NB 49BYIaY4PaqzEW+nNx9AWBY= X-Received: by 2002:a17:906:43c7:: with SMTP id j7mr29431216ejn.397.1605196716593; Thu, 12 Nov 2020 07:58:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:58:36 -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 16/18] net: phy: ste10Xp: remove the use of .ack_interrupt() Date: Thu, 12 Nov 2020 17:55:11 +0200 Message-Id: <20201112155513.411604-17-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. Signed-off-by: Ioana Ciornei --- drivers/net/phy/ste10Xp.c | 41 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/drivers/net/phy/ste10Xp.c b/drivers/net/phy/ste10Xp.c index 9f315332e0f2..431fe5e0ce31 100644 --- a/drivers/net/phy/ste10Xp.c +++ b/drivers/net/phy/ste10Xp.c @@ -48,32 +48,37 @@ static int ste10Xp_config_init(struct phy_device *phydev) return 0; } +static int ste10Xp_ack_interrupt(struct phy_device *phydev) +{ + int err = phy_read(phydev, MII_XCIIS); + + if (err < 0) + return err; + + return 0; +} + static int ste10Xp_config_intr(struct phy_device *phydev) { - int err, value; + int err; if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + /* clear any pending interrupts */ + err = ste10Xp_ack_interrupt(phydev); + if (err) + return err; + /* Enable all STe101P interrupts (PR12) */ err = phy_write(phydev, MII_XIE, MII_XIE_DEFAULT_MASK); - /* clear any pending interrupts */ - if (err == 0) { - value = phy_read(phydev, MII_XCIIS); - if (value < 0) - err = value; - } - } else + } else { err = phy_write(phydev, MII_XIE, 0); + if (err) + return err; - return err; -} - -static int ste10Xp_ack_interrupt(struct phy_device *phydev) -{ - int err = phy_read(phydev, MII_XCIIS); - if (err < 0) - return err; + err = ste10Xp_ack_interrupt(phydev); + } - return 0; + return err; } static irqreturn_t ste10Xp_handle_interrupt(struct phy_device *phydev) @@ -101,7 +106,6 @@ static struct phy_driver ste10xp_pdriver[] = { .name = "STe101p", /* PHY_BASIC_FEATURES */ .config_init = ste10Xp_config_init, - .ack_interrupt = ste10Xp_ack_interrupt, .config_intr = ste10Xp_config_intr, .handle_interrupt = ste10Xp_handle_interrupt, .suspend = genphy_suspend, @@ -112,7 +116,6 @@ static struct phy_driver ste10xp_pdriver[] = { .name = "STe100p", /* PHY_BASIC_FEATURES */ .config_init = ste10Xp_config_init, - .ack_interrupt = ste10Xp_ack_interrupt, .config_intr = ste10Xp_config_intr, .handle_interrupt = ste10Xp_handle_interrupt, .suspend = genphy_suspend, -- 2.28.0