[PATCH 80/81] api: Remove <common.h> and add needed includes

Tom Rini trini at konsulko.com
Thu May 2 03:31:37 CEST 2024


Remove <common.h> from here and when needed add missing include files
directly.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 api/api.c                           | 4 +++-
 api/api_display.c                   | 2 +-
 api/api_net.c                       | 1 -
 api/api_storage.c                   | 2 +-
 examples/api/demo.c                 | 2 +-
 examples/api/glue.c                 | 1 -
 examples/api/libgenwrap.c           | 1 -
 examples/standalone/atmel_df_pow2.c | 1 -
 examples/standalone/sched.c         | 1 -
 examples/standalone/stubs.c         | 1 -
 include/api_public.h                | 2 ++
 11 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/api/api.c b/api/api.c
index 89003c161c2f..d22132f62fe3 100644
--- a/api/api.c
+++ b/api/api.c
@@ -7,11 +7,13 @@
 
 #include <config.h>
 #include <command.h>
-#include <common.h>
 #include <env.h>
 #include <malloc.h>
+#include <time.h>
 #include <env_internal.h>
+#include <vsprintf.h>
 #include <linux/delay.h>
+#include <linux/errno.h>
 #include <linux/types.h>
 #include <api_public.h>
 #include <u-boot/crc.h>
diff --git a/api/api_display.c b/api/api_display.c
index 2e877a85d147..8fd078c8c4aa 100644
--- a/api/api_display.c
+++ b/api/api_display.c
@@ -3,9 +3,9 @@
  * Copyright (c) 2011 The Chromium OS Authors.
  */
 
-#include <common.h>
 #include <api_public.h>
 #include <log.h>
+#include <linux/types.h>
 
 /* TODO(clchiou): add support of video device */
 
diff --git a/api/api_net.c b/api/api_net.c
index 7515c26e8b44..264ff530563b 100644
--- a/api/api_net.c
+++ b/api/api_net.c
@@ -6,7 +6,6 @@
  */
 
 #include <config.h>
-#include <common.h>
 #include <net.h>
 #include <linux/types.h>
 #include <api_public.h>
diff --git a/api/api_storage.c b/api/api_storage.c
index 78becbe39fb6..3d2d9d6ef4c1 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -6,10 +6,10 @@
  */
 
 #include <config.h>
-#include <common.h>
 #include <api_public.h>
 #include <part.h>
 #include <scsi.h>
+#include <linux/types.h>
 
 #if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
 #include <usb.h>
diff --git a/examples/api/demo.c b/examples/api/demo.c
index d586174ce8c9..677d13b307a1 100644
--- a/examples/api/demo.c
+++ b/examples/api/demo.c
@@ -5,7 +5,7 @@
  * Written by: Rafal Jaworowski <raj at semihalf.com>
  */
 
-#include <common.h>
+#include <stdio.h>
 #include <env.h>
 #include <linux/types.h>
 #include <api_public.h>
diff --git a/examples/api/glue.c b/examples/api/glue.c
index 075d307ae261..08c21a8cb9c1 100644
--- a/examples/api/glue.c
+++ b/examples/api/glue.c
@@ -3,7 +3,6 @@
  * (C) Copyright 2007-2008 Semihalf, Rafal Jaworowski <raj at semihalf.com>
  */
 
-#include <common.h>
 #include <env.h>
 #include <linux/types.h>
 #include <api_public.h>
diff --git a/examples/api/libgenwrap.c b/examples/api/libgenwrap.c
index 3aa222866ff5..bfd88e100d6e 100644
--- a/examples/api/libgenwrap.c
+++ b/examples/api/libgenwrap.c
@@ -9,7 +9,6 @@
  * existing code e.g. operations on strings and similar.
  */
 
-#include <common.h>
 #include <command.h>
 #include <hang.h>
 #include <linux/delay.h>
diff --git a/examples/standalone/atmel_df_pow2.c b/examples/standalone/atmel_df_pow2.c
index dcb25da94986..ed0d7aeaadca 100644
--- a/examples/standalone/atmel_df_pow2.c
+++ b/examples/standalone/atmel_df_pow2.c
@@ -6,7 +6,6 @@
  * Licensed under the 2-clause BSD.
  */
 
-#include <common.h>
 #include <exports.h>
 #include <spi.h>
 #include <linux/delay.h>
diff --git a/examples/standalone/sched.c b/examples/standalone/sched.c
index 1c5296071322..d507163f6f34 100644
--- a/examples/standalone/sched.c
+++ b/examples/standalone/sched.c
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 
-#include <common.h>
 #include <exports.h>
 
 /*
diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index 65115570e8eb..04e8acb8abe9 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -1,4 +1,3 @@
-#include <common.h>
 #include <exports.h>
 #include <linux/compiler.h>
 
diff --git a/include/api_public.h b/include/api_public.h
index 5a4465ea893d..e89572c00a4b 100644
--- a/include/api_public.h
+++ b/include/api_public.h
@@ -8,6 +8,8 @@
 #ifndef _API_PUBLIC_H_
 #define _API_PUBLIC_H_
 
+#include <linux/types.h>
+
 #define API_EINVAL		1	/* invalid argument(s)	*/
 #define API_ENODEV		2	/* no device		*/
 #define API_ENOMEM		3	/* no memory		*/
-- 
2.34.1



More information about the U-Boot mailing list