]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: gpio: include integer type definitions for gpio.h
authorMathew McBride <matt@traverse.com.au>
Fri, 1 May 2026 01:36:02 +0000 (11:36 +1000)
committerPeng Fan <peng.fan@nxp.com>
Wed, 6 May 2026 08:04:48 +0000 (16:04 +0800)
Both consumers and sub-arch specific versions of gpio.h
may reference stdint or other non-C90 type definitions.

Ensure the common ones are available by including linux/types.h
before any other headers.

This issue came to light when the usb onboard hub driver
was enabled for ten64_tfa_defconfig:

In file included from ./arch/arm/include/asm/gpio.h:2,
 from common/usb_onboard_hub.c:10:
./arch/arm/include/asm/arch/gpio.h:17:9: error: unknown type name 'ulong'
   17 |         ulong addr;
./arch/arm/include/asm/arch/gpio.h:18:9: error: unknown type name 'ulong'
   18 |         ulong size;
./arch/arm/include/asm/arch/gpio.h:19:9: error: unknown type name 'uint'
   19 |         uint ngpios;

(In this instance, the cited errors actually originate from
arch/arm/include/asm/arch-fsl-layerscape/gpio.h, which is included
by the arm top level asm/gpio.h)

Implemented as per suggestion from Quentin Schulz in Link:

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Link: https://lore.kernel.org/u-boot/35038a9a-fa5a-4f9f-b34e-17cc80a7824c@cherry.de/
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/gpio.h

index 650783ae7324ceecd822c9736cf7aa028c7fd800..eba7bae9351cf0964dc744c4d3dd17b276cffdda 100644 (file)
@@ -1,3 +1,5 @@
+#include <linux/types.h>
+
 #ifdef CONFIG_GPIO_EXTRA_HEADER
 #include <asm/arch/gpio.h>
 #endif