[PATCH v2 1/8] usb: onboard-hub: fix compile issue with gpio.h import

Quentin Schulz quentin.schulz at cherry.de
Thu Apr 30 10:38:53 CEST 2026


Hi Mathew,

On 4/30/26 5:08 AM, Mathew McBride wrote:
> Hi Quentin,
> 
> On Sat, Apr 25, 2026, at 3:55 AM, Quentin Schulz wrote:
>> Hi Mathew,
>>
>> On 4/22/26 3:15 AM, Simon Glass wrote:
>>> On 2026-04-21T00:04:33, Mathew McBride <matt at traverse.com.au> wrote:
>>>> usb: onboard-hub: fix compile issue with gpio.h import
>>>>
>>>> This resolves the following compile error when compiling
>>>> 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;
>>>>
>>>> Reviewed-by: Peng Fan <peng.fan at nxp.com>
>>>> Signed-off-by: Mathew McBride <matt at traverse.com.au>
>>>> Reviewed-by: Marek Vasut <marek.vasut+usb at mailbox.org <mailto:%2Busb at mailbox.org>>
>>>>
>>>> common/usb_onboard_hub.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>
>> Only received the v1 so commenting here again:
>>
>> Well, it doesn't fix the actual issue which is include/asm/arch/gpio.h
>> use types that aren't defined in its scope.
>>
>> So what I think we should be doing instead is to add the proper include
>> in include/asm/arch/gpio.h such that the types are defined, I'm assuming
>> it should be as simple as adding
>>
>> #include <linux/types.h>
>>
>> to include/asm/arch/gpio.h (or replace the unknown types with something
>> that actually exist in that context). Otherwise, we'll end up having to
>> fix all users of asm/gpio.h which do not include linux/types.h one way
>> or the other. Can you please test that?
>>
> Adding #include <linux/types.h> to the top of arch/arm/include/asm/gpio.h
> does solve the issue, while leaving common/usb_onboard_hub.c untouched.
> (The CI does not detect any build errors as a result of this change on other boards).
> 
> There are other versions of asm/gpio.h for other archs (arc, mips, powerpc, sandbox, x86 etc.),
> but I think we should leave them alone unless a problem occurs?
> 

There are many others gpio.h missing proper includes. I'm not sure 
what's the best thing to do here but I wouldn't mind if you just fix the 
issue you encountered here.

Cheers,
Quentin


More information about the U-Boot mailing list