[PATCH u-boot-marvell 1/5] pci: pci_mvebu: use dev_seq instead of static variable

Stefan Roese sr at denx.de
Fri Feb 26 10:11:57 CET 2021


On 08.02.21 23:01, Marek Behún wrote:
> PCI uclass maps PCI bus numbers to the seq member of struct udevice.
> Use dev_seq(dev) as the bus number in mvebu_pcie_probe instead of an
> incrementing a static variable.
> 
> Signed-off-by: Marek Behún <marek.behun at nic.cz>
> Cc: Stefan Roese <sr at denx.de>
> Cc: Phil Sutter <phil at nwl.cc>
> Cc: Mario Six <mario.six at gdsys.cc>
> Cc: Baruch Siach <baruch at tkos.co.il>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/pci/pci_mvebu.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
> index 3ab03e3675..5c55a76d0e 100644
> --- a/drivers/pci/pci_mvebu.c
> +++ b/drivers/pci/pci_mvebu.c
> @@ -272,7 +272,7 @@ static int mvebu_pcie_probe(struct udevice *dev)
>   	struct mvebu_pcie *pcie = dev_get_plat(dev);
>   	struct udevice *ctlr = pci_get_controller(dev);
>   	struct pci_controller *hose = dev_get_uclass_priv(ctlr);
> -	static int bus;
> +	int bus = dev_seq(dev);
>   	u32 reg;
>   
>   	debug("%s: PCIe %d.%d - up, base %08x\n", __func__,
> @@ -335,8 +335,6 @@ static int mvebu_pcie_probe(struct udevice *dev)
>   	writel(SOC_REGS_PHY_BASE, pcie->base + PCIE_BAR_LO_OFF(0));
>   	writel(0, pcie->base + PCIE_BAR_HI_OFF(0));
>   
> -	bus++;
> -
>   	return 0;
>   }
>   
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list