diff mbox series

[U-Boot,RFC,v2,07/15] efi_loader: unicode_collation: converted to DM

Message ID 20190208081542.2813-8-takahiro.akashi@linaro.org
State RFC
Delegated to: Alexander Graf
Headers show
Series dm, efi: integrate efi objects into DM | expand

Commit Message

AKASHI Takahiro Feb. 8, 2019, 8:15 a.m. UTC
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 lib/efi_loader/efi_unicode_collation.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c
index 7f3ea3c77e4e..9b47693d3ee5 100644
--- a/lib/efi_loader/efi_unicode_collation.c
+++ b/lib/efi_loader/efi_unicode_collation.c
@@ -9,6 +9,7 @@ 
 #include <charset.h>
 #include <cp1250.h>
 #include <cp437.h>
+#include <dm.h>
 #include <efi_loader.h>
 
 /* Characters that may not be used in file names */
@@ -327,3 +328,21 @@  const struct efi_unicode_collation_protocol efi_unicode_collation_protocol = {
 	.str_to_fat = efi_str_to_fat,
 	.supported_languages = "en",
 };
+
+static int efi_unicode_collation_probe(struct udevice *dev)
+{
+	struct efi_handler *handler;
+	struct efi_unicode_collation_protocol *col;
+
+	handler = dev->uclass_platdata;
+	col = handler->protocol_interface;
+	device_set_name(dev, col->supported_languages);
+
+	return 0;
+}
+
+U_BOOT_DRIVER(efi_unicode_collation) = {
+	.name = "efi_unicode_collation",
+	.id = UCLASS_EFI_PROTOCOL,
+	.probe = efi_unicode_collation_probe,
+};