ALSA: cs4281: Replace deprecated PCI functions
authorPhilipp Stanner <phasta@kernel.org>
Fri, 4 Apr 2025 12:19:07 +0000 (14:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 7 Apr 2025 07:19:57 +0000 (09:19 +0200)
pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250404121911.85277-8-phasta@kernel.org
sound/pci/cs4281.c

index 0cc86e73cc62ec416fb5e4df9875956c382e67fd..90958a422b75ebe0301e5407734b3a7fb45d6591 100644 (file)
@@ -1302,14 +1302,15 @@ static int snd_cs4281_create(struct snd_card *card,
        }
        chip->dual_codec = dual_codec;
 
-       err = pcim_iomap_regions(pci, 0x03, "CS4281"); /* 2 BARs */
-       if (err < 0)
-               return err;
+       chip->ba0 = pcim_iomap_region(pci, 0, "CS4281");
+       if (IS_ERR(chip->ba0))
+               return PTR_ERR(chip->ba0);
        chip->ba0_addr = pci_resource_start(pci, 0);
-       chip->ba1_addr = pci_resource_start(pci, 1);
 
-       chip->ba0 = pcim_iomap_table(pci)[0];
-       chip->ba1 = pcim_iomap_table(pci)[1];
+       chip->ba1 = pcim_iomap_region(pci, 1, "CS4281");
+       if (IS_ERR(chip->ba1))
+               return PTR_ERR(chip->ba1);
+       chip->ba1_addr = pci_resource_start(pci, 1);
        
        if (devm_request_irq(&pci->dev, pci->irq, snd_cs4281_interrupt,
                             IRQF_SHARED, KBUILD_MODNAME, chip)) {