From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: [PATCH net-next 1/2] net: phy: add helper phy_polling_mode Date: Sat, 21 Jul 2018 15:51:31 +0200 Message-ID: <18b53769-e444-663d-650d-5887b3ae53ad@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Andrew Lunn , Florian Fainelli , David Miller Return-path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:40512 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbeGUOoa (ORCPT ); Sat, 21 Jul 2018 10:44:30 -0400 Received: by mail-wr1-f65.google.com with SMTP id t6-v6so13692593wrn.7 for ; Sat, 21 Jul 2018 06:51:39 -0700 (PDT) Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Add a helper for checking whether polling is used to detect PHY status changes. Signed-off-by: Heiner Kallweit --- include/linux/phy.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 075c2f77..cd6f637c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -824,6 +824,16 @@ static inline bool phy_interrupt_is_valid(struct phy_device *phydev) return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT; } +/** + * phy_polling_mode - Convenience function for testing whether polling is + * used to detect PHY status changes + * @phydev: the phy_device struct + */ +static inline bool phy_polling_mode(struct phy_device *phydev) +{ + return phydev->irq == PHY_POLL; +} + /** * phy_is_internal - Convenience function for testing if a PHY is internal * @phydev: the phy_device struct -- 2.18.0