summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-11-26 14:05:14 +0100
committerAlexander Graf <agraf@suse.de>2017-12-01 13:36:49 +0100
commit9449358a71b7dfd96ed9f3fbd276d4a19daef1b5 (patch)
treed95549551e19110a802f7f69c98fdce27d73c422 /lib
parent84d14568ca1a70ffd8925c357e3db2a6a8437922 (diff)
downloadu-boot-9449358a71b7dfd96ed9f3fbd276d4a19daef1b5.tar.gz
u-boot-9449358a71b7dfd96ed9f3fbd276d4a19daef1b5.tar.bz2
u-boot-9449358a71b7dfd96ed9f3fbd276d4a19daef1b5.zip
efi_loader: efi_gop: use efi_add_protocol
Use efi_add_protocol to add protocol. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_gop.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
index 7370eeee37..7b74d6ef33 100644
--- a/lib/efi_loader/efi_gop.c
+++ b/lib/efi_loader/efi_gop.c
@@ -132,6 +132,7 @@ int efi_gop_register(void)
u32 bpix, col, row;
u64 fb_base, fb_size;
void *fb;
+ efi_status_t ret;
#ifdef CONFIG_DM_VIDEO
struct udevice *vdev;
@@ -178,10 +179,17 @@ int efi_gop_register(void)
return 1;
}
+ /* Hook up to the device list */
+ list_add_tail(&gopobj->parent.link, &efi_obj_list);
+
/* Fill in object data */
- gopobj->parent.protocols[0].guid = &efi_gop_guid;
- gopobj->parent.protocols[0].protocol_interface = &gopobj->ops;
gopobj->parent.handle = &gopobj->ops;
+ ret = efi_add_protocol(gopobj->parent.handle, &efi_gop_guid,
+ &gopobj->ops);
+ if (ret != EFI_SUCCESS) {
+ printf("ERROR: Out of memory\n");
+ return 1;
+ }
gopobj->ops.query_mode = gop_query_mode;
gopobj->ops.set_mode = gop_set_mode;
gopobj->ops.blt = gop_blt;
@@ -210,8 +218,5 @@ int efi_gop_register(void)
gopobj->bpix = bpix;
gopobj->fb = fb;
- /* Hook up to the device list */
- list_add_tail(&gopobj->parent.link, &efi_obj_list);
-
return 0;
}