From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiner Kallweit Subject: [PATCH net-next 1/2] net: phy: add macros for PHYID matching Date: Sat, 10 Nov 2018 00:39:14 +0100 Message-ID: <3894f17e-fcd3-e317-29fd-1b57128d3371@gmail.com> References: <673709d2-3efd-5616-9f9a-ea765d07d339@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]:43712 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbeKJJXe (ORCPT ); Sat, 10 Nov 2018 04:23:34 -0500 Received: by mail-wr1-f65.google.com with SMTP id y3-v6so3519674wrh.10 for ; Fri, 09 Nov 2018 15:40:42 -0800 (PST) In-Reply-To: <673709d2-3efd-5616-9f9a-ea765d07d339@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Add macros for PHYID matching to be used in PHY driver configs. By using these macros some boilerplate code can be avoided. Signed-off-by: Heiner Kallweit --- include/linux/phy.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 17d1f6472..03005c65e 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -651,6 +651,10 @@ struct phy_driver { #define PHY_ANY_ID "MATCH ANY PHY" #define PHY_ANY_UID 0xffffffff +#define PHY_ID_MATCH_EXACT(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 0) +#define PHY_ID_MATCH_MODEL(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 4) +#define PHY_ID_MATCH_VENDOR(id) .phy_id = (id), .phy_id_mask = GENMASK(31, 10) + /* A Structure for boards to register fixups with the PHY Lib */ struct phy_fixup { struct list_head list; -- 2.19.1