From: Paul Barker Date: Wed, 20 Nov 2024 09:49:39 +0000 (+0000) Subject: net: ravb: Simplify max-speed handling in ravb_of_to_plat X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=2b1a5efca8891ea320c23acd3681ca8bdb7fd15b;p=u-boot.git net: ravb: Simplify max-speed handling in ravb_of_to_plat We can call dev_read_u32_default() instead of calling fdt_getprop() then fdt32_to_cpu(). Signed-off-by: Paul Barker Reviewed-by: Marek Vasut --- diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index f1401d2f6e..231764e60b 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -649,7 +649,6 @@ static const struct eth_ops ravb_ops = { int ravb_of_to_plat(struct udevice *dev) { struct eth_pdata *pdata = dev_get_plat(dev); - const fdt32_t *cell; pdata->iobase = dev_read_addr(dev); @@ -657,10 +656,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); sprintf(bb_miiphy_buses[0].name, dev->name);