Skip to content

Commit 58fa9c6

Browse files
Philipp Stannerbroonie
authored andcommitted
ASoC: intel: avs: Use pure devres PCI
pci_request_regions() is a hybrid function which becomes managed if pcim_enable_device() was called before. This hybrid nature is deprecated and should not be used anymore. Replace pci_request_regions() with the always-managed function pcim_request_all_regions(). Remove the goto jump to pci_release_regions(), since pcim_ functions clean up automatically. Signed-off-by: Philipp Stanner <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 45054bb commit 58fa9c6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sound/soc/intel/avs/core.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
445445
return ret;
446446
}
447447

448-
ret = pci_request_regions(pci, "AVS HDAudio");
448+
ret = pcim_request_all_regions(pci, "AVS HDAudio");
449449
if (ret < 0)
450450
return ret;
451451

@@ -454,8 +454,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
454454
bus->remap_addr = pci_ioremap_bar(pci, 0);
455455
if (!bus->remap_addr) {
456456
dev_err(bus->dev, "ioremap error\n");
457-
ret = -ENXIO;
458-
goto err_remap_bar0;
457+
return -ENXIO;
459458
}
460459

461460
adev->dsp_ba = pci_ioremap_bar(pci, 4);
@@ -512,8 +511,6 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
512511
iounmap(adev->dsp_ba);
513512
err_remap_bar4:
514513
iounmap(bus->remap_addr);
515-
err_remap_bar0:
516-
pci_release_regions(pci);
517514
return ret;
518515
}
519516

@@ -584,7 +581,6 @@ static void avs_pci_remove(struct pci_dev *pci)
584581
pci_free_irq_vectors(pci);
585582
iounmap(bus->remap_addr);
586583
iounmap(adev->dsp_ba);
587-
pci_release_regions(pci);
588584

589585
/* Firmware is not needed anymore */
590586
avs_release_firmwares(adev);

0 commit comments

Comments
 (0)