diff mbox series

[v2] net: ravb: Simplify max-speed handling in ravb_of_to_plat

Message ID 20241120094939.129-1-paul.barker.ct@bp.renesas.com
State New
Delegated to: Marek Vasut
Headers show
Series [v2] net: ravb: Simplify max-speed handling in ravb_of_to_plat | expand

Commit Message

Paul Barker Nov. 20, 2024, 9:49 a.m. UTC
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.com/

 drivers/net/ravb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Marek Vasut Dec. 1, 2024, 6:48 p.m. UTC | #1
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.
Marek Vasut Dec. 1, 2024, 9:08 p.m. UTC | #2
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?
Paul Barker Dec. 5, 2024, 6:55 p.m. UTC | #3
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.
diff mbox series

Patch

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);