From e2e69291ee6031eccf50113fdd12099a1a7d44ba Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Thu, 18 Jan 2024 19:10:47 +0100 Subject: [PATCH] headers: don't depend on errno.h being available These headers follow the pattern: | #if CONFIG_IS_ENABLED(FANCY_FEATURE) | void foo(void); | #else | static inline void foo(void) { return -ENOSYS; } | #endif In the #else path ENOSYS is used, however linux/errno.h is not included. If errno.h has not been included already the compiler errors out even if the inline function is not referenced. Make those headers self contained. Signed-off-by: Max Krummenacher Reviewed-by: Francesco Dolcini Reviewed-by: Tom Rini --- include/dfu.h | 1 + include/dm/pinctrl.h | 2 ++ include/hwspinlock.h | 2 ++ include/i2c_eeprom.h | 2 ++ include/nvmem.h | 2 ++ include/power-domain.h | 2 ++ include/power/regulator.h | 2 ++ include/remoteproc.h | 1 + include/soc.h | 2 ++ include/spi-mem.h | 2 ++ include/sysinfo.h | 2 ++ include/tlv_eeprom.h | 2 ++ 12 files changed, 22 insertions(+) diff --git a/include/dfu.h b/include/dfu.h index 2f42781888..fa1918cd66 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -10,6 +10,7 @@ #ifndef __DFU_ENTITY_H_ #define __DFU_ENTITY_H_ +#include #include #include #include diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h index 70d8cc5eca..e41baea620 100644 --- a/include/dm/pinctrl.h +++ b/include/dm/pinctrl.h @@ -6,6 +6,8 @@ #ifndef __PINCTRL_H #define __PINCTRL_H +#include + #define PINNAME_SIZE 10 #define PINMUX_SIZE 90 diff --git a/include/hwspinlock.h b/include/hwspinlock.h index d8556c0b4b..dd5135442e 100644 --- a/include/hwspinlock.h +++ b/include/hwspinlock.h @@ -6,6 +6,8 @@ #ifndef _HWSPINLOCK_H_ #define _HWSPINLOCK_H_ +#include + /** * Implement a hwspinlock uclass. * Hardware spinlocks are used to perform hardware protection of diff --git a/include/i2c_eeprom.h b/include/i2c_eeprom.h index 32dcb03497..cba991e357 100644 --- a/include/i2c_eeprom.h +++ b/include/i2c_eeprom.h @@ -6,6 +6,8 @@ #ifndef __I2C_EEPROM #define __I2C_EEPROM +#include + struct udevice; struct i2c_eeprom_ops { diff --git a/include/nvmem.h b/include/nvmem.h index 822e698bdd..e6a8a98828 100644 --- a/include/nvmem.h +++ b/include/nvmem.h @@ -6,6 +6,8 @@ #ifndef NVMEM_H #define NVMEM_H +#include + /** * DOC: Design * diff --git a/include/power-domain.h b/include/power-domain.h index 2ff6c77cd7..18525073e5 100644 --- a/include/power-domain.h +++ b/include/power-domain.h @@ -6,6 +6,8 @@ #ifndef _POWER_DOMAIN_H #define _POWER_DOMAIN_H +#include + /** * A power domain is a portion of an SoC or chip that is powered by a * switchable source of power. In many cases, software has control over the diff --git a/include/power/regulator.h b/include/power/regulator.h index 200652cb3d..bb07a814c7 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -7,6 +7,8 @@ #ifndef _INCLUDE_REGULATOR_H_ #define _INCLUDE_REGULATOR_H_ +#include + struct udevice; /** diff --git a/include/remoteproc.h b/include/remoteproc.h index a11dc8a9b6..91a88791a4 100644 --- a/include/remoteproc.h +++ b/include/remoteproc.h @@ -14,6 +14,7 @@ * platforms have moved to dm/fdt. */ #include /* For platform data support - non dt world */ +#include /** * struct fw_rsc_hdr - firmware resource entry header diff --git a/include/soc.h b/include/soc.h index 850db28b76..b8cfc50770 100644 --- a/include/soc.h +++ b/include/soc.h @@ -7,6 +7,8 @@ #ifndef __SOC_H #define __SOC_H +#include + #define SOC_MAX_STR_SIZE 128 struct udevice; diff --git a/include/spi-mem.h b/include/spi-mem.h index b07cf2ed83..3c8e95b6f5 100644 --- a/include/spi-mem.h +++ b/include/spi-mem.h @@ -11,6 +11,8 @@ #ifndef __UBOOT_SPI_MEM_H #define __UBOOT_SPI_MEM_H +#include + struct udevice; #define SPI_MEM_OP_CMD(__opcode, __buswidth) \ diff --git a/include/sysinfo.h b/include/sysinfo.h index f2c1aa29d1..524c7d6b22 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -7,6 +7,8 @@ #ifndef __SYSINFO_H__ #define __SYSINFO_H__ +#include + struct udevice; /* diff --git a/include/tlv_eeprom.h b/include/tlv_eeprom.h index fd45e5f6eb..2b1e19b2bd 100644 --- a/include/tlv_eeprom.h +++ b/include/tlv_eeprom.h @@ -7,6 +7,8 @@ #ifndef __TLV_EEPROM_H_ #define __TLV_EEPROM_H_ +#include + /* * The Definition of the TlvInfo EEPROM format can be found at onie.org or * github.com/onie -- 2.39.5