arm: k3: Use driver_name to get ti_sci handle
[oweals/u-boot.git] / lib / efi_driver / efi_uclass.c
index 46b69b479cb6beb4e6bf5ebe8888cfa933f594e9..b14746e6b17683c757eaf594015163e996c52398 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  Uclass for EFI drivers
  *
  *  Copyright (c) 2017 Heinrich Schuchardt
  *
- *  SPDX-License-Identifier:     GPL-2.0+
- *
  * For each EFI driver the uclass
  * - creates a handle
  * - installs the driver binding protocol
 
 #include <efi_driver.h>
 
-/*
- * Check node type. We do not support partitions as controller handles.
+/**
+ * check_node_type() - check node type
  *
- * @handle     handle to be checked
- * @return     status code
+ * We do not support partitions as controller handles.
+ *
+ * @handle:    handle to be checked
+ * Return:     status code
  */
 static efi_status_t check_node_type(efi_handle_t handle)
 {
@@ -45,13 +46,13 @@ static efi_status_t check_node_type(efi_handle_t handle)
        return ret;
 }
 
-/*
- * Check if the driver supports the controller.
+/**
+ * efi_uc_supported() - check if the driver supports the controller
  *
- * @this                       driver binding protocol
- * @controller_handle          handle of the controller
- * @remaining_device_path      path specifying the child controller
- * @return                     status code
+ * @this:                      driver binding protocol
+ * @controller_handle:         handle of the controller
+ * @remaining_device_path:     path specifying the child controller
+ * Return:                     status code
  */
 static efi_status_t EFIAPI efi_uc_supported(
                struct efi_driver_binding_protocol *this,
@@ -93,13 +94,13 @@ out:
        return EFI_EXIT(ret);
 }
 
-/*
- * Create child controllers and attach driver.
+/**
+ * efi_uc_start() - create child controllers and attach driver
  *
- * @this                       driver binding protocol
- * @controller_handle          handle of the controller
- * @remaining_device_path      path specifying the child controller
- * @return                     status code
+ * @this:                      driver binding protocol
+ * @controller_handle:         handle of the controller
+ * @remaining_device_path:     path specifying the child controller
+ * Return:                     status code
  */
 static efi_status_t EFIAPI efi_uc_start(
                struct efi_driver_binding_protocol *this,
@@ -147,12 +148,13 @@ out:
        return EFI_EXIT(ret);
 }
 
-/*
- * Remove a single child controller from the parent controller.
+/**
+ * disconnect_child() - remove a single child controller from the parent
+ *                     controller
  *
- * @controller_handle  parent controller
- * @child_handle       child controller
- * @return             status code
+ * @controller_handle: parent controller
+ * @child_handle:      child controller
+ * Return:             status code
  */
 static efi_status_t disconnect_child(efi_handle_t controller_handle,
                                     efi_handle_t child_handle)
@@ -177,14 +179,14 @@ static efi_status_t disconnect_child(efi_handle_t controller_handle,
        return ret;
 }
 
-/*
- * Remove child controllers and disconnect the controller.
+/**
+ * efi_uc_stop() - Remove child controllers and disconnect the controller
  *
- * @this                       driver binding protocol
- * @controller_handle          handle of the controller
- * @number_of_children         number of child controllers to remove
- * @child_handle_buffer                handles of the child controllers to remove
- * @return                     status code
+ * @this:                      driver binding protocol
+ * @controller_handle:         handle of the controller
+ * @number_of_children:                number of child controllers to remove
+ * @child_handle_buffer:       handles of the child controllers to remove
+ * Return:                     status code
  */
 static efi_status_t EFIAPI efi_uc_stop(
                struct efi_driver_binding_protocol *this,
@@ -231,8 +233,7 @@ static efi_status_t EFIAPI efi_uc_stop(
        }
        ret = EFI_CALL(systab.boottime->free_pool(entry_buffer));
        if (ret != EFI_SUCCESS)
-               printf("%s(%u) %s: ERROR: Cannot free pool\n",
-                      __FILE__, __LINE__, __func__);
+               printf("%s: ERROR: Cannot free pool\n", __func__);
 
        /* Detach driver from controller */
        ret = EFI_CALL(systab.boottime->close_protocol(
@@ -242,6 +243,12 @@ out:
        return EFI_EXIT(ret);
 }
 
+/**
+ * efi_add_driver() - add driver
+ *
+ * @drv:               driver to add
+ * Return:             status code
+ */
 static efi_status_t efi_add_driver(struct driver *drv)
 {
        efi_status_t ret;
@@ -281,20 +288,18 @@ out:
        return ret;
 }
 
-/*
- * Initialize the EFI drivers.
- * Called by board_init_r().
+/**
+ * efi_driver_init() - initialize the EFI drivers
  *
- * @return     0 = success, any other value will stop further execution
+ * Called by efi_init_obj_list().
+ *
+ * Return:     0 = success, any other value will stop further execution
  */
 efi_status_t efi_driver_init(void)
 {
        struct driver *drv;
        efi_status_t ret = EFI_SUCCESS;
 
-       /* Save 'gd' pointer */
-       efi_save_gd();
-
        debug("EFI: Initializing EFI driver framework\n");
        for (drv = ll_entry_start(struct driver, driver);
             drv < ll_entry_end(struct driver, driver); ++drv) {
@@ -310,12 +315,24 @@ efi_status_t efi_driver_init(void)
        return ret;
 }
 
+/**
+ * efi_uc_init() - initialize the EFI uclass
+ *
+ * @class:     the EFI uclass
+ * Return:     0 = success
+ */
 static int efi_uc_init(struct uclass *class)
 {
        printf("EFI: Initializing UCLASS_EFI\n");
        return 0;
 }
 
+/**
+ * efi_uc_destroy() - destroy the EFI uclass
+ *
+ * @class:     the EFI uclass
+ * Return:     0 = success
+ */
 static int efi_uc_destroy(struct uclass *class)
 {
        printf("Destroying  UCLASS_EFI\n");