Skip to contentSkip to conversation

net: use log_err() for 'No ethernet found' message

PATCH New Heinrich Schuchardt 3 participants 3 messages Sep 14, 2020 – Oct 1, 2020 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: use log_err() for 'No ethernet found' message

Write the 'No ethernet found' message via the log drivers. This allows suppressing it during output via the syslog driver.

This fixes the problem reported in:

[PATCH 0/4] log: Fix the syslog spam when running tests
https://lists.denx.de/pipermail/u-boot/2020-September/426343.html

---
 net/eth-uclass.c | 6 +++---
 net/eth_legacy.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
net/eth-uclass.c +3 -3
index 0d9b75a9a2..396418eb39 100644
@@ -273,7 +273,7 @@ int eth_init(void)
 	if (!current) {
 		current = eth_get_dev();
 		if (!current) {
-			printf("No ethernet found.\n");
+			log_err("No ethernet found.\n");
 			return -ENODEV;
 		}
 	}
@@ -414,7 +414,7 @@ int eth_initialize(void)
 	 */
 	uclass_first_device_check(UCLASS_ETH, &dev);
 	if (!dev) {
-		printf("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 	} else {
 		char *ethprime = env_get("ethprime");
@@ -449,7 +449,7 @@ int eth_initialize(void)
 		} while (dev);
 
 		if (!num_devices)
-			printf("No ethernet found.\n");
+			log_err("No ethernet found.\n");
 		putc('\n');
 	}
 
net/eth_legacy.c +2 -2
index 992d1880bf..6e0c058761 100644
@@ -261,7 +261,7 @@ int eth_initialize(void)
 	}
 
 	if (!eth_devices) {
-		puts("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 	} else {
 		struct eth_device *dev = eth_devices;
@@ -319,7 +319,7 @@ int eth_init(void)
 	struct eth_device *old_current;
 
 	if (!eth_current) {
-		puts("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		return -ENODEV;
 	}
 

--
2.28.0

#1 lore raw

PATCH 1/1 net: use log_err() for 'No ethernet found' message

Quoted 9 lines · Heinrich Schuchardt

Write the 'No ethernet found' message via the log drivers. This allows suppressing it during output via the syslog driver.

This fixes the problem reported in:

[PATCH 0/4] log: Fix the syslog spam when running tests
https://lists.denx.de/pipermail/u-boot/2020-September/426343.html

Quoted 6 lines
---
 net/eth-uclass.c | 6 +++---
 net/eth_legacy.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
#2 lore raw

PATCH 1/1 net: use log_err() for 'No ethernet found' message

In reply to Heinrich Schuchardt
Quoted 11 lines · Heinrich Schuchardt

Write the 'No ethernet found' message via the log drivers. This allows suppressing it during output via the syslog driver.

This fixes the problem reported in:

[PATCH 0/4] log: Fix the syslog spam when running tests
https://lists.denx.de/pipermail/u-boot/2020-September/426343.html

Applied to u-boot/next, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201001/88f879ce/attachment.sig>