mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
dm: pci: Avoid setting a PCI region that has 0 size
It makes no sense to set a PCI region that has 0 size. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
1eaf7800b6
commit
ee1109bb45
|
@ -897,8 +897,9 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
|
||||||
#endif
|
#endif
|
||||||
if (gd->pci_ram_top && gd->pci_ram_top < base + size)
|
if (gd->pci_ram_top && gd->pci_ram_top < base + size)
|
||||||
size = gd->pci_ram_top - base;
|
size = gd->pci_ram_top - base;
|
||||||
pci_set_region(hose->regions + hose->region_count++, base, base,
|
if (size)
|
||||||
size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
|
pci_set_region(hose->regions + hose->region_count++, base,
|
||||||
|
base, size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user