mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi_loader: use logging for block device messages
Use logging instead of printf() for messages occurring when scanning block devices during the initialization of the UEFI sub-system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
c001837400
commit
af457cfca9
1 changed files with 13 additions and 10 deletions
|
@ -5,11 +5,14 @@
|
||||||
* Copyright (c) 2016 Alexander Graf
|
* Copyright (c) 2016 Alexander Graf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_CATEGORY LOGC_EFI
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <blk.h>
|
#include <blk.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <efi_loader.h>
|
#include <efi_loader.h>
|
||||||
#include <fs.h>
|
#include <fs.h>
|
||||||
|
#include <log.h>
|
||||||
#include <part.h>
|
#include <part.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
@ -490,7 +493,7 @@ int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
|
||||||
ret = efi_disk_add_dev(parent, dp, if_typename, desc, diskid,
|
ret = efi_disk_add_dev(parent, dp, if_typename, desc, diskid,
|
||||||
info.start, part, NULL);
|
info.start, part, NULL);
|
||||||
if (ret != EFI_SUCCESS) {
|
if (ret != EFI_SUCCESS) {
|
||||||
printf("Adding partition %s failed\n", pdevname);
|
log_err("Adding partition %s failed\n", pdevname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
disks++;
|
disks++;
|
||||||
|
@ -528,16 +531,16 @@ efi_status_t efi_disk_register(void)
|
||||||
const char *if_typename = blk_get_if_type_name(desc->if_type);
|
const char *if_typename = blk_get_if_type_name(desc->if_type);
|
||||||
|
|
||||||
/* Add block device for the full device */
|
/* Add block device for the full device */
|
||||||
printf("Scanning disk %s...\n", dev->name);
|
log_info("Scanning disk %s...\n", dev->name);
|
||||||
ret = efi_disk_add_dev(NULL, NULL, if_typename,
|
ret = efi_disk_add_dev(NULL, NULL, if_typename,
|
||||||
desc, desc->devnum, 0, 0, &disk);
|
desc, desc->devnum, 0, 0, &disk);
|
||||||
if (ret == EFI_NOT_READY) {
|
if (ret == EFI_NOT_READY) {
|
||||||
printf("Disk %s not ready\n", dev->name);
|
log_notice("Disk %s not ready\n", dev->name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("ERROR: failure to add disk device %s, r = %lu\n",
|
log_err("ERROR: failure to add disk device %s, r = %lu\n",
|
||||||
dev->name, ret & ~EFI_ERROR_MASK);
|
dev->name, ret & ~EFI_ERROR_MASK);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
disks++;
|
disks++;
|
||||||
|
@ -560,7 +563,7 @@ efi_status_t efi_disk_register(void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if_typename = cur_drvr->if_typename;
|
if_typename = cur_drvr->if_typename;
|
||||||
printf("Scanning disks on %s...\n", if_typename);
|
log_info("Scanning disks on %s...\n", if_typename);
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
struct blk_desc *desc;
|
struct blk_desc *desc;
|
||||||
char devname[32] = { 0 }; /* dp->str is u16[32] long */
|
char devname[32] = { 0 }; /* dp->str is u16[32] long */
|
||||||
|
@ -578,12 +581,12 @@ efi_status_t efi_disk_register(void)
|
||||||
ret = efi_disk_add_dev(NULL, NULL, if_typename, desc,
|
ret = efi_disk_add_dev(NULL, NULL, if_typename, desc,
|
||||||
i, 0, 0, &disk);
|
i, 0, 0, &disk);
|
||||||
if (ret == EFI_NOT_READY) {
|
if (ret == EFI_NOT_READY) {
|
||||||
printf("Disk %s not ready\n", devname);
|
log_notice("Disk %s not ready\n", devname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("ERROR: failure to add disk device %s, r = %lu\n",
|
log_err("ERROR: failure to add disk device %s, r = %lu\n",
|
||||||
devname, ret & ~EFI_ERROR_MASK);
|
devname, ret & ~EFI_ERROR_MASK);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
disks++;
|
disks++;
|
||||||
|
@ -595,7 +598,7 @@ efi_status_t efi_disk_register(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
printf("Found %d disks\n", disks);
|
log_info("Found %d disks\n", disks);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue