Re: [PATCH] PCI: Check for the existence of 'dev.of_node' before calling of_platform_populate()

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

 



On Tue, 16 Jul 2024 at 01:04, Manivannan Sadhasivam
<manivannan.sadhasivam@xxxxxxxxxx> wrote:
>
> -       if (IS_ENABLED(CONFIG_OF) && pci_is_bridge(dev)) {
> +       if (IS_ENABLED(CONFIG_OF) && dev_of_node(&dev->dev) && pci_is_bridge(dev)) {
>                 retval = of_platform_populate(dev->dev.of_node, NULL, NULL,
>                                               &dev->dev);

I think you should just drop the IS_ENABLED(CONFIG_OF) check entirely.

afaik, dev_of_node() already returns NULL if CONFIG_OF isn't set.

So the bug was literally that you based the decision on something
pointless that shouldn't be there at all.

                Linus




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux