[PATCH 10/14] net: ravb: Simplify max-speed handling in ravb_of_to_plat
Paul Barker
paul.barker.ct at bp.renesas.com
Thu Oct 24 17:24:44 CEST 2024
We can call dev_read_u32_default() instead of calling fdt_getprop() then
fdt32_to_cpu().
Signed-off-by: Paul Barker <paul.barker.ct at bp.renesas.com>
---
drivers/net/ravb.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 9b33ce929618..fb869cd0872e 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -676,10 +676,7 @@ int ravb_of_to_plat(struct udevice *dev)
if (pdata->phy_interface == PHY_INTERFACE_MODE_NA)
return -EINVAL;
- pdata->max_speed = 1000;
- cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "max-speed", NULL);
- if (cell)
- pdata->max_speed = fdt32_to_cpu(*cell);
+ pdata->max_speed = dev_read_u32_default(dev, "max-speed", 1000);
pdata->priv_pdata = &bb_miiphy_buses[bb_miiphy_index];
sprintf(bb_miiphy_buses[bb_miiphy_index++].name, dev->name);
--
2.43.0
More information about the U-Boot
mailing list