dm: spi: Change cs_info op to return -EINVAL for invalid cs num
[oweals/u-boot.git] / api / api.c
index 7eee2fc083affa349f393b529c917dd7ea5b76e7..bc9454eb4b631e81f78f9fd033c24b019e77fb7f 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -1,16 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2007 Semihalf
  *
  * Written by: Rafal Jaworowski <raj@semihalf.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 #include <command.h>
 #include <common.h>
+#include <env.h>
 #include <malloc.h>
-#include <environment.h>
+#include <env_internal.h>
 #include <linux/types.h>
 #include <api_public.h>
 
@@ -497,7 +497,7 @@ static int API_env_enum(va_list ap)
 {
        int i, buflen;
        char *last, **next, *s;
-       ENTRY *match, search;
+       struct env_entry *match, search;
        static char *var;
 
        last = (char *)va_arg(ap, unsigned long);
@@ -514,7 +514,7 @@ static int API_env_enum(va_list ap)
                if (s != NULL)
                        *s = 0;
                search.key = var;
-               i = hsearch_r(search, FIND, &match, &env_htab, 0);
+               i = hsearch_r(search, ENV_FIND, &match, &env_htab, 0);
                if (i == 0) {
                        i = API_EINVAL;
                        goto done;