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 <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Max Krummenacher 2024-01-18 19:10:47 +01:00 committed by Tom Rini
parent cc7e3d1929
commit e2e69291ee
12 changed files with 22 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#ifndef __DFU_ENTITY_H_ #ifndef __DFU_ENTITY_H_
#define __DFU_ENTITY_H_ #define __DFU_ENTITY_H_
#include <linux/errno.h>
#include <linux/list.h> #include <linux/list.h>
#include <mmc.h> #include <mmc.h>
#include <spi_flash.h> #include <spi_flash.h>

View file

@ -6,6 +6,8 @@
#ifndef __PINCTRL_H #ifndef __PINCTRL_H
#define __PINCTRL_H #define __PINCTRL_H
#include <linux/errno.h>
#define PINNAME_SIZE 10 #define PINNAME_SIZE 10
#define PINMUX_SIZE 90 #define PINMUX_SIZE 90

View file

@ -6,6 +6,8 @@
#ifndef _HWSPINLOCK_H_ #ifndef _HWSPINLOCK_H_
#define _HWSPINLOCK_H_ #define _HWSPINLOCK_H_
#include <linux/errno.h>
/** /**
* Implement a hwspinlock uclass. * Implement a hwspinlock uclass.
* Hardware spinlocks are used to perform hardware protection of * Hardware spinlocks are used to perform hardware protection of

View file

@ -6,6 +6,8 @@
#ifndef __I2C_EEPROM #ifndef __I2C_EEPROM
#define __I2C_EEPROM #define __I2C_EEPROM
#include <linux/errno.h>
struct udevice; struct udevice;
struct i2c_eeprom_ops { struct i2c_eeprom_ops {

View file

@ -6,6 +6,8 @@
#ifndef NVMEM_H #ifndef NVMEM_H
#define NVMEM_H #define NVMEM_H
#include <linux/errno.h>
/** /**
* DOC: Design * DOC: Design
* *

View file

@ -6,6 +6,8 @@
#ifndef _POWER_DOMAIN_H #ifndef _POWER_DOMAIN_H
#define _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 * 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 * switchable source of power. In many cases, software has control over the

View file

@ -7,6 +7,8 @@
#ifndef _INCLUDE_REGULATOR_H_ #ifndef _INCLUDE_REGULATOR_H_
#define _INCLUDE_REGULATOR_H_ #define _INCLUDE_REGULATOR_H_
#include <linux/errno.h>
struct udevice; struct udevice;
/** /**

View file

@ -14,6 +14,7 @@
* platforms have moved to dm/fdt. * platforms have moved to dm/fdt.
*/ */
#include <dm/platdata.h> /* For platform data support - non dt world */ #include <dm/platdata.h> /* For platform data support - non dt world */
#include <linux/errno.h>
/** /**
* struct fw_rsc_hdr - firmware resource entry header * struct fw_rsc_hdr - firmware resource entry header

View file

@ -7,6 +7,8 @@
#ifndef __SOC_H #ifndef __SOC_H
#define __SOC_H #define __SOC_H
#include <linux/errno.h>
#define SOC_MAX_STR_SIZE 128 #define SOC_MAX_STR_SIZE 128
struct udevice; struct udevice;

View file

@ -11,6 +11,8 @@
#ifndef __UBOOT_SPI_MEM_H #ifndef __UBOOT_SPI_MEM_H
#define __UBOOT_SPI_MEM_H #define __UBOOT_SPI_MEM_H
#include <linux/errno.h>
struct udevice; struct udevice;
#define SPI_MEM_OP_CMD(__opcode, __buswidth) \ #define SPI_MEM_OP_CMD(__opcode, __buswidth) \

View file

@ -7,6 +7,8 @@
#ifndef __SYSINFO_H__ #ifndef __SYSINFO_H__
#define __SYSINFO_H__ #define __SYSINFO_H__
#include <linux/errno.h>
struct udevice; struct udevice;
/* /*

View file

@ -7,6 +7,8 @@
#ifndef __TLV_EEPROM_H_ #ifndef __TLV_EEPROM_H_
#define __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 * The Definition of the TlvInfo EEPROM format can be found at onie.org or
* github.com/onie * github.com/onie