소스 검색

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

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Heinrich Schuchardt 3 년 전
부모
커밋
ad8959138f
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      net/eth-uclass.c
  2. 2 2
      net/eth_legacy.c

+ 3 - 3
net/eth-uclass.c

@@ -273,7 +273,7 @@ int eth_init(void)
 	if (!current) {
 	if (!current) {
 		current = eth_get_dev();
 		current = eth_get_dev();
 		if (!current) {
 		if (!current) {
-			printf("No ethernet found.\n");
+			log_err("No ethernet found.\n");
 			return -ENODEV;
 			return -ENODEV;
 		}
 		}
 	}
 	}
@@ -414,7 +414,7 @@ int eth_initialize(void)
 	 */
 	 */
 	uclass_first_device_check(UCLASS_ETH, &dev);
 	uclass_first_device_check(UCLASS_ETH, &dev);
 	if (!dev) {
 	if (!dev) {
-		printf("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 	} else {
 	} else {
 		char *ethprime = env_get("ethprime");
 		char *ethprime = env_get("ethprime");
@@ -449,7 +449,7 @@ int eth_initialize(void)
 		} while (dev);
 		} while (dev);
 
 
 		if (!num_devices)
 		if (!num_devices)
-			printf("No ethernet found.\n");
+			log_err("No ethernet found.\n");
 		putc('\n');
 		putc('\n');
 	}
 	}
 
 

+ 2 - 2
net/eth_legacy.c

@@ -261,7 +261,7 @@ int eth_initialize(void)
 	}
 	}
 
 
 	if (!eth_devices) {
 	if (!eth_devices) {
-		puts("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 		bootstage_error(BOOTSTAGE_ID_NET_ETH_START);
 	} else {
 	} else {
 		struct eth_device *dev = eth_devices;
 		struct eth_device *dev = eth_devices;
@@ -319,7 +319,7 @@ int eth_init(void)
 	struct eth_device *old_current;
 	struct eth_device *old_current;
 
 
 	if (!eth_current) {
 	if (!eth_current) {
-		puts("No ethernet found.\n");
+		log_err("No ethernet found.\n");
 		return -ENODEV;
 		return -ENODEV;
 	}
 	}