Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / linux / fwnode_mdio.h
blobfaf603c48c86f643658e8931e7d3ad9098bebbfd
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * FWNODE helper for the MDIO (Ethernet PHY) API
4 */
6 #ifndef __LINUX_FWNODE_MDIO_H
7 #define __LINUX_FWNODE_MDIO_H
9 #include <linux/phy.h>
11 #if IS_ENABLED(CONFIG_FWNODE_MDIO)
12 int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
13 struct phy_device *phy,
14 struct fwnode_handle *child, u32 addr);
16 int fwnode_mdiobus_register_phy(struct mii_bus *bus,
17 struct fwnode_handle *child, u32 addr);
19 #else /* CONFIG_FWNODE_MDIO */
20 int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
21 struct phy_device *phy,
22 struct fwnode_handle *child, u32 addr)
24 return -EINVAL;
27 static inline int fwnode_mdiobus_register_phy(struct mii_bus *bus,
28 struct fwnode_handle *child,
29 u32 addr)
31 return -EINVAL;
33 #endif
35 #endif /* __LINUX_FWNODE_MDIO_H */