diff options
| author | Heinrich Schuchardt <[email protected]> | 2022-10-06 07:29:41 +0200 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2022-10-06 22:54:58 +0200 |
| commit | f05911a126bd6b8536c8d43fd6c1d837008fcda1 (patch) | |
| tree | 13516e69b377dd0132a5b895a62c0f3f73ecadf3 /lib/efi_loader | |
| parent | 564e55c7f4a335abb766c921eb2ae1e05ce1253c (diff) | |
efi_driver: move event registration to driver
Move the registration of events for the addition and removal of block
devices to the block device driver. Here we can add a reference to the
EFI Driver Binding protocol as context.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/efi_disk.c | 25 | ||||
| -rw-r--r-- | lib/efi_loader/efi_setup.c | 4 |
2 files changed, 2 insertions, 27 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 79b28097b6c..a04ab338fc6 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -625,7 +625,7 @@ static int efi_disk_create_part(struct udevice *dev) * * @return 0 on success, -1 otherwise */ -static int efi_disk_probe(void *ctx, struct event *event) +int efi_disk_probe(void *ctx, struct event *event) { struct udevice *dev; enum uclass_id id; @@ -729,7 +729,7 @@ static int efi_disk_delete_part(struct udevice *dev) * * @return 0 on success, -1 otherwise */ -static int efi_disk_remove(void *ctx, struct event *event) +int efi_disk_remove(void *ctx, struct event *event) { enum uclass_id id; struct udevice *dev; @@ -745,27 +745,6 @@ static int efi_disk_remove(void *ctx, struct event *event) return 0; } -efi_status_t efi_disk_init(void) -{ - int ret; - - ret = event_register("efi_disk add", EVT_DM_POST_PROBE, - efi_disk_probe, NULL); - if (ret) { - log_err("Event registration for efi_disk add failed\n"); - return EFI_OUT_OF_RESOURCES; - } - - ret = event_register("efi_disk del", EVT_DM_PRE_REMOVE, - efi_disk_remove, NULL); - if (ret) { - log_err("Event registration for efi_disk del failed\n"); - return EFI_OUT_OF_RESOURCES; - } - - return EFI_SUCCESS; -} - /** * efi_disk_get_device_name() - get U-Boot device name associated with EFI handle * diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 113d5d5d56a..9d7189336dc 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -200,10 +200,6 @@ static efi_status_t __efi_init_early(void) /* Initialize EFI driver uclass */ ret = efi_driver_init(); - if (ret != EFI_SUCCESS) - goto out; - - ret = efi_disk_init(); out: return ret; } |
