]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: ravb: Simplify max-speed handling in ravb_of_to_plat
authorPaul Barker <paul.barker.ct@bp.renesas.com>
Wed, 20 Nov 2024 09:49:39 +0000 (09:49 +0000)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 8 Dec 2024 22:06:52 +0000 (23:06 +0100)
We can call dev_read_u32_default() instead of calling fdt_getprop() then
fdt32_to_cpu().

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
drivers/net/ravb.c

index f1401d2f6ed2ea809479eca92836435f9ae88b9f..231764e60b5ad9e7b9b1d21f072131d582886c96 100644 (file)
@@ -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);