Re: [RFC/RFT PATCH 10/18] PCI: rcar: Convert PCI scan API to pci_scan_root_bus_bridge()

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

 



On Wed, Apr 26, 2017 at 1:18 PM, Lorenzo Pieralisi
<lorenzo.pieralisi@xxxxxxx> wrote:
> The introduction of pci_scan_root_bus_bridge() provides a PCI core
> API to scan a PCI root bus backed by an already initialized
> struct pci_host_bridge object, which simplifies the bus scan
> interface and makes the PCI scan root bus interface easier to
> generalize as members are added to the struct pci_host_bridge().
>
> Convert PCI rcar host code to pci_scan_root_bus_bridge() to
> improve the PCI root bus scanning interface.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> Cc: Simon Horman <horms@xxxxxxxxxxxx>
> ---
>  drivers/pci/host/pcie-rcar.c | 28 ++++++++++++++++++----------
>  1 file changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index cb07c45..051b4db 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -451,27 +451,35 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie)
>  {
>         struct device *dev = pcie->dev;
>         struct pci_bus *bus, *child;
> -       LIST_HEAD(res);
> +       struct pci_host_bridge *bridge;
> +       int ret;
> +
> +       bridge = pci_alloc_host_bridge(0);
> +       if (!bridge)
> +               return -ENOMEM;

The pci_alloc_host_bridge() here should also be moved into
rcare_pcie_probe(), replacing the devm_kzalloc there.

        Arnd



[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