ALSA: via82: Use pure devres PCI
authorPhilipp Stanner <phasta@kernel.org>
Wed, 23 Apr 2025 07:53:24 +0000 (09:53 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 24 Apr 2025 07:21:33 +0000 (09:21 +0200)
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().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250423075346.45907-7-phasta@kernel.org
sound/pci/via82xx.c
sound/pci/via82xx_modem.c

index 89838b4fb118a30f51924eca79568fbd4e1d61eb..a04dbc0a420f6f81cc9d36b225aa634176099efa 100644 (file)
@@ -2326,7 +2326,7 @@ static int snd_via82xx_create(struct snd_card *card,
        pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE,
                              chip->old_legacy & ~(VIA_FUNC_ENABLE_SB|VIA_FUNC_ENABLE_FM));
 
-       err = pci_request_regions(pci, card->driver);
+       err = pcim_request_all_regions(pci, card->driver);
        if (err < 0)
                return err;
        chip->port = pci_resource_start(pci, 0);
index a0a49b8d151160482fef70a21e1b32e37575116b..eef0f9ddaae07e6c289486a9c8cf5a2a09510993 100644 (file)
@@ -1071,7 +1071,7 @@ static int snd_via82xx_create(struct snd_card *card,
        chip->pci = pci;
        chip->irq = -1;
 
-       err = pci_request_regions(pci, card->driver);
+       err = pcim_request_all_regions(pci, card->driver);
        if (err < 0)
                return err;
        chip->port = pci_resource_start(pci, 0);