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? > > > + dev->gc.of_node = of_get_child_by_name(hdev->dev.of_node, "gpio"); > > You leak it now on error paths. Ah, good point. Will fix! Thanks, Danny Kaehn