9
0
Fork 0

PCI: only check specific flag for 64bit BAR

The memory type may include other flags, so just check for
the 64bit allocation flag to see if the BAR is a 64bit one.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2016-11-01 09:58:52 +01:00 committed by Sascha Hauer
parent a793b694be
commit 9c29edf10b
1 changed files with 1 additions and 2 deletions

View File

@ -227,8 +227,7 @@ static void setup_device(struct pci_dev *dev, int max_bar)
dev->resource[bar].start = last_addr;
dev->resource[bar].end = last_addr + size - 1;
if ((mask & PCI_BASE_ADDRESS_MEM_TYPE_MASK) ==
PCI_BASE_ADDRESS_MEM_TYPE_64) {
if ((mask & PCI_BASE_ADDRESS_MEM_TYPE_64)) {
dev->resource[bar].flags |= IORESOURCE_MEM_64;
pci_write_config_dword(dev,
PCI_BASE_ADDRESS_1 + bar * 4, 0);