From patchwork Fri Nov 9 17:16:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 10676363 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 2C68813B0 for ; Fri, 9 Nov 2018 17:17:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DBA82ECEB for ; Fri, 9 Nov 2018 17:17:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 019962ED08; Fri, 9 Nov 2018 17:17:47 +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 AAB6C2ECEB for ; Fri, 9 Nov 2018 17:17:47 +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=VMZLpC0UgQ6vEfs2Bh8RW+jwanc3Lscyqgd48KKSrbg=; b=iTBpjrTA3FcSCf xuUxNxxk5AOT7r6wy26N8dqN6aKF0AcYdiW1iqWaoPJkdjYdku69OYNS8dODKG+jDthLHWexHGp2j IgiBV+nud/zd2xBs6wZtOFnoJ1T4JUwAIN7iRvLCSf2ol/Bliyg/j8n9qOOvQ3CVN5D4yT+OIFzkh gA12caIs1icck5189148MGmw6hqzc+O0nclDNsol2wrkae/uxbH9ZrOeeCGMJyujJ+bC+MuTWsusI R/FrmB4W9fy81SBYVP7AFGBGmMkaY3z9zC0DE1krVgwXnU2taEDN1aSNz+sJ12Crd/ScIdNMer7SG LzlTLxrOk6dYOUmXUVbw==; 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 1gLAPi-0006r2-64; Fri, 09 Nov 2018 17:17:46 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLAPd-0006oS-FG; Fri, 09 Nov 2018 17:17:42 +0000 Received: by mail-wr1-x442.google.com with SMTP id i17-v6so2679667wre.7; Fri, 09 Nov 2018 09:17:31 -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=LmbqCAt3QEZD2DS8H4d++PSKqoBu8Rx42ipbGvjFVfA=; b=Cqx7TaJlD19Qjmw5q43FvEOE/g9oqb0PFC+AeffJJOi2HPAxiW//P6vXbosdhGO58g 545GLR/cbPWwLWMaBA8up1rowP+7tKiLlu8qu/t9xLscXY/eBqDea2uw5QQ0Y/Kj1nth vMfnUr3y1stv52A8+YuIJyuSHlAfNftOf2OwFQrvI4R3slAn4YuDF4lQjnCfEdQf2xk2 msHWonzm2MnZloNVl2Go+4QEh0+2zthkclKlKLprLIXxVF6U1UHmleYqIlipGLM1h+Ba xIC8kNgzmzYGV7djd16obIMbjxcEof5cZFK4avstzX2ppYgj1e9hmalvNqVu68Oc4PFv gKHA== 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=LmbqCAt3QEZD2DS8H4d++PSKqoBu8Rx42ipbGvjFVfA=; b=U/So5msJWzxDuZnAL573sTX+evGPVmvjDEATZJYvd0FBRF/8EgQupa54tvJ2bh7lJe es2UzQlUIKQCxmdW8SHqo55ZX3QPnUicxmnw60i7zhKE1zpga8Kk/xWzCE/zS7dVGaPB KlAJl7eACGtH1ym5a2x+SaaTEXKoSXbIN2TK6VNcvI6VFVuUHLVuP06le7MQviWB9uSP 5xuBwNK2ysIE+z0rLXj4/L3eAf2n7aweOjnlaQBCjN4gHiBdYxs4k1hEAyRG2ziGC8Sm 2i1EhbGgUa3cZArkm6fkkOeTuZRNn7c4vX1f9r5tZYluLpJnVylMSG00mplLVDNkcRzg 3Vxw== X-Gm-Message-State: AGRZ1gItsbWBMw6/1rQkkMfpyktC5bGbQxxvUAEMhQ1O3kU+m6wUjxwE QWMPHbJYFbAR+rxNAu3KL+KLsuem X-Google-Smtp-Source: AJdET5djL/QZGaeslDbmlAaqJbrshW6GRT63R98VDVJg2UI/167AW4UU69uhj6dN+96GayWo+ud1dA== X-Received: by 2002:adf:c7d1:: with SMTP id y17-v6mr8763477wrg.230.1541783849760; Fri, 09 Nov 2018 09:17:29 -0800 (PST) Received: from ?IPv6:2003:ea:8bcf:e300:d5f1:833d:6c7e:a28? (p200300EA8BCFE300D5F1833D6C7E0A28.dip0.t-ipconnect.de. [2003:ea:8bcf:e300:d5f1:833d:6c7e:a28]) by smtp.googlemail.com with ESMTPSA id l140-v6sm4058228wmb.24.2018.11.09.09.17.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 09:17:29 -0800 (PST) Subject: [PATCH net-next v3 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: <203c4d9e-f39a-7a08-46c3-4ee6e61f181e@gmail.com> Message-ID: Date: Fri, 9 Nov 2018 18:16:28 +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: <203c4d9e-f39a-7a08-46c3-4ee6e61f181e@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181109_091741_511309_7427C63A X-CRM114-Status: GOOD ( 16.42 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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 Reviewed-by: Andrew Lunn --- v2: - add helper for the check v3: - no changes --- 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 ab33d1777..00a46218c 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2074,6 +2074,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 @@ -2095,8 +2100,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)