[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MdvZQSwC93MuAse2cGuKpNCHO+0jGOjMRNyXYwvCrY_dw@mail.gmail.com>
Date: Tue, 16 Jul 2024 20:49:00 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: Check for the existence of 'dev.of_node' before
calling of_platform_populate()
On Tue, Jul 16, 2024 at 8:02 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> On Tue, 16 Jul 2024 at 01:04, Manivannan Sadhasivam
> <manivannan.sadhasivam@...aro.org> 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,
While at it: you could replace the dev.of_node here with dev_of_node()
too. I seem to have missed this helper.
Bartosz
> > &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
Powered by blists - more mailing lists