mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
Merge branch 'pci/devm'
- Export pcim_request_all_regions(), a managed interface to request all BARs (Philipp Stanner) - Replace pcim_iomap_regions_request_all() with pcim_request_all_regions(), and pcim_iomap_table()[n] with pcim_iomap(n), in the following drivers: ahci, crypto qat, crypto octeontx2, intel_th, iwlwifi, ntb idt, serial rp2, ALSA korg1212 (Philipp Stanner) - Remove the now unused pcim_iomap_regions_request_all() (Philipp Stanner) - Export pcim_iounmap_region(), a managed interface to unmap and release a PCI BAR (Philipp Stanner) - Replace pcim_iomap_regions(mask) with pcim_iomap_region(n), and pcim_iounmap_regions(mask) with pcim_iounmap_region(n), in the following drivers: fpga dfl-pci, block mtip32xx, gpio-merrifield, cavium (Philipp Stanner) * pci/devm: ethernet: cavium: Replace deprecated PCI functions gpio: Replace deprecated PCI functions fpga/dfl-pci.c: Replace deprecated PCI functions PCI: Deprecate pcim_iounmap_regions() PCI: Make pcim_iounmap_region() a public function PCI: Remove pcim_iomap_regions_request_all() ALSA: korg1212: Replace deprecated PCI functions serial: rp2: Replace deprecated PCI functions ntb: idt: Replace deprecated PCI functions wifi: iwlwifi: replace deprecated PCI functions intel_th: pci: Replace deprecated PCI functions crypto: marvell - replace deprecated PCI functions crypto: qat - replace deprecated PCI functions ata: ahci: Replace deprecated PCI functions PCI: Make pcim_request_all_regions() a public function
This commit is contained in:
commit
f326ce1693
|
|
@ -394,7 +394,6 @@ PCI
|
|||
pcim_enable_device() : after success, some PCI ops become managed
|
||||
pcim_iomap() : do iomap() on a single BAR
|
||||
pcim_iomap_regions() : do request_region() and iomap() on multiple BARs
|
||||
pcim_iomap_regions_request_all() : do request_region() on all and iomap() on multiple BARs
|
||||
pcim_iomap_table() : array of mapped addresses indexed by BAR
|
||||
pcim_iounmap() : do iounmap() on a single BAR
|
||||
pcim_iounmap_regions() : do iounmap() and release_region() on multiple BARs
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
|
|||
/* AHCI controllers often implement SFF compatible interface.
|
||||
* Grab all PCI BARs just in case.
|
||||
*/
|
||||
rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
|
||||
rc = pcim_request_all_regions(pdev, DRV_NAME);
|
||||
if (rc == -EBUSY)
|
||||
pcim_pin_device(pdev);
|
||||
if (rc)
|
||||
|
|
@ -386,7 +386,9 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
|
|||
if (!(hpriv->flags & AHCI_HFLAG_NO_MSI))
|
||||
pci_enable_msi(pdev);
|
||||
|
||||
hpriv->mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
|
||||
hpriv->mmio = pcim_iomap(pdev, AHCI_PCI_BAR, 0);
|
||||
if (!hpriv->mmio)
|
||||
return -ENOMEM;
|
||||
|
||||
/* save initial config */
|
||||
ahci_save_initial_config(&pdev->dev, hpriv);
|
||||
|
|
|
|||
|
|
@ -1869,7 +1869,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* AHCI controllers often implement SFF compatible interface.
|
||||
* Grab all PCI BARs just in case.
|
||||
*/
|
||||
rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
|
||||
rc = pcim_request_all_regions(pdev, DRV_NAME);
|
||||
if (rc == -EBUSY)
|
||||
pcim_pin_device(pdev);
|
||||
if (rc)
|
||||
|
|
@ -1893,7 +1893,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
if (ahci_sb600_enable_64bit(pdev))
|
||||
hpriv->flags &= ~AHCI_HFLAG_32BIT_ONLY;
|
||||
|
||||
hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar];
|
||||
hpriv->mmio = pcim_iomap(pdev, ahci_pci_bar, 0);
|
||||
if (!hpriv->mmio)
|
||||
return -ENOMEM;
|
||||
|
||||
/* detect remapped nvme devices */
|
||||
ahci_remap_check(pdev, ahci_pci_bar, hpriv);
|
||||
|
|
|
|||
|
|
@ -129,16 +129,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* Find and map all the device's BARS */
|
||||
bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK;
|
||||
|
||||
ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev));
|
||||
ret = pcim_request_all_regions(pdev, pci_name(pdev));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to map pci regions.\n");
|
||||
dev_err(&pdev->dev, "Failed to request PCI regions.\n");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) {
|
||||
bar = &accel_pci_dev->pci_bars[i++];
|
||||
bar->virt_addr = pcim_iomap_table(pdev)[bar_nr];
|
||||
bar->virt_addr = pcim_iomap(pdev, bar_nr, 0);
|
||||
if (!bar->virt_addr) {
|
||||
dev_err(&pdev->dev, "Failed to ioremap PCI region.\n");
|
||||
ret = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
|
|
|||
|
|
@ -131,16 +131,21 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* Find and map all the device's BARS */
|
||||
bar_mask = pci_select_bars(pdev, IORESOURCE_MEM) & ADF_GEN4_BAR_MASK;
|
||||
|
||||
ret = pcim_iomap_regions_request_all(pdev, bar_mask, pci_name(pdev));
|
||||
ret = pcim_request_all_regions(pdev, pci_name(pdev));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to map pci regions.\n");
|
||||
dev_err(&pdev->dev, "Failed to request PCI regions.\n");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
for_each_set_bit(bar_nr, &bar_mask, PCI_STD_NUM_BARS) {
|
||||
bar = &accel_pci_dev->pci_bars[i++];
|
||||
bar->virt_addr = pcim_iomap_table(pdev)[bar_nr];
|
||||
bar->virt_addr = pcim_iomap(pdev, bar_nr, 0);
|
||||
if (!bar->virt_addr) {
|
||||
dev_err(&pdev->dev, "Failed to ioremap PCI region.\n");
|
||||
ret = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
}
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
|
|
|||
|
|
@ -739,18 +739,22 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
|
|||
dev_err(dev, "Unable to get usable DMA configuration\n");
|
||||
goto clear_drvdata;
|
||||
}
|
||||
/* Map PF's configuration registers */
|
||||
err = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
|
||||
OTX2_CPT_DRV_NAME);
|
||||
err = pcim_request_all_regions(pdev, OTX2_CPT_DRV_NAME);
|
||||
if (err) {
|
||||
dev_err(dev, "Couldn't get PCI resources 0x%x\n", err);
|
||||
dev_err(dev, "Couldn't request PCI resources 0x%x\n", err);
|
||||
goto clear_drvdata;
|
||||
}
|
||||
pci_set_master(pdev);
|
||||
pci_set_drvdata(pdev, cptpf);
|
||||
cptpf->pdev = pdev;
|
||||
|
||||
cptpf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
|
||||
/* Map PF's configuration registers */
|
||||
cptpf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
|
||||
if (!cptpf->reg_base) {
|
||||
err = -ENOMEM;
|
||||
dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", err);
|
||||
goto clear_drvdata;
|
||||
}
|
||||
|
||||
/* Check if AF driver is up, otherwise defer probe */
|
||||
err = cpt_is_pf_usable(cptpf);
|
||||
|
|
|
|||
|
|
@ -358,9 +358,8 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
|
|||
dev_err(dev, "Unable to get usable DMA configuration\n");
|
||||
goto clear_drvdata;
|
||||
}
|
||||
/* Map VF's configuration registers */
|
||||
ret = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
|
||||
OTX2_CPTVF_DRV_NAME);
|
||||
|
||||
ret = pcim_request_all_regions(pdev, OTX2_CPTVF_DRV_NAME);
|
||||
if (ret) {
|
||||
dev_err(dev, "Couldn't get PCI resources 0x%x\n", ret);
|
||||
goto clear_drvdata;
|
||||
|
|
@ -369,7 +368,13 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
|
|||
pci_set_drvdata(pdev, cptvf);
|
||||
cptvf->pdev = pdev;
|
||||
|
||||
cptvf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
|
||||
/* Map VF's configuration registers */
|
||||
cptvf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
|
||||
if (!cptvf->reg_base) {
|
||||
ret = -ENOMEM;
|
||||
dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", ret);
|
||||
goto clear_drvdata;
|
||||
}
|
||||
|
||||
otx2_cpt_set_hw_caps(pdev, &cptvf->cap_flag);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,14 +39,6 @@ struct cci_drvdata {
|
|||
struct dfl_fpga_cdev *cdev; /* container device */
|
||||
};
|
||||
|
||||
static void __iomem *cci_pci_ioremap_bar0(struct pci_dev *pcidev)
|
||||
{
|
||||
if (pcim_iomap_regions(pcidev, BIT(0), DRV_NAME))
|
||||
return NULL;
|
||||
|
||||
return pcim_iomap_table(pcidev)[0];
|
||||
}
|
||||
|
||||
static int cci_pci_alloc_irq(struct pci_dev *pcidev)
|
||||
{
|
||||
int ret, nvec = pci_msix_vec_count(pcidev);
|
||||
|
|
@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
|
|||
u64 v;
|
||||
|
||||
/* start to find Device Feature List from Bar 0 */
|
||||
base = cci_pci_ioremap_bar0(pcidev);
|
||||
if (!base)
|
||||
return -ENOMEM;
|
||||
base = pcim_iomap_region(pcidev, 0, DRV_NAME);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
|
||||
/*
|
||||
* PF device has FME and Ports/AFUs, and VF device only has one
|
||||
|
|
@ -296,7 +288,7 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
|
|||
}
|
||||
|
||||
/* release I/O mappings for next step enumeration */
|
||||
pcim_iounmap_regions(pcidev, BIT(0));
|
||||
pcim_iounmap_region(pcidev, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,24 +78,25 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
|
|||
if (retval)
|
||||
return retval;
|
||||
|
||||
retval = pcim_iomap_regions(pdev, BIT(1) | BIT(0), pci_name(pdev));
|
||||
if (retval)
|
||||
return dev_err_probe(dev, retval, "I/O memory mapping error\n");
|
||||
|
||||
base = pcim_iomap_table(pdev)[1];
|
||||
base = pcim_iomap_region(pdev, 1, pci_name(pdev));
|
||||
if (IS_ERR(base))
|
||||
return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n");
|
||||
|
||||
irq_base = readl(base + 0 * sizeof(u32));
|
||||
gpio_base = readl(base + 1 * sizeof(u32));
|
||||
|
||||
/* Release the IO mapping, since we already get the info from BAR1 */
|
||||
pcim_iounmap_regions(pdev, BIT(1));
|
||||
pcim_iounmap_region(pdev, 1);
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->dev = dev;
|
||||
priv->reg_base = pcim_iomap_table(pdev)[0];
|
||||
priv->reg_base = pcim_iomap_region(pdev, 0, pci_name(pdev));
|
||||
if (IS_ERR(priv->reg_base))
|
||||
return dev_err_probe(dev, PTR_ERR(priv->reg_base),
|
||||
"I/O memory mapping error\n");
|
||||
|
||||
priv->pin_info.pin_ranges = mrfld_gpio_ranges;
|
||||
priv->pin_info.nranges = ARRAY_SIZE(mrfld_gpio_ranges);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ enum {
|
|||
TH_PCI_RTIT_BAR = 4,
|
||||
};
|
||||
|
||||
#define BAR_MASK (BIT(TH_PCI_CONFIG_BAR) | BIT(TH_PCI_STH_SW_BAR))
|
||||
|
||||
#define PCI_REG_NPKDSC 0x80
|
||||
#define NPKDSC_TSACT BIT(5)
|
||||
|
|
@ -83,10 +82,16 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
err = pcim_iomap_regions_request_all(pdev, BAR_MASK, DRIVER_NAME);
|
||||
err = pcim_request_all_regions(pdev, DRIVER_NAME);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!pcim_iomap(pdev, TH_PCI_CONFIG_BAR, 0))
|
||||
return -ENOMEM;
|
||||
|
||||
if (!pcim_iomap(pdev, TH_PCI_STH_SW_BAR, 0))
|
||||
return -ENOMEM;
|
||||
|
||||
if (pdev->resource[TH_PCI_RTIT_BAR].start) {
|
||||
resource[TH_MMIO_RTIT] = pdev->resource[TH_PCI_RTIT_BAR];
|
||||
r++;
|
||||
|
|
|
|||
|
|
@ -239,12 +239,11 @@ static int cavium_ptp_probe(struct pci_dev *pdev,
|
|||
if (err)
|
||||
goto error_free;
|
||||
|
||||
err = pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev));
|
||||
clock->reg_base = pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev));
|
||||
err = PTR_ERR_OR_ZERO(clock->reg_base);
|
||||
if (err)
|
||||
goto error_free;
|
||||
|
||||
clock->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO];
|
||||
|
||||
spin_lock_init(&clock->spin_lock);
|
||||
|
||||
cc = &clock->cycle_counter;
|
||||
|
|
@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev,
|
|||
clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
|
||||
clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN;
|
||||
writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
|
||||
pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO);
|
||||
pcim_iounmap_region(pdev, PCI_PTP_BAR_NO);
|
||||
|
||||
error_free:
|
||||
devm_kfree(dev, clock);
|
||||
|
|
|
|||
|
|
@ -3533,7 +3533,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
|
|||
struct iwl_trans_pcie *trans_pcie, **priv;
|
||||
struct iwl_trans *trans;
|
||||
int ret, addr_size;
|
||||
void __iomem * const *table;
|
||||
u32 bar0;
|
||||
|
||||
/* reassign our BAR 0 if invalid due to possible runtime PM races */
|
||||
|
|
@ -3659,22 +3658,15 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
|
|||
}
|
||||
}
|
||||
|
||||
ret = pcim_iomap_regions_request_all(pdev, BIT(0), DRV_NAME);
|
||||
ret = pcim_request_all_regions(pdev, DRV_NAME);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "pcim_iomap_regions_request_all failed\n");
|
||||
dev_err(&pdev->dev, "Requesting all PCI BARs failed.\n");
|
||||
goto out_no_pci;
|
||||
}
|
||||
|
||||
table = pcim_iomap_table(pdev);
|
||||
if (!table) {
|
||||
dev_err(&pdev->dev, "pcim_iomap_table failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto out_no_pci;
|
||||
}
|
||||
|
||||
trans_pcie->hw_base = table[0];
|
||||
trans_pcie->hw_base = pcim_iomap(pdev, 0, 0);
|
||||
if (!trans_pcie->hw_base) {
|
||||
dev_err(&pdev->dev, "couldn't find IO mem in first BAR\n");
|
||||
dev_err(&pdev->dev, "Could not ioremap PCI BAR 0.\n");
|
||||
ret = -ENODEV;
|
||||
goto out_no_pci;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2671,15 +2671,20 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
|
|||
*/
|
||||
pci_set_master(pdev);
|
||||
|
||||
/* Request all BARs resources and map BAR0 only */
|
||||
ret = pcim_iomap_regions_request_all(pdev, 1, NTB_NAME);
|
||||
/* Request all BARs resources */
|
||||
ret = pcim_request_all_regions(pdev, NTB_NAME);
|
||||
if (ret != 0) {
|
||||
dev_err(&pdev->dev, "Failed to request resources\n");
|
||||
goto err_clear_master;
|
||||
}
|
||||
|
||||
/* Retrieve virtual address of BAR0 - PCI configuration space */
|
||||
ndev->cfgspc = pcim_iomap_table(pdev)[0];
|
||||
/* ioremap BAR0 - PCI configuration space */
|
||||
ndev->cfgspc = pcim_iomap(pdev, 0, 0);
|
||||
if (!ndev->cfgspc) {
|
||||
dev_err(&pdev->dev, "Failed to ioremap BAR 0\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_clear_master;
|
||||
}
|
||||
|
||||
/* Put the IDT driver data pointer to the PCI-device private pointer */
|
||||
pci_set_drvdata(pdev, ndev);
|
||||
|
|
|
|||
|
|
@ -773,7 +773,7 @@ EXPORT_SYMBOL(pcim_iomap_region);
|
|||
* Unmap a BAR and release its region manually. Only pass BARs that were
|
||||
* previously mapped by pcim_iomap_region().
|
||||
*/
|
||||
static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
|
||||
void pcim_iounmap_region(struct pci_dev *pdev, int bar)
|
||||
{
|
||||
struct pcim_addr_devres res_searched;
|
||||
|
||||
|
|
@ -784,6 +784,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, int bar)
|
|||
devres_release(&pdev->dev, pcim_addr_resource_release,
|
||||
pcim_addr_resources_match, &res_searched);
|
||||
}
|
||||
EXPORT_SYMBOL(pcim_iounmap_region);
|
||||
|
||||
/**
|
||||
* pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED)
|
||||
|
|
@ -939,7 +940,7 @@ static void pcim_release_all_regions(struct pci_dev *pdev)
|
|||
* desired, release individual regions with pcim_release_region() or all of
|
||||
* them at once with pcim_release_all_regions().
|
||||
*/
|
||||
static int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
|
||||
int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
|
||||
{
|
||||
int ret;
|
||||
int bar;
|
||||
|
|
@ -957,69 +958,17 @@ static int pcim_request_all_regions(struct pci_dev *pdev, const char *name)
|
|||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(pcim_request_all_regions);
|
||||
|
||||
/**
|
||||
* pcim_iomap_regions_request_all - Request all BARs and iomap specified ones
|
||||
* (DEPRECATED)
|
||||
* @pdev: PCI device to map IO resources for
|
||||
* @mask: Mask of BARs to iomap
|
||||
* @name: Name associated with the requests
|
||||
*
|
||||
* Returns: 0 on success, negative error code on failure.
|
||||
*
|
||||
* Request all PCI BARs and iomap regions specified by @mask.
|
||||
*
|
||||
* To release these resources manually, call pcim_release_region() for the
|
||||
* regions and pcim_iounmap() for the mappings.
|
||||
*
|
||||
* This function is DEPRECATED. Don't use it in new code. Instead, use one
|
||||
* of the pcim_* region request functions in combination with a pcim_*
|
||||
* mapping function.
|
||||
*/
|
||||
int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask,
|
||||
const char *name)
|
||||
{
|
||||
int bar;
|
||||
int ret;
|
||||
void __iomem **legacy_iomap_table;
|
||||
|
||||
ret = pcim_request_all_regions(pdev, name);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) {
|
||||
if (!mask_contains_bar(mask, bar))
|
||||
continue;
|
||||
if (!pcim_iomap(pdev, bar, 0))
|
||||
goto err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
/*
|
||||
* If bar is larger than 0, then pcim_iomap() above has most likely
|
||||
* failed because of -EINVAL. If it is equal 0, most likely the table
|
||||
* couldn't be created, indicating -ENOMEM.
|
||||
*/
|
||||
ret = bar > 0 ? -EINVAL : -ENOMEM;
|
||||
legacy_iomap_table = (void __iomem **)pcim_iomap_table(pdev);
|
||||
|
||||
while (--bar >= 0)
|
||||
pcim_iounmap(pdev, legacy_iomap_table[bar]);
|
||||
|
||||
pcim_release_all_regions(pdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(pcim_iomap_regions_request_all);
|
||||
|
||||
/**
|
||||
* pcim_iounmap_regions - Unmap and release PCI BARs
|
||||
* pcim_iounmap_regions - Unmap and release PCI BARs (DEPRECATED)
|
||||
* @pdev: PCI device to map IO resources for
|
||||
* @mask: Mask of BARs to unmap and release
|
||||
*
|
||||
* Unmap and release regions specified by @mask.
|
||||
*
|
||||
* This function is DEPRECATED. Do not use it in new code.
|
||||
* Use pcim_iounmap_region() instead.
|
||||
*/
|
||||
void pcim_iounmap_regions(struct pci_dev *pdev, int mask)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -698,7 +698,6 @@ static int rp2_probe(struct pci_dev *pdev,
|
|||
const struct firmware *fw;
|
||||
struct rp2_card *card;
|
||||
struct rp2_uart_port *ports;
|
||||
void __iomem * const *bars;
|
||||
int rc;
|
||||
|
||||
card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL);
|
||||
|
|
@ -711,13 +710,16 @@ static int rp2_probe(struct pci_dev *pdev,
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = pcim_iomap_regions_request_all(pdev, 0x03, DRV_NAME);
|
||||
rc = pcim_request_all_regions(pdev, DRV_NAME);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
bars = pcim_iomap_table(pdev);
|
||||
card->bar0 = bars[0];
|
||||
card->bar1 = bars[1];
|
||||
card->bar0 = pcim_iomap(pdev, 0, 0);
|
||||
if (!card->bar0)
|
||||
return -ENOMEM;
|
||||
card->bar1 = pcim_iomap(pdev, 1, 0);
|
||||
if (!card->bar1)
|
||||
return -ENOMEM;
|
||||
card->pdev = pdev;
|
||||
|
||||
rp2_decode_cap(id, &card->n_ports, &card->smpte);
|
||||
|
|
|
|||
|
|
@ -2314,15 +2314,15 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass,
|
|||
struct pci_dev *dev) { }
|
||||
#endif
|
||||
|
||||
int pcim_request_all_regions(struct pci_dev *pdev, const char *name);
|
||||
void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
|
||||
void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar,
|
||||
const char *name);
|
||||
void pcim_iounmap_region(struct pci_dev *pdev, int bar);
|
||||
void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
|
||||
void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
|
||||
int pcim_request_region(struct pci_dev *pdev, int bar, const char *name);
|
||||
int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name);
|
||||
int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask,
|
||||
const char *name);
|
||||
void pcim_iounmap_regions(struct pci_dev *pdev, int mask);
|
||||
void __iomem *pcim_iomap_range(struct pci_dev *pdev, int bar,
|
||||
unsigned long offset, unsigned long len);
|
||||
|
|
|
|||
|
|
@ -2108,7 +2108,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
|
|||
for (i=0; i<kAudioChannels; i++)
|
||||
korg1212->volumePhase[i] = 0;
|
||||
|
||||
err = pcim_iomap_regions_request_all(pci, 1 << 0, "korg1212");
|
||||
err = pcim_request_all_regions(pci, "korg1212");
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
|
@ -2130,7 +2130,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci)
|
|||
korg1212->iomem2, iomem2_size,
|
||||
stateName[korg1212->cardState]);
|
||||
|
||||
korg1212->iobase = pcim_iomap_table(pci)[0];
|
||||
korg1212->iobase = pcim_iomap(pci, 0, 0);
|
||||
if (!korg1212->iobase)
|
||||
return -ENOMEM;
|
||||
|
||||
err = devm_request_irq(&pci->dev, pci->irq, snd_korg1212_interrupt,
|
||||
IRQF_SHARED,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user