mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 13:56:20 +00:00
usb: dwc3: Use generic_phy_valid() helper
The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".
Change to use the generic_phy_valid() helper to check if phy is valid.
Also remove setting phy->dev to NULL now that generic_phy_get_by_name()
properly initialize phy->dev to NULL.
Fixes: 142d50fbce
("usb: dwc3: Add support for usb3-phy PHY configuration")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
This commit is contained in:
parent
14639bf14d
commit
5ccfdd8a83
1 changed files with 1 additions and 3 deletions
|
@ -541,8 +541,6 @@ int dwc3_glue_probe(struct udevice *dev)
|
||||||
} else if (ret != -ENOENT && ret != -ENODATA) {
|
} else if (ret != -ENOENT && ret != -ENODATA) {
|
||||||
debug("could not get phy (err %d)\n", ret);
|
debug("could not get phy (err %d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
|
||||||
phy.dev = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glue->regs = dev_read_addr_size_index(dev, 0, &glue->size);
|
glue->regs = dev_read_addr_size_index(dev, 0, &glue->size);
|
||||||
|
@ -555,7 +553,7 @@ int dwc3_glue_probe(struct udevice *dev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (phy.dev) {
|
if (generic_phy_valid(&phy)) {
|
||||||
ret = generic_phy_power_on(&phy);
|
ret = generic_phy_power_on(&phy);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue