From: Heiner Kallweit Date: Fri, 9 Nov 2018 23:39:14 +0000 (+0100) Subject: net: phy: add macros for PHYID matching X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=aa2af2eb447c9a21c8c9e8d2336672bb620cf900;p=linux.git net: phy: add macros for PHYID matching 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 Signed-off-by: David S. Miller --- diff --git a/include/linux/phy.h b/include/linux/phy.h index 17d1f64723e48..03005c65e02de 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;