summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2024-01-18 18:57:04 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2024-01-18 19:19:56 +0100
commitb62a70371a08cf0e216783cb3f8ddf516d2a8e5b (patch)
tree0caeef6287406427f2635622c3e87fd136869187 /include
parent9bdb65ea0102b447fd4795f2034b84c2d475faf7 (diff)
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. Upstream-Status: Submitted [https://lore.kernel.org/all/20240118181106.4133924-1-max.oss.09@gmail.com/T/#u] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'include')
-rw-r--r--include/dfu.h1
-rw-r--r--include/dm/pinctrl.h2
-rw-r--r--include/hwspinlock.h2
-rw-r--r--include/i2c_eeprom.h2
-rw-r--r--include/nvmem.h2
-rw-r--r--include/power-domain.h2
-rw-r--r--include/power/regulator.h2
-rw-r--r--include/remoteproc.h1
-rw-r--r--include/soc.h2
-rw-r--r--include/spi-mem.h2
-rw-r--r--include/sysinfo.h2
-rw-r--r--include/tlv_eeprom.h2
12 files changed, 22 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index 07922224ef..548c3700e6 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -11,6 +11,7 @@
#define __DFU_ENTITY_H_
#include <common.h>
+#include <linux/errno.h>
#include <linux/list.h>
#include <mmc.h>
#include <spi_flash.h>
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index e3e50afeaf..5dce3ec69f 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -6,6 +6,8 @@
#ifndef __PINCTRL_H
#define __PINCTRL_H
+#include <linux/errno.h>
+
#define PINNAME_SIZE 10
#define PINMUX_SIZE 80
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 <linux/errno.h>
+
/**
* 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 <linux/errno.h>
+
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 <linux/errno.h>
+
/**
* 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 <linux/errno.h>
+
/**
* 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 ff1bfc2435..d66d0e94f7 100644
--- a/include/power/regulator.h
+++ b/include/power/regulator.h
@@ -7,6 +7,8 @@
#ifndef _INCLUDE_REGULATOR_H_
#define _INCLUDE_REGULATOR_H_
+#include <linux/errno.h>
+
struct udevice;
/**
diff --git a/include/remoteproc.h b/include/remoteproc.h
index f48054de6b..1b0ffec6e5 100644
--- a/include/remoteproc.h
+++ b/include/remoteproc.h
@@ -14,6 +14,7 @@
* platforms have moved to dm/fdt.
*/
#include <dm/platdata.h> /* For platform data support - non dt world */
+#include <linux/errno.h>
/**
* struct fw_rsc_hdr - firmware resource entry header
diff --git a/include/soc.h b/include/soc.h
index a52a300a84..197d58443a 100644
--- a/include/soc.h
+++ b/include/soc.h
@@ -7,6 +7,8 @@
#ifndef __SOC_H
#define __SOC_H
+#include <linux/errno.h>
+
#define SOC_MAX_STR_SIZE 128
struct udevice;
diff --git a/include/spi-mem.h b/include/spi-mem.h
index 6b969919b6..fae7dfcaa4 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 <linux/errno.h>
+
struct udevice;
#define SPI_MEM_OP_DTR .dtr = 1
diff --git a/include/sysinfo.h b/include/sysinfo.h
index b140d742e9..c6e05dd5e9 100644
--- a/include/sysinfo.h
+++ b/include/sysinfo.h
@@ -7,6 +7,8 @@
#ifndef __SYSINFO_H__
#define __SYSINFO_H__
+#include <linux/errno.h>
+
struct udevice;
/*
diff --git a/include/tlv_eeprom.h b/include/tlv_eeprom.h
index a2c333e744..af28a0cdf7 100644
--- a/include/tlv_eeprom.h
+++ b/include/tlv_eeprom.h
@@ -7,6 +7,8 @@
#ifndef __TLV_EEPROM_H_
#define __TLV_EEPROM_H_
+#include <linux/errno.h>
+
/*
* The Definition of the TlvInfo EEPROM format can be found at onie.org or
* github.com/onie