From patchwork Thu Nov 12 15:55:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 11900549 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4761C2D0A3 for ; Thu, 12 Nov 2020 15:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50098221E9 for ; Thu, 12 Nov 2020 15:58:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P+SxahmH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbgKLP6l (ORCPT ); Thu, 12 Nov 2020 10:58:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728901AbgKLP6d (ORCPT ); Thu, 12 Nov 2020 10:58:33 -0500 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 01EE9C0613D1; Thu, 12 Nov 2020 07:58:33 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id cw8so8547889ejb.8; Thu, 12 Nov 2020 07:58:32 -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=MXHSBEvaUT7iZ7CGrQ4Tj9isAY8p/NdNFR8NBXTFZaY=; b=P+SxahmHJykectq8dDAl91TJIpGlsiJP0t3SVDbMvp89YxcH7diwTZw1WLZR5UbIku WJxGS9+LJ+dlSEkehN0tEP+EJO5iupoOqZvO4yGX9RuICRtBROntK0xJH43knDHU9qGz lLNSBblT/nOE1whtkn39Lj/jt8qTFe7zzPa09FadOKeZsiJ3FPlGW4fM1AE4TRiqsEuz XOqrvUZG5dhZurbVLntWKyZNH/H3McdVLAcaOXiXDAGC2K5J13acalB9b+Xb+LinLFC0 00KWdelUNPQjnvnCnEK6fVWMZO7O7B6F5V0dGZTOAN59ILFYgtxXAuIEC39pXwtdFj8D m5qA== 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=MXHSBEvaUT7iZ7CGrQ4Tj9isAY8p/NdNFR8NBXTFZaY=; b=KcTfez3UqhBR1Fmqh9f/174uP6tgA4GDE5mbaNyedk/7+I83/CZqdl92za2uE6yCwt tXgog7AelsZVLi0+qKRkqAk8TLG1sXF9iTnD7fAzUQfW1jpk4W/nbOjV1iagI0fUh65C J8NNz5F8UbnltA4yh7PvZEt3gnkGwV9lyEptMn3cqVYdbYwjZ0iOF558nf8b43K9XN+y upOl2sXfV4bnGrqCP34Nx5lzFzkYdQKjdWcAOUbaWoniD+nMgPU1UtObgvYksjveNICY MBMpF0KhQ09axCW9lwKP90kjHhj+UpSEcSBMiQGdvT51V9B0dURLDnfSnTUvIXzOHGut PZow== X-Gm-Message-State: AOAM531muuwZR2BJ4FNGe4NLGB765Twi6NcGZJSk4QqXVbzE2R77/ipY nhKXaOFf8ICD9NwIugyTmTY= X-Google-Smtp-Source: ABdhPJzgaAQ8aHdotyotm4BG2tyQGVj3dCnmSRnzjmGfuxCTUKmzqUPrqxaTBqq2KeNkj40MJUpttA== X-Received: by 2002:a17:906:8142:: with SMTP id z2mr29916690ejw.30.1605196711675; Thu, 12 Nov 2020 07:58:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:58:31 -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 12/18] net: phy: amd: remove the use of .ack_interrupt() Date: Thu, 12 Nov 2020 17:55:07 +0200 Message-Id: <20201112155513.411604-13-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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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/amd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/amd.c b/drivers/net/phy/amd.c index ae75d95c398c..001bb6d8bfce 100644 --- a/drivers/net/phy/amd.c +++ b/drivers/net/phy/amd.c @@ -52,10 +52,19 @@ static int am79c_config_intr(struct phy_device *phydev) { int err; - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + err = am79c_ack_interrupt(phydev); + if (err) + return err; + err = phy_write(phydev, MII_AM79C_IR, MII_AM79C_IR_IMASK_INIT); - else + } else { err = phy_write(phydev, MII_AM79C_IR, 0); + if (err) + return err; + + err = am79c_ack_interrupt(phydev); + } return err; } @@ -84,7 +93,6 @@ static struct phy_driver am79c_driver[] = { { .phy_id_mask = 0xfffffff0, /* PHY_BASIC_FEATURES */ .config_init = am79c_config_init, - .ack_interrupt = am79c_ack_interrupt, .config_intr = am79c_config_intr, .handle_interrupt = am79c_handle_interrupt, } };