On 31/01/2023 02:06, Daniel Kaehn wrote: > On Sun, Jan 29, 2023 at 5:06 AM Krzysztof Kozlowski > <krzysztof.kozlowski@xxxxxxxxxx> wrote: >> >> On 28/01/2023 21:26, Danny Kaehn wrote: >>> +#if defined(CONFIG_OF_GPIO) >> >> Don't use #if, but IS_ENABLED(). I think it should work here. > > I think I will still need to use an #if / some sort of preprocessor directive, > since of_node is only a member of the gpio_chip struct if that is enabled > (and thus causes a compile error if done outside of the preprocessor)... > Unless I'm misinterpreting your comment? If of_node in gpio_chip is indeed hidden by #ifdef, then the code is ok. Best regards, Krzysztof