Re: [PATCH 4/4] CP2112 Devicetree Support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux