[PATCH 10/14] net: ravb: Simplify max-speed handling in ravb_of_to_plat
Marek Vasut
marek.vasut at mailbox.org
Sun Oct 27 17:21:27 CET 2024
On 10/24/24 5:24 PM, Paul Barker wrote:
> 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);
Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
More information about the U-Boot
mailing list