[PATCH v2] 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 paul.barker.ct@bp.renesas.com Reviewed-by: Marek Vasut marek.vasut+renesas@mailbox.org --- Changes v1->v2: - Split out of series adding RZ/G2L Ethernet support [1] - Added Marek's Reviewed-by tag
[1]: https://lore.kernel.org/all/20241024152448.102-1-paul.barker.ct@bp.renesas.c...
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 f1401d2f6ed2..6393c3a7c3fe 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -657,10 +657,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);

On 11/20/24 10:49 AM, 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@bp.renesas.com Reviewed-by: Marek Vasut marek.vasut+renesas@mailbox.org
Applied to sh/master, thanks.

On 12/1/24 7:48 PM, Marek Vasut wrote:
On 11/20/24 10:49 AM, 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@bp.renesas.com Reviewed-by: Marek Vasut marek.vasut+renesas@mailbox.org
Applied to sh/master, thanks.
I think this one triggers some build failure -- https://source.denx.de/u-boot/custodians/u-boot-sh/-/pipelines/23670 -- https://source.denx.de/u-boot/custodians/u-boot-sh/-/jobs/965285 on these boards:
rzg2_beacon hihope_rzg2 r8a77995_draak r8a77970_eagle r8a77990_ebisu r8a779a0_falcon r8a779h0_grayhawk rcar3_salvator-x rcar3_ulcb r8a77970_v3msk r8a779g0_whitehawk silinux_ek874
You need to drop the *cell variable. I've fixed that up and retriggered a build, I hope that's OK?

Hi Marek,
On 01/12/2024 21:08, Marek Vasut wrote:
On 12/1/24 7:48 PM, Marek Vasut wrote:
On 11/20/24 10:49 AM, 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@bp.renesas.com Reviewed-by: Marek Vasut marek.vasut+renesas@mailbox.org
Applied to sh/master, thanks.
I think this one triggers some build failure -- https://source.denx.de/u-boot/custodians/u-boot-sh/-/pipelines/23670 -- https://source.denx.de/u-boot/custodians/u-boot-sh/-/jobs/965285 on these boards:
rzg2_beacon hihope_rzg2 r8a77995_draak r8a77970_eagle r8a77990_ebisu r8a779a0_falcon r8a779h0_grayhawk rcar3_salvator-x rcar3_ulcb r8a77970_v3msk r8a779g0_whitehawk silinux_ek874
You need to drop the *cell variable. I've fixed that up and retriggered a build, I hope that's OK?
Apologies, I missed that cell was still defined but now unused. Thanks for fixing it up.
participants (2)
-
Marek Vasut
-
Paul Barker