[PATCH 3/3] net: phy: Add static inline wrapper for phy_register_fixup_for_uid

Sascha Hauer s.hauer at pengutronix.de
Thu Jan 23 08:28:37 EST 2014


Boards register a fixup for a phy without checking if phy support
is enabled. To fix compilation without phy support add a static
inline wrapper for phy_register_fixup_for_uid.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/linux/phy.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9994e11..c8980b0 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -296,13 +296,22 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
 		int (*run)(struct phy_device *));
 int phy_register_fixup_for_id(const char *bus_id,
 		int (*run)(struct phy_device *));
-int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
-		int (*run)(struct phy_device *));
 int phy_scan_fixups(struct phy_device *phydev);
 
 int phy_read_mmd_indirect(struct phy_device *phydev, int prtad, int devad);
 void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
 				   u16 data);
 
+#ifdef CONFIG_PHYLIB
+int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
+		int (*run)(struct phy_device *));
+#else
+static inline int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
+		int (*run)(struct phy_device *))
+{
+	return -ENOSYS;
+}
+#endif
+
 extern struct bus_type mdio_bus_type;
 #endif /* __PHYDEV_H__ */
-- 
1.8.5.2




More information about the barebox mailing list