aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini2022-02-23 12:28:54 -0500
committerTom Rini2022-02-23 13:34:08 -0500
commit4cb9bd834e6a63ab56797b362a288709e867ccfb (patch)
treed4bfbd7d8ad58b103d8d2e9e3f54b7f18589da2f /drivers
parent17a0dc6abfdbf392f6a27074f2633608038c4221 (diff)
parent70f42e720c90faa2fa27836288559e0d647862b7 (diff)
Merge tag 'dm-pull-22222' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
binman fixes/improvements to FIT generator binman SPL fixes moveconfig support regex matches
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-uclass.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c
index 49e2ec25c28..8b84da3ce0d 100644
--- a/drivers/phy/phy-uclass.c
+++ b/drivers/phy/phy-uclass.c
@@ -354,23 +354,31 @@ int generic_phy_configure(struct phy *phy, void *params)
int generic_phy_get_bulk(struct udevice *dev, struct phy_bulk *bulk)
{
int i, ret, count;
+ struct udevice *phydev = dev;
bulk->count = 0;
/* Return if no phy declared */
- if (!dev_read_prop(dev, "phys", NULL))
- return 0;
+ if (!dev_read_prop(dev, "phys", NULL)) {
+ phydev = dev->parent;
+ if (!dev_read_prop(phydev, "phys", NULL)) {
+ pr_err("%s : no phys property\n", __func__);
+ return 0;
+ }
+ }
- count = dev_count_phandle_with_args(dev, "phys", "#phy-cells", 0);
- if (count < 1)
+ count = dev_count_phandle_with_args(phydev, "phys", "#phy-cells", 0);
+ if (count < 1) {
+ pr_err("%s : no phys found %d\n", __func__, count);
return count;
+ }
- bulk->phys = devm_kcalloc(dev, count, sizeof(struct phy), GFP_KERNEL);
+ bulk->phys = devm_kcalloc(phydev, count, sizeof(struct phy), GFP_KERNEL);
if (!bulk->phys)
return -ENOMEM;
for (i = 0; i < count; i++) {
- ret = generic_phy_get_by_index(dev, i, &bulk->phys[i]);
+ ret = generic_phy_get_by_index(phydev, i, &bulk->phys[i]);
if (ret) {
pr_err("Failed to get PHY%d for %s\n", i, dev->name);
return ret;