xtensa: fix high memory/reserved memory collision
[cris-mirror.git] / include / linux / phy / ulpi_phy.h
blob7054b440347ce677c48d14e0af5ddd52e71dc3d3
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/phy/phy.h>
4 /**
5 * Helper that registers PHY for a ULPI device and adds a lookup for binding it
6 * and it's controller, which is always the parent.
7 */
8 static inline struct phy
9 *ulpi_phy_create(struct ulpi *ulpi, const struct phy_ops *ops)
11 struct phy *phy;
12 int ret;
14 phy = phy_create(&ulpi->dev, NULL, ops);
15 if (IS_ERR(phy))
16 return phy;
18 ret = phy_create_lookup(phy, "usb2-phy", dev_name(ulpi->dev.parent));
19 if (ret) {
20 phy_destroy(phy);
21 return ERR_PTR(ret);
24 return phy;
27 /* Remove a PHY that was created with ulpi_phy_create() and it's lookup. */
28 static inline void ulpi_phy_destroy(struct ulpi *ulpi, struct phy *phy)
30 phy_remove_lookup(phy, "usb2-phy", dev_name(ulpi->dev.parent));
31 phy_destroy(phy);