Skip to contentSkip to conversation

am33xx: ignore return value from usb_ether_init()

PATCH In review Trevor Woerner 3 participants 6 messages Aug 31, 2023 – Sep 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 am33xx: ignore return value from usb_ether_init()

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the error handling of usb_ether_init() was changed. Not a single other call site of this function checks its return value, therefore follow suit in the am33xx code.

Do not cause the boot to halt if the usb gadget ethernet initialization fails:

	initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19)
	### ERROR ### Please RESET the board ###
---
 arch/arm/mach-omap2/am33xx/board.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/mach-omap2/am33xx/board.c +1 -5
index ecc0a592e993..8f772310a1a7 100644
@@ -270,11 +270,7 @@ int arch_misc_init(void)
 		return ret;
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
-	ret = usb_ether_init();
-	if (ret) {
-		pr_err("USB ether init failed\n");
-		return ret;
-	}
+	usb_ether_init();
 #endif
 
 	return 0;
Signature · 1 line
2.41.0.327.gaa9166bcc0ba
Reviewed-by on v1 1/1
#1 lore raw

Hello,

Quoted 3 lines · Trevor Woerner

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the error handling of usb_ether_init() was changed. Not a single other call site of this function checks its return value, therefore follow suit in the am33xx code.

then there is the question what point is there in having a return value in this function at all.

Anyway, it's fine to not check the return value in the caller if there is no use for the error.

Quoted 31 lines

Do not cause the boot to halt if the usb gadget ethernet initialization fails:

	initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19)
	### ERROR ### Please RESET the board ###
---
 arch/arm/mach-omap2/am33xx/board.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/mach-omap2/am33xx/board.c +1 -5
index ecc0a592e993..8f772310a1a7 100644
@@ -270,11 +270,7 @@ int arch_misc_init(void)
 		return ret;
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
-	ret = usb_ether_init();
-	if (ret) {
-		pr_err("USB ether init failed\n");
-		return ret;
-	}
+	usb_ether_init();
 #endif
 
 	return 0;
Signature · 1 line
2.41.0.327.gaa9166bcc0ba
#2 lore raw

Can this get added to the next release? I don't see it in -next.

Quoted 52 lines · Michal Suchánek

Hello,

Quoted 1 line · Trevor Woerner

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the

error

Quoted 1 line

handling of usb_ether_init() was changed. Not a single other call site

of this

Quoted 1 line

function checks its return value, therefore follow suit in the am33xx

code.

then there is the question what point is there in having a return value in this function at all.

Anyway, it's fine to not check the return value in the caller if there is no use for the error.

Quoted 2 lines

Do not cause the boot to halt if the usb gadget ethernet initialization

fails:

Review

Quoted 10 lines

initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19) ### ERROR ### Please RESET the board ###

---
 arch/arm/mach-omap2/am33xx/board.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/am33xx/board.c

Quoted 19 lines

index ecc0a592e993..8f772310a1a7 100644

arch/arm/mach-omap2/am33xx/board.c +1 -6
@@ -270,11 +270,7 @@ int arch_misc_init(void)
              return ret;
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
-     ret = usb_ether_init();
-     if (ret) {
-             pr_err("USB ether init failed\n");
-             return ret;
-     }
+     usb_ether_init();
 #endif
 
      return 0;
--

2.41.0.327.gaa9166bcc0ba

#3 lore raw
Quoted 1 line · Trevor Woerner

Can this get added to the next release? I don't see it in -next.

I was going to pick this up for v2024.01 (i.e. the next branch) soon'ish.

Quoted 55 lines · Michal Suchánek
Quoted 53 lines

Hello,

Quoted 1 line · Trevor Woerner

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the

error

Quoted 1 line

handling of usb_ether_init() was changed. Not a single other call site

of this

Quoted 1 line

function checks its return value, therefore follow suit in the am33xx

code.

then there is the question what point is there in having a return value in this function at all.

Anyway, it's fine to not check the return value in the caller if there is no use for the error.

Quoted 2 lines

Do not cause the boot to halt if the usb gadget ethernet initialization

fails:

Review

Quoted 10 lines

initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19) ### ERROR ### Please RESET the board ###

---
 arch/arm/mach-omap2/am33xx/board.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/am33xx/board.c

Quoted 19 lines

index ecc0a592e993..8f772310a1a7 100644

arch/arm/mach-omap2/am33xx/board.c +1 -6
@@ -270,11 +270,7 @@ int arch_misc_init(void)
              return ret;
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
-     ret = usb_ether_init();
-     if (ret) {
-             pr_err("USB ether init failed\n");
-             return ret;
-     }
+     usb_ether_init();
 #endif
 
      return 0;
--

2.41.0.327.gaa9166bcc0ba

Signature · 1 line
Tom
#4 lore raw
Quoted 7 lines · Tom Rini
Quoted 1 line · Trevor Woerner

Can this get added to the next release? I don't see it in -next.

I was going to pick this up for v2024.01 (i.e. the next branch) soon'ish.

Awesome, thanks! :-)

#5 lore raw
In reply to Trevor Woerner
Quoted 11 lines · Trevor Woerner

In 2cb43ef1c223 ("usb: ether: Fix error handling in usb_ether_init") the error handling of usb_ether_init() was changed. Not a single other call site of this function checks its return value, therefore follow suit in the am33xx code.

Do not cause the boot to halt if the usb gadget ethernet initialization fails:

	initcall sequence 9ffdbd84 failed at call 808024b9 (err=-19)
	### ERROR ### Please RESET the board ###

Applied to u-boot/next, thanks!

Signature · 1 line
Tom