Commit 0851f344d7b3ef73e2520d4b6f5ad1e3bca8dc44

Authored by Bernhard Messerklinger
Committed by Bin Meng
1 parent ee1109bb45

x86: mmc: Fix mapping of BAR memory

Use dm_pci_map_bar function for BAR mapping. This has the advantage
of clearing BAR flags and and only accepting mapped memory.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

drivers/mmc/pci_mmc.c
... ... @@ -29,11 +29,10 @@
29 29 struct pci_mmc_plat *plat = dev_get_platdata(dev);
30 30 struct pci_mmc_priv *priv = dev_get_priv(dev);
31 31 struct sdhci_host *host = &priv->host;
32   - u32 ioaddr;
33 32 int ret;
34 33  
35   - dm_pci_read_config32(dev, PCI_BASE_ADDRESS_0, &ioaddr);
36   - host->ioaddr = map_sysmem(ioaddr, 0);
  34 + host->ioaddr = (void *)dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0,
  35 + PCI_REGION_MEM);
37 36 host->name = dev->name;
38 37 ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
39 38 if (ret)