Received: by 10.223.185.116 with SMTP id b49csp6419966wrg; Wed, 28 Feb 2018 09:06:18 -0800 (PST) X-Google-Smtp-Source: AH8x227RMNeTOIQwSvU8EXEFwQiHgfY5tJIHpyaKpTtLPsvhlCM3F9MqzvNSZukgLyIEoVl2qPaQ X-Received: by 10.98.7.129 with SMTP id 1mr18442641pfh.133.1519837578694; Wed, 28 Feb 2018 09:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519837578; cv=none; d=google.com; s=arc-20160816; b=arkd060Nz3SJKhrpceslss/XEb40CUVvLTetxsp0adBP/+7LzeXNMZAFrSlkC7afR7 4fcRDjwC8XaHF9h0FHJ0s9eMXZYdZOs9kidGdBm7hx0xpZCmIehlKY7mic2kaf/Byl0x YECQ1jE3mhVuJ9vlkQsWuknE/4/57TVBfPbS5Zak41mdpwcZ7Atppb0aYwzi/yD98d+L 0fqohgzVkje1KOBStOXtI7gWdHr8t6UpZoBXl5gwisrorDrGxk5AhPtpFrT7BqrEo/dj KKoq+/rc3AISUFZNQQDMaxWEwtzvbcB67dgp4th7p1TsEJdJ8CzRzoKWruO8+5PSK11U uAiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=lfs1Qjg9x6+YkNjy/JwxhRmrfkg89+vR9wlMbXgDxLU=; b=sLgYnjX74fbkZ64D3oZTMqMc+cVzu3fr9zp6YFE3Q67sqwkeLGNkwqs71Ttckn+BhU Wio6swOmYp82QCVunLyGHOPAkyXH/reZ+sTvf0f1izfuoM5xGC2R20Ryk/A8mqfHNpjj imV4PHj7csdtLwntr//tW57ARNqLmlnwYL80wcax5pSEWYfzhD2MgHqvUb2yrupbXzaw CD13favuwDbx6kQcakcn4CCHuNn3ZdBudvlKQYR4Sqexe017bGd7BKXKCQlsnDdgGfrx 8GTiJgPfASIro88H4PhgLk4O5wCwwwHWrEZJ1PiDJsg3+D46RqKzoE7Ck8wD/U9ZiZxX A7Dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si1205469pgq.491.2018.02.28.09.05.58; Wed, 28 Feb 2018 09:06:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933697AbeB1Pvf (ORCPT + 99 others); Wed, 28 Feb 2018 10:51:35 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34337 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933272AbeB1Pvc (ORCPT ); Wed, 28 Feb 2018 10:51:32 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yk-0006Xl-9a; Wed, 28 Feb 2018 15:22:23 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yi-0000Bf-FC; Wed, 28 Feb 2018 15:22:20 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David S. Miller" , "Andrew Lunn" , "Florian Fainelli" , "Iyappan Subramanian" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 166/254] phy: Add helper function to check phy interface mode In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Iyappan Subramanian commit 32d0f7830d9be5b1652a718e050d808b4908155f upstream. Added helper function that checks phy_mode is RGMII (all variants) 'bool phy_interface_mode_is_rgmii(phy_interface_t mode)' Changed the following function, to use the above. 'bool phy_interface_is_rgmii(struct phy_device *phydev)' Signed-off-by: Iyappan Subramanian Suggested-by: Florian Fainelli Suggested-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- include/linux/phy.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -630,14 +630,24 @@ static inline bool phy_is_internal(struc } /** + * phy_interface_mode_is_rgmii - Convenience function for testing if a + * PHY interface mode is RGMII (all variants) + * @mode: the phy_interface_t enum + */ +static inline bool phy_interface_mode_is_rgmii(phy_interface_t mode) +{ + return mode >= PHY_INTERFACE_MODE_RGMII && + mode <= PHY_INTERFACE_MODE_RGMII_TXID; +}; + +/** * phy_interface_is_rgmii - Convenience function for testing if a PHY interface * is RGMII (all variants) * @phydev: the phy_device struct */ static inline bool phy_interface_is_rgmii(struct phy_device *phydev) { - return phydev->interface >= PHY_INTERFACE_MODE_RGMII && - phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID; + return phy_interface_mode_is_rgmii(phydev->interface); } /**