From patchwork Thu Nov 8 23:27:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10675151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C0F31709 for ; Thu, 8 Nov 2018 23:28:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 780F02E830 for ; Thu, 8 Nov 2018 23:28:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694DC2E84F; Thu, 8 Nov 2018 23:28:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E45F2E830 for ; Thu, 8 Nov 2018 23:28:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FpB1wy9p7MWvwkD+TcDSjZeeN2FCXKzIltaKEu8dV0s=; b=ItsxUwPIzunkOR YU/bff8Wlh1ETrKHeJ/GAPBUZayhb7ak5JFq4lK0ToygjU02an39xOyp2blT5vhZmXKZfRU8cgz5G 4Bbuxcn2HT0AUiTIP0iVApNmWxDpW5craX8e3iBWofs34TsQ2/vsABWccRQtd1rdHZ9z1MgtYwbY4 Qoe1LHN9xjI8THNr6YGiFJ+evCVQAQGC67MtLa4mSZwJlRESNwy21L+QKzxeryqj486Zn91msaxXv DV3U+359YWc7OCqHVdCl895FwA+7Yx/HzldKIyk8DOtfbLE58rVGjkucdAtrb6UukQvFLks2Lwe45 jcdhx8BjMixRYXW88a7Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKtiV-0000m8-MJ; Thu, 08 Nov 2018 23:28:03 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKtiS-0000lL-SM; Thu, 08 Nov 2018 23:28:02 +0000 Received: by mail-wr1-x441.google.com with SMTP id z13-v6so22323wrs.3; Thu, 08 Nov 2018 15:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1hepCnQNsrg9aKtHaOWIVj4YcMJAb35t616uw/Dwv94=; b=sxiTHy2pew3eYXbXIjby6lt2MNXPKRmk06t76PkCHa0xAbJXdLbT+NLbGZgxvRTzxm pEoKjHnk9l5GjeEg4jkP4MH3YfLOBCNN+GsFVZ5GW6HcJDw2EtG2fHbSDOy573+mhCUk +scPpFr0jVIlMqyhfv2hyKmX3mKl+a0TuvpPxsgN9+g3QAuRLn4Xmmqbedw6ElMo0X2s CdIuItYG/yQYH79r8qNwRtkRjkd7ee/9ioudTpvd45N1IFTLzoqetvi7tD7KGNS7tKZz C1OkzzALkQtiJZvx7QGd89eICo+H9x5Fr7H51SH7NIX7jrgT4xpSmFiG0pBOY2Y2xZuh E7vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1hepCnQNsrg9aKtHaOWIVj4YcMJAb35t616uw/Dwv94=; b=OpMjKnBz4a+fkO+sFFLzeHNMP6s/gXeB/EUScqEwd1+1At4951wYuo6Gf/FGeYlES4 V0XqhGglwH3uG/hzRdD0tM87D1DfR+uUQw9XTmF1+vFfQhzSe3j7kHJcq/jfabDlhDRX rkoBPFSgIrGhDqVmkzEN0JW4dWIAZPR1mRUHDtDUb3YmUMKL01STxeLFt5mvMHR7azEY nv6urdrm8qmjlD0o+j2ktX0+pABt+lPFUp+hzcsrOIu4lRzJwXsx5BxK9mObe4LIs8NH NkQ1bTwABdk874BlJxqsg20FT51YiKtlKoy9vLNV6TXeNivB7CbOJ/p7/2gqpjk64FsV mdAg== X-Gm-Message-State: AGRZ1gJIdfcVL2e3I5N236nOnhmt5XXEb78W34+fBtnfO5iXHKyXrIyk F0Cbpo5ck/P042Xmu7mWLY+LywnH X-Google-Smtp-Source: AJdET5fxGPCwvo+/ApuPfLdhVZT7EXXHKX4qjHcw30kZGvcD2TIP0ZinFz2PxYMN0oSuuvxIb97mgQ== X-Received: by 2002:a5d:63cf:: with SMTP id c15-v6mr5990007wrw.221.1541719668943; Thu, 08 Nov 2018 15:27:48 -0800 (PST) Received: from ?IPv6:2003:ea:8bcf:e300:3cbc:a9ea:9ab8:4b19? (p200300EA8BCFE3003CBCA9EA9AB84B19.dip0.t-ipconnect.de. [2003:ea:8bcf:e300:3cbc:a9ea:9ab8:4b19]) by smtp.googlemail.com with ESMTPSA id r76-v6sm8210307wmb.21.2018.11.08.15.27.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 15:27:48 -0800 (PST) Subject: [PATCH net-next v2 1/2] net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt From: Heiner Kallweit To: Andrew Lunn , Florian Fainelli , David Miller References: Message-ID: Date: Fri, 9 Nov 2018 00:27:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181108_152800_913703_374352DF X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "netdev@vger.kernel.org" , Richard Cochran , open list , "maintainer:BROADCOM BCM63XX ARM ARCHITECTURE" , Kevin Hilman , Carlo Caione , "open list:ARM/Amlogic Meson SoC support" , "moderated list:BROADCOM BCM63XX ARM ARCHITECTURE" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Flag PHY_HAS_INTERRUPT is used only here for this small check. I think using interrupts isn't possible if a driver defines neither config_intr nor ack_interrupts callback. So we can replace checking flag PHY_HAS_INTERRUPT with checking for these callbacks. Signed-off-by: Heiner Kallweit --- v2: - add helper for the check --- drivers/net/phy/phy_device.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index d165a2c82..70895bc3f 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2083,6 +2083,11 @@ static void of_set_phy_eee_broken(struct phy_device *phydev) phydev->eee_broken_modes = broken; } +static bool phy_drv_supports_irq(struct phy_driver *phydrv) +{ + return phydrv->config_intr || phydrv->ack_interrupt; +} + /** * phy_probe - probe and init a PHY device * @dev: device to probe and init @@ -2104,8 +2109,7 @@ static int phy_probe(struct device *dev) /* Disable the interrupt if the PHY doesn't support it * but the interrupt is still a valid one */ - if (!(phydrv->flags & PHY_HAS_INTERRUPT) && - phy_interrupt_is_valid(phydev)) + if (!phy_drv_supports_irq(phydrv) && phy_interrupt_is_valid(phydev)) phydev->irq = PHY_POLL; if (phydrv->flags & PHY_IS_INTERNAL)