On Tue, Feb 23, 2016 at 11:17:52AM -0700, Stephen Warren wrote: > On 02/19/2016 11:01 AM, Thierry Reding wrote: [...] > >diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c > > >@@ -883,14 +904,24 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) > > >+ if (of_get_property(pcie->dev->of_node, "phys", NULL) == NULL) { > > Rather than re-parsing DT to determine this, thus duplicating the logic, > can't the code store some flag in tegra_pcie_phys_get() indicating which > path was taken, and that flag used here? Perhaps that flag could be based on > whether pcie->phy is set, although the else block here implies that > particular solution won't work. We could derive this by iterating over all ports and check whether each of them has its ->phys field set to !NULL. However, keeping track of it via a separate boolean seems to me like the less obfuscated version, so I've implemented that instead. Thanks, Thierry
Attachment:
signature.asc
Description: PGP signature