public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/31] sound: Phase out hybrid PCI devres API
@ 2025-04-16 13:12 Philipp Stanner
  2025-04-16 13:12 ` [PATCH 01/31] ASoC: sof: Use pure devres PCI Philipp Stanner
                   ` (31 more replies)
  0 siblings, 32 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

Hi,

a year ago we spent quite some work trying to get PCI into better shape.
Some pci_ functions can be sometimes managed with devres, which is
obviously bad. We want to provide an obvious API, where pci_ functions
are never, and pcim_ functions are always managed.

Thus, everyone enabling his device with pcim_enable_device() must be
ported to pcim_ functions. Porting all users will later enable us to
significantly simplify parts of the PCI subsystem. See here [1] for
details.

This patch series does that for sound.

Feel free to squash the commits as you see fit.

P.

[1] https://elixir.bootlin.com/linux/v6.14-rc4/source/drivers/pci/devres.c#L18

Philipp Stanner (31):
  ASoC: sof: Use pure devres PCI
  ASoC: intel/avs: Use pure devres PCI
  AsoC: intel/atom: Use pure devres PCI
  ALSA: sonicvibes: Use pure devres PCI
  ALSA: rme96: Use pure devres PCI
  ALSA: rme32: Use pure devres PCI
  ALSA: ens1370: Use pure devres PCI
  ALSA: cmipci: Use pure devres PCI
  ALSA: via82: Use pure devres PCI
  ALSA: sis7019: Use pure devres PCI
  ALSA: intel8x: Use pure devres PCI
  ALSA: fm801: Use pure devres PCI
  ALSA: es19x8: Use pure devres PCI
  ALSA: azt3328: Use pure devres PCI
  ALSA: als: Use pure devres PCI
  ALSA: oxygen: Use pure devres PCI
  ALSA: lx6464es: Use pure devres PCI
  ALSA: vx222: Use pure devres PCI
  ALSA: trident: Use pure devres PCI
  ALSA: rme9652: Use pure devres PCI
  ALSA: ymfpci: Use pure devres PCI
  ALSA: riptide: Use pure devres PCI
  ALSA: nm256: Use pure devres PCI
  ALSA: ice: Use pure devres PCI
  ALSA: emu10k1: Use pure devres PCI
  ALSA: echoaudio: Use pure devres PCI
  ALSA: cs5535: Use pure devres PCI
  ALSA: cs46xx: Use pure devres PCI
  ALSA: ca0106: Use pure devres PCI
  ALSA: ali5451: Use pure devres PCI
  ALSA: maestro3: Use pure devres PCI

 sound/pci/ali5451/ali5451.c         |  2 +-
 sound/pci/als300.c                  |  2 +-
 sound/pci/als4000.c                 |  2 +-
 sound/pci/azt3328.c                 |  2 +-
 sound/pci/ca0106/ca0106_main.c      |  2 +-
 sound/pci/cmipci.c                  |  2 +-
 sound/pci/cs46xx/cs46xx_lib.c       |  2 +-
 sound/pci/cs5535audio/cs5535audio.c |  2 +-
 sound/pci/echoaudio/echoaudio.c     |  2 +-
 sound/pci/emu10k1/emu10k1_main.c    |  2 +-
 sound/pci/emu10k1/emu10k1x.c        |  2 +-
 sound/pci/ens1370.c                 |  2 +-
 sound/pci/es1938.c                  |  2 +-
 sound/pci/es1968.c                  |  2 +-
 sound/pci/fm801.c                   |  2 +-
 sound/pci/ice1712/ice1712.c         |  2 +-
 sound/pci/ice1712/ice1724.c         |  2 +-
 sound/pci/intel8x0.c                |  2 +-
 sound/pci/intel8x0m.c               |  2 +-
 sound/pci/lx6464es/lx6464es.c       |  2 +-
 sound/pci/maestro3.c                |  2 +-
 sound/pci/nm256/nm256.c             |  2 +-
 sound/pci/oxygen/oxygen_lib.c       |  2 +-
 sound/pci/riptide/riptide.c         |  2 +-
 sound/pci/rme32.c                   |  2 +-
 sound/pci/rme96.c                   |  2 +-
 sound/pci/rme9652/hdsp.c            |  2 +-
 sound/pci/rme9652/rme9652.c         |  2 +-
 sound/pci/sis7019.c                 |  2 +-
 sound/pci/sonicvibes.c              |  2 +-
 sound/pci/trident/trident_main.c    |  2 +-
 sound/pci/via82xx.c                 |  2 +-
 sound/pci/via82xx_modem.c           |  2 +-
 sound/pci/vx222/vx222.c             |  2 +-
 sound/pci/ymfpci/ymfpci_main.c      |  2 +-
 sound/soc/intel/atom/sst/sst_pci.c  | 56 ++++++++++++-----------------
 sound/soc/intel/avs/core.c          |  7 ++--
 sound/soc/sof/sof-pci-dev.c         | 12 ++-----
 38 files changed, 62 insertions(+), 83 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 01/31] ASoC: sof: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 15:36   ` Andy Shevchenko
  2025-04-16 13:12 ` [PATCH 02/31] ASoC: intel/avs: " Philipp Stanner
                   ` (30 subsequent siblings)
  31 siblings, 1 reply; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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 surplus calls to PCI release functions, since pcim_ functions do
cleanup automatically.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
 sound/soc/sof/sof-pci-dev.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index 2fc14b9a33d4..3d3282375827 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -216,7 +216,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 	if (ret < 0)
 		return ret;
 
-	ret = pci_request_regions(pci, "Audio DSP");
+	ret = pcim_request_all_regions(pci, "Audio DSP");
 	if (ret < 0)
 		return ret;
 
@@ -240,8 +240,7 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 		path_override->ipc_type = sof_pci_ipc_type;
 	} else {
 		dev_err(dev, "Invalid IPC type requested: %d\n", sof_pci_ipc_type);
-		ret = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 
 	path_override->fw_path = fw_path;
@@ -273,10 +272,6 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 	/* call sof helper for DSP hardware probe */
 	ret = snd_sof_device_probe(dev, sof_pdata);
 
-out:
-	if (ret)
-		pci_release_regions(pci);
-
 	return ret;
 }
 EXPORT_SYMBOL_NS(sof_pci_probe, "SND_SOC_SOF_PCI_DEV");
@@ -290,9 +285,6 @@ void sof_pci_remove(struct pci_dev *pci)
 	if (snd_sof_device_probe_completed(&pci->dev) &&
 	    !(sof_pci_debug & SOF_PCI_DISABLE_PM_RUNTIME))
 		pm_runtime_get_noresume(&pci->dev);
-
-	/* release pci regions and disable device */
-	pci_release_regions(pci);
 }
 EXPORT_SYMBOL_NS(sof_pci_remove, "SND_SOC_SOF_PCI_DEV");
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 02/31] ASoC: intel/avs: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
  2025-04-16 13:12 ` [PATCH 01/31] ASoC: sof: Use pure devres PCI Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 15:39   ` Andy Shevchenko
  2025-04-16 13:12 ` [PATCH 03/31] AsoC: intel/atom: " Philipp Stanner
                   ` (29 subsequent siblings)
  31 siblings, 1 reply; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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 <phasta@kernel.org>
---
 sound/soc/intel/avs/core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
index 8fbf33e30dfc..dafe46973146 100644
--- a/sound/soc/intel/avs/core.c
+++ b/sound/soc/intel/avs/core.c
@@ -445,7 +445,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 		return ret;
 	}
 
-	ret = pci_request_regions(pci, "AVS HDAudio");
+	ret = pcim_request_all_regions(pci, "AVS HDAudio");
 	if (ret < 0)
 		return ret;
 
@@ -454,8 +454,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	bus->remap_addr = pci_ioremap_bar(pci, 0);
 	if (!bus->remap_addr) {
 		dev_err(bus->dev, "ioremap error\n");
-		ret = -ENXIO;
-		goto err_remap_bar0;
+		return -ENXIO;
 	}
 
 	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)
 	iounmap(adev->dsp_ba);
 err_remap_bar4:
 	iounmap(bus->remap_addr);
-err_remap_bar0:
-	pci_release_regions(pci);
 	return ret;
 }
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 03/31] AsoC: intel/atom: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
  2025-04-16 13:12 ` [PATCH 01/31] ASoC: sof: Use pure devres PCI Philipp Stanner
  2025-04-16 13:12 ` [PATCH 02/31] ASoC: intel/avs: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 15:41   ` Andy Shevchenko
  2025-04-16 13:12 ` [PATCH 04/31] ALSA: sonicvibes: " Philipp Stanner
                   ` (28 subsequent siblings)
  31 siblings, 1 reply; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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 call to pci_release_regions(), since pcim_ functions do
cleanup automatically.

Pass 0 as length parameter to pcim_iomap(), which is the standard way
for ioremapping an entire BAR.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
 sound/soc/intel/atom/sst/sst_pci.c | 56 ++++++++++++------------------
 1 file changed, 23 insertions(+), 33 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c
index d1e64c3500be..102d4b0e6125 100644
--- a/sound/soc/intel/atom/sst/sst_pci.c
+++ b/sound/soc/intel/atom/sst/sst_pci.c
@@ -26,7 +26,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 	int ddr_base, ret = 0;
 	struct pci_dev *pci = ctx->pci;
 
-	ret = pci_request_regions(pci, SST_DRV_NAME);
+	ret = pcim_request_all_regions(pci, SST_DRV_NAME);
 	if (ret)
 		return ret;
 
@@ -38,66 +38,56 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 		ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base);
 		if (!ctx->pdata->lib_info) {
 			dev_err(ctx->dev, "lib_info pointer NULL\n");
-			ret = -EINVAL;
-			goto do_release_regions;
+			return -EINVAL;
 		}
 		if (ddr_base != ctx->pdata->lib_info->mod_base) {
 			dev_err(ctx->dev,
 					"FW LSP DDR BASE does not match with IFWI\n");
-			ret = -EINVAL;
-			goto do_release_regions;
+			return -EINVAL;
 		}
 		ctx->ddr_end = pci_resource_end(pci, 0);
 
-		ctx->ddr = pcim_iomap(pci, 0,
-					pci_resource_len(pci, 0));
-		if (!ctx->ddr) {
-			ret = -EINVAL;
-			goto do_release_regions;
-		}
+		ctx->ddr = pcim_iomap(pci, 0, 0);
+		if (!ctx->ddr)
+			return -EINVAL;
+
 		dev_dbg(ctx->dev, "sst: DDR Ptr %p\n", ctx->ddr);
 	} else {
 		ctx->ddr = NULL;
 	}
 	/* SHIM */
 	ctx->shim_phy_add = pci_resource_start(pci, 1);
-	ctx->shim = pcim_iomap(pci, 1, pci_resource_len(pci, 1));
-	if (!ctx->shim) {
-		ret = -EINVAL;
-		goto do_release_regions;
-	}
+	ctx->shim = pcim_iomap(pci, 1, 0);
+	if (!ctx->shim)
+		return -EINVAL;
+
 	dev_dbg(ctx->dev, "SST Shim Ptr %p\n", ctx->shim);
 
 	/* Shared SRAM */
 	ctx->mailbox_add = pci_resource_start(pci, 2);
-	ctx->mailbox = pcim_iomap(pci, 2, pci_resource_len(pci, 2));
-	if (!ctx->mailbox) {
-		ret = -EINVAL;
-		goto do_release_regions;
-	}
+	ctx->mailbox = pcim_iomap(pci, 2, 0);
+	if (!ctx->mailbox)
+		return -EINVAL;
+
 	dev_dbg(ctx->dev, "SRAM Ptr %p\n", ctx->mailbox);
 
 	/* IRAM */
 	ctx->iram_end = pci_resource_end(pci, 3);
 	ctx->iram_base = pci_resource_start(pci, 3);
-	ctx->iram = pcim_iomap(pci, 3, pci_resource_len(pci, 3));
-	if (!ctx->iram) {
-		ret = -EINVAL;
-		goto do_release_regions;
-	}
+	ctx->iram = pcim_iomap(pci, 3, 0);
+	if (!ctx->iram)
+		return -EINVAL;
+
 	dev_dbg(ctx->dev, "IRAM Ptr %p\n", ctx->iram);
 
 	/* DRAM */
 	ctx->dram_end = pci_resource_end(pci, 4);
 	ctx->dram_base = pci_resource_start(pci, 4);
-	ctx->dram = pcim_iomap(pci, 4, pci_resource_len(pci, 4));
-	if (!ctx->dram) {
-		ret = -EINVAL;
-		goto do_release_regions;
-	}
+	ctx->dram = pcim_iomap(pci, 4, 0);
+	if (!ctx->dram)
+		return -EINVAL;
+
 	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
-do_release_regions:
-	pci_release_regions(pci);
 	return ret;
 }
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 04/31] ALSA: sonicvibes: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (2 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 03/31] AsoC: intel/atom: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 05/31] ALSA: rme96: " Philipp Stanner
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/sonicvibes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index c30eaf1038e7..808a793ff4da 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -1227,7 +1227,7 @@ static int snd_sonicvibes_create(struct snd_card *card,
 	sonic->pci = pci;
 	sonic->irq = -1;
 
-	err = pci_request_regions(pci, "S3 SonicVibes");
+	err = pcim_request_all_regions(pci, "S3 SonicVibes");
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 05/31] ALSA: rme96: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (3 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 04/31] ALSA: sonicvibes: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 06/31] ALSA: rme32: " Philipp Stanner
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/rme96.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 1265a7efac60..01029843d7f3 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1575,7 +1575,7 @@ snd_rme96_create(struct rme96 *rme96)
 	if (err < 0)
 		return err;
 
-	err = pci_request_regions(pci, "RME96");
+	err = pcim_request_all_regions(pci, "RME96");
 	if (err < 0)
 		return err;
 	rme96->port = pci_resource_start(rme96->pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 06/31] ALSA: rme32: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (4 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 05/31] ALSA: rme96: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 07/31] ALSA: ens1370: " Philipp Stanner
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/rme32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index a8c2ceaadef5..4bf122abea48 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -1284,7 +1284,7 @@ static int snd_rme32_create(struct rme32 *rme32)
 	if (err < 0)
 		return err;
 
-	err = pci_request_regions(pci, "RME32");
+	err = pcim_request_all_regions(pci, "RME32");
 	if (err < 0)
 		return err;
 	rme32->port = pci_resource_start(rme32->pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 07/31] ALSA: ens1370: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (5 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 06/31] ALSA: rme32: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 08/31] ALSA: cmipci: " Philipp Stanner
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/ens1370.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 71c89e4e3090..1e6adf1ae304 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -2022,7 +2022,7 @@ static int snd_ensoniq_create(struct snd_card *card,
 	ensoniq->card = card;
 	ensoniq->pci = pci;
 	ensoniq->irq = -1;
-	err = pci_request_regions(pci, "Ensoniq AudioPCI");
+	err = pcim_request_all_regions(pci, "Ensoniq AudioPCI");
 	if (err < 0)
 		return err;
 	ensoniq->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 08/31] ALSA: cmipci: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (6 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 07/31] ALSA: ens1370: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 09/31] ALSA: via82: " Philipp Stanner
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/cmipci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index cb8593c376ee..b00df0a60d3f 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2980,7 +2980,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 	cm->channel[1].ch = 1;
 	cm->channel[0].is_dac = cm->channel[1].is_dac = 1; /* dual DAC mode */
 
-	err = pci_request_regions(pci, card->driver);
+	err = pcim_request_all_regions(pci, card->driver);
 	if (err < 0)
 		return err;
 	cm->iobase = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 09/31] ALSA: via82: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (7 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 08/31] ALSA: cmipci: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 10/31] ALSA: sis7019: " Philipp Stanner
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/via82xx.c       | 2 +-
 sound/pci/via82xx_modem.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 89838b4fb118..a04dbc0a420f 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -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);
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index a0a49b8d1511..eef0f9ddaae0 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -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);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 10/31] ALSA: sis7019: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (8 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 09/31] ALSA: via82: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 11/31] ALSA: intel8x: " Philipp Stanner
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/sis7019.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 53206beb2cb5..42b22f123fa7 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1273,7 +1273,7 @@ static int sis_chip_create(struct snd_card *card,
 	sis->irq = -1;
 	sis->ioport = pci_resource_start(pci, 0);
 
-	rc = pci_request_regions(pci, "SiS7019");
+	rc = pcim_request_all_regions(pci, "SiS7019");
 	if (rc) {
 		dev_err(&pci->dev, "unable request regions\n");
 		return rc;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 11/31] ALSA: intel8x: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (9 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 10/31] ALSA: sis7019: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 12/31] ALSA: fm801: " Philipp Stanner
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/intel8x0.c  | 2 +-
 sound/pci/intel8x0m.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index e4bb99f71c2c..51e7f1f1a48e 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2926,7 +2926,7 @@ static int snd_intel8x0_init(struct snd_card *card,
 	    pci->device == PCI_DEVICE_ID_INTEL_440MX)
 		chip->fix_nocache = 1; /* enable workaround */
 
-	err = pci_request_regions(pci, card->shortname);
+	err = pcim_request_all_regions(pci, card->shortname);
 	if (err < 0)
 		return err;
 
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 38f8de51d641..1ce775fe8a70 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1060,7 +1060,7 @@ static int snd_intel8x0m_init(struct snd_card *card,
 	chip->pci = pci;
 	chip->irq = -1;
 
-	err = pci_request_regions(pci, card->shortname);
+	err = pcim_request_all_regions(pci, card->shortname);
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 12/31] ALSA: fm801: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (10 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 11/31] ALSA: intel8x: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 13/31] ALSA: es19x8: " Philipp Stanner
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/fm801.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index 7f4834c2d5e6..f283256eda0d 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1191,7 +1191,7 @@ static int snd_fm801_create(struct snd_card *card,
 	chip->dev = &pci->dev;
 	chip->irq = -1;
 	chip->tea575x_tuner = tea575x_tuner;
-	err = pci_request_regions(pci, "FM801");
+	err = pcim_request_all_regions(pci, "FM801");
 	if (err < 0)
 		return err;
 	chip->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 13/31] ALSA: es19x8: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (11 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 12/31] ALSA: fm801: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 14/31] ALSA: azt3328: " Philipp Stanner
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/es1938.c | 2 +-
 sound/pci/es1968.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 018a8d53ca53..27728bdfac57 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1531,7 +1531,7 @@ static int snd_es1938_create(struct snd_card *card,
 	chip->card = card;
 	chip->pci = pci;
 	chip->irq = -1;
-	err = pci_request_regions(pci, "ESS Solo-1");
+	err = pcim_request_all_regions(pci, "ESS Solo-1");
 	if (err < 0)
 		return err;
 	chip->io_port = pci_resource_start(pci, 0);
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index c6c018b40c69..899135d3922e 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2647,7 +2647,7 @@ static int snd_es1968_create(struct snd_card *card,
 	chip->playback_streams = play_streams;
 	chip->capture_streams = capt_streams;
 
-	err = pci_request_regions(pci, "ESS Maestro");
+	err = pcim_request_all_regions(pci, "ESS Maestro");
 	if (err < 0)
 		return err;
 	chip->io_port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 14/31] ALSA: azt3328: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (12 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 13/31] ALSA: es19x8: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 15/31] ALSA: als: " Philipp Stanner
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/azt3328.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 8a895d838005..053a18f434bf 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -2347,7 +2347,7 @@ snd_azf3328_create(struct snd_card *card,
 		return -ENXIO;
 	}
 
-	err = pci_request_regions(pci, "Aztech AZF3328");
+	err = pcim_request_all_regions(pci, "Aztech AZF3328");
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 15/31] ALSA: als: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (13 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 14/31] ALSA: azt3328: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 16/31] ALSA: oxygen: " Philipp Stanner
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/als300.c  | 2 +-
 sound/pci/als4000.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index c7c481203ef8..43f98719e61b 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -617,7 +617,7 @@ static int snd_als300_create(struct snd_card *card,
 	chip->chip_type = chip_type;
 	spin_lock_init(&chip->reg_lock);
 
-	err = pci_request_regions(pci, "ALS300");
+	err = pcim_request_all_regions(pci, "ALS300");
 	if (err < 0)
 		return err;
 
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 022473594c73..3f4f3037f71f 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -836,7 +836,7 @@ static int __snd_card_als4000_probe(struct pci_dev *pci,
 		return -ENXIO;
 	}
 
-	err = pci_request_regions(pci, "ALS4000");
+	err = pcim_request_all_regions(pci, "ALS4000");
 	if (err < 0)
 		return err;
 	iobase = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 16/31] ALSA: oxygen: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (14 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 15/31] ALSA: als: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 17/31] ALSA: lx6464es: " Philipp Stanner
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/oxygen/oxygen_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 9340d3c9ffd6..39b8ccf37cdd 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -609,7 +609,7 @@ static int __oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
 	if (err < 0)
 		return err;
 
-	err = pci_request_regions(pci, DRIVER);
+	err = pcim_request_all_regions(pci, DRIVER);
 	if (err < 0) {
 		dev_err(card->dev, "cannot reserve PCI resources\n");
 		return err;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 17/31] ALSA: lx6464es: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (15 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 16/31] ALSA: oxygen: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 18/31] ALSA: vx222: " Philipp Stanner
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/lx6464es/lx6464es.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index bd9b6148dd6f..63ebf9803ea8 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -944,7 +944,7 @@ static int snd_lx6464es_create(struct snd_card *card,
 	mutex_init(&chip->setup_mutex);
 
 	/* request resources */
-	err = pci_request_regions(pci, card_name);
+	err = pcim_request_all_regions(pci, card_name);
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 18/31] ALSA: vx222: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (16 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 17/31] ALSA: lx6464es: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 19/31] ALSA: trident: " Philipp Stanner
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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().

Pass the driver's name as the name parameter of
pcim_request_all_regions().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
 sound/pci/vx222/vx222.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index fdb039896205..693a4e471cf7 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -123,7 +123,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
 	vx = to_vx222(chip);
 	vx->pci = pci;
 
-	err = pci_request_regions(pci, CARD_NAME);
+	err = pcim_request_all_regions(pci, KBUILD_MODNAME);
 	if (err < 0)
 		return err;
 	for (i = 0; i < 2; i++)
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 19/31] ALSA: trident: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (17 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 18/31] ALSA: vx222: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 20/31] ALSA: rme9652: " Philipp Stanner
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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.

In addition, the request function's name parameter should describe the
driver, not the device.

Replace pci_request_regions() with the always-managed function
pcim_request_all_regions().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
 sound/pci/trident/trident_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 8039f445bee2..4e16b79d6584 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -3533,7 +3533,7 @@ int snd_trident_create(struct snd_card *card,
 	trident->midi_port = TRID_REG(trident, T4D_MPU401_BASE);
 	pci_set_master(pci);
 
-	err = pci_request_regions(pci, "Trident Audio");
+	err = pcim_request_all_regions(pci, "Trident Audio");
 	if (err < 0)
 		return err;
 	trident->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 20/31] ALSA: rme9652: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (18 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 19/31] ALSA: trident: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 21/31] ALSA: ymfpci: " Philipp Stanner
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/rme9652/hdsp.c    | 2 +-
 sound/pci/rme9652/rme9652.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index dc326face54a..873b7eadfc50 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -5277,7 +5277,7 @@ static int snd_hdsp_create(struct snd_card *card,
 
 	pci_set_master(hdsp->pci);
 
-	err = pci_request_regions(pci, "hdsp");
+	err = pcim_request_all_regions(pci, "hdsp");
 	if (err < 0)
 		return err;
 	hdsp->port = pci_resource_start(pci, 0);
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 5b8dd7b0a02c..34d9c7995ddd 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -2406,7 +2406,7 @@ static int snd_rme9652_create(struct snd_card *card,
 
 	spin_lock_init(&rme9652->lock);
 
-	err = pci_request_regions(pci, "rme9652");
+	err = pcim_request_all_regions(pci, "rme9652");
 	if (err < 0)
 		return err;
 	rme9652->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 21/31] ALSA: ymfpci: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (19 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 20/31] ALSA: rme9652: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 22/31] ALSA: riptide: " Philipp Stanner
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/ymfpci/ymfpci_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 6b8d8690b6b2..d495f53a8324 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2307,7 +2307,7 @@ int snd_ymfpci_create(struct snd_card *card,
 	chip->device_id = pci->device;
 	chip->rev = pci->revision;
 
-	err = pci_request_regions(pci, "YMFPCI");
+	err = pcim_request_all_regions(pci, "YMFPCI");
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 22/31] ALSA: riptide: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (20 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 21/31] ALSA: ymfpci: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 23/31] ALSA: nm256: " Philipp Stanner
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/riptide/riptide.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 329816f37b76..578be0755b8a 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1831,7 +1831,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci)
 	chip->cif = NULL;
 	card->private_free = snd_riptide_free;
 
-	err = pci_request_regions(pci, "RIPTIDE");
+	err = pcim_request_all_regions(pci, "RIPTIDE");
 	if (err < 0)
 		return err;
 	hwport = (struct riptideport *)chip->port;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 23/31] ALSA: nm256: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (21 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 22/31] ALSA: riptide: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 24/31] ALSA: ice: " Philipp Stanner
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/nm256/nm256.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 44085237fb44..cd4dc43dbff1 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1447,7 +1447,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci)
 	chip->buffer_addr = pci_resource_start(pci, 0);
 	chip->cport_addr = pci_resource_start(pci, 1);
 
-	err = pci_request_regions(pci, card->driver);
+	err = pcim_request_all_regions(pci, card->driver);
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 24/31] ALSA: ice: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (22 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 23/31] ALSA: nm256: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 25/31] ALSA: emu10k1: " Philipp Stanner
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/ice1712/ice1712.c | 2 +-
 sound/pci/ice1712/ice1724.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 3b0c3e70987b..a8ac14887676 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2502,7 +2502,7 @@ static int snd_ice1712_create(struct snd_card *card,
 	pci_write_config_word(ice->pci, 0x42, 0x0006);
 	snd_ice1712_proc_init(ice);
 
-	err = pci_request_regions(pci, "ICE1712");
+	err = pcim_request_all_regions(pci, "ICE1712");
 	if (err < 0)
 		return err;
 	ice->port = pci_resource_start(pci, 0);
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 1dc776acd637..be22b159e65a 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2491,7 +2491,7 @@ static int snd_vt1724_create(struct snd_card *card,
 	pci_set_master(pci);
 	snd_vt1724_proc_init(ice);
 
-	err = pci_request_regions(pci, "ICE1724");
+	err = pcim_request_all_regions(pci, "ICE1724");
 	if (err < 0)
 		return err;
 	ice->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 25/31] ALSA: emu10k1: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (23 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 24/31] ALSA: ice: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 26/31] ALSA: echoaudio: " Philipp Stanner
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/emu10k1/emu10k1_main.c | 2 +-
 sound/pci/emu10k1/emu10k1x.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 5b8a5ba825bd..bbe252b8916c 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1563,7 +1563,7 @@ int snd_emu10k1_create(struct snd_card *card,
 	else
 		emu->gpr_base = FXGPREGBASE;
 
-	err = pci_request_regions(pci, "EMU10K1");
+	err = pcim_request_all_regions(pci, "EMU10K1");
 	if (err < 0)
 		return err;
 	emu->port = pci_resource_start(pci, 0);
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 89043392f3ec..30ac37b5a214 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -884,7 +884,7 @@ static int snd_emu10k1x_create(struct snd_card *card,
 	spin_lock_init(&chip->emu_lock);
 	spin_lock_init(&chip->voice_lock);
   
-	err = pci_request_regions(pci, "EMU10K1X");
+	err = pcim_request_all_regions(pci, "EMU10K1X");
 	if (err < 0)
 		return err;
 	chip->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 26/31] ALSA: echoaudio: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (24 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 25/31] ALSA: emu10k1: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 27/31] ALSA: cs5535: " Philipp Stanner
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/echoaudio/echoaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 4effcc0090ac..80d8ce75fdbb 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1910,7 +1910,7 @@ static int snd_echo_create(struct snd_card *card,
 	chip->can_set_rate = 1;
 
 	/* PCI resource allocation */
-	err = pci_request_regions(pci, ECHOCARD_NAME);
+	err = pcim_request_all_regions(pci, ECHOCARD_NAME);
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 27/31] ALSA: cs5535: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (25 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 26/31] ALSA: echoaudio: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 28/31] ALSA: cs46xx: " Philipp Stanner
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/cs5535audio/cs5535audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 440b8f9b40c9..0f319013a2a2 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -262,7 +262,7 @@ static int snd_cs5535audio_create(struct snd_card *card,
 	cs5535au->pci = pci;
 	cs5535au->irq = -1;
 
-	err = pci_request_regions(pci, "CS5535 Audio");
+	err = pcim_request_all_regions(pci, "CS5535 Audio");
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 28/31] ALSA: cs46xx: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (26 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 27/31] ALSA: cs5535: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 29/31] ALSA: ca0106: " Philipp Stanner
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/cs46xx/cs46xx_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index f3a94bb537bd..fb733633740b 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -3839,7 +3839,7 @@ int snd_cs46xx_create(struct snd_card *card,
 	chip->pci = pci;
 	chip->irq = -1;
 
-	err = pci_request_regions(pci, "CS46xx");
+	err = pcim_request_all_regions(pci, "CS46xx");
 	if (err < 0)
 		return err;
 	chip->ba0_addr = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 29/31] ALSA: ca0106: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (27 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 28/31] ALSA: cs46xx: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 30/31] ALSA: ali5451: " Philipp Stanner
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/ca0106/ca0106_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index cf1bac7a435f..7c7119cad63c 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -1593,7 +1593,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card,
 
 	spin_lock_init(&chip->emu_lock);
 
-	err = pci_request_regions(pci, "snd_ca0106");
+	err = pcim_request_all_regions(pci, "snd_ca0106");
 	if (err < 0)
 		return err;
 	chip->port = pci_resource_start(pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 30/31] ALSA: ali5451: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (28 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 29/31] ALSA: ca0106: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 13:12 ` [PATCH 31/31] ALSA: maestro3: " Philipp Stanner
  2025-04-16 15:34 ` [PATCH 00/31] sound: Phase out hybrid PCI devres API Andy Shevchenko
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/ali5451/ali5451.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index 793d2f13267e..5f38a60467c1 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -1989,7 +1989,7 @@ static int snd_ali_resources(struct snd_ali *codec)
 	int err;
 
 	dev_dbg(codec->card->dev, "resources allocation ...\n");
-	err = pci_request_regions(codec->pci, "ALI 5451");
+	err = pcim_request_all_regions(codec->pci, "ALI 5451");
 	if (err < 0)
 		return err;
 	codec->port = pci_resource_start(codec->pci, 0);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 31/31] ALSA: maestro3: Use pure devres PCI
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (29 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 30/31] ALSA: ali5451: " Philipp Stanner
@ 2025-04-16 13:12 ` Philipp Stanner
  2025-04-16 15:34 ` [PATCH 00/31] sound: Phase out hybrid PCI devres API Andy Shevchenko
  31 siblings, 0 replies; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 13:12 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, Philipp Stanner, David Rhodes,
	liujing, Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, Andy Shevchenko
  Cc: linux-sound, linux-kernel, sound-open-firmware

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>
---
 sound/pci/maestro3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index f4d211970d7e..e61e15774706 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2552,7 +2552,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
 	if (err < 0)
 		return err;
 
-	err = pci_request_regions(pci, card->driver);
+	err = pcim_request_all_regions(pci, card->driver);
 	if (err < 0)
 		return err;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/31] sound: Phase out hybrid PCI devres API
  2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
                   ` (30 preceding siblings ...)
  2025-04-16 13:12 ` [PATCH 31/31] ALSA: maestro3: " Philipp Stanner
@ 2025-04-16 15:34 ` Andy Shevchenko
  2025-04-16 15:43   ` Andy Shevchenko
  31 siblings, 1 reply; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 15:34 UTC (permalink / raw)
  To: Philipp Stanner
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 03:12:10PM +0200, Philipp Stanner wrote:
> Hi,
> 
> a year ago we spent quite some work trying to get PCI into better shape.
> Some pci_ functions can be sometimes managed with devres, which is
> obviously bad. We want to provide an obvious API, where pci_ functions
> are never, and pcim_ functions are always managed.
> 
> Thus, everyone enabling his device with pcim_enable_device() must be
> ported to pcim_ functions. Porting all users will later enable us to
> significantly simplify parts of the PCI subsystem. See here [1] for
> details.
> 
> This patch series does that for sound.

AFAIK the ASoC and ALSA maintained by different people and perhaps you would
need to split, but I'm not the guy in charge, so wait for them to tell you
their preferences.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 01/31] ASoC: sof: Use pure devres PCI
  2025-04-16 13:12 ` [PATCH 01/31] ASoC: sof: Use pure devres PCI Philipp Stanner
@ 2025-04-16 15:36   ` Andy Shevchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 15:36 UTC (permalink / raw)
  To: Philipp Stanner
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 03:12:11PM +0200, Philipp Stanner wrote:
> 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 surplus calls to PCI release functions, since pcim_ functions do
> cleanup automatically.

...

>  	ret = snd_sof_device_probe(dev, sof_pdata);
>  
> -out:
> -	if (ret)
> -		pci_release_regions(pci);
> -
>  	return ret;

Obviously you can go further

	return snd_sof_...(...);

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 02/31] ASoC: intel/avs: Use pure devres PCI
  2025-04-16 13:12 ` [PATCH 02/31] ASoC: intel/avs: " Philipp Stanner
@ 2025-04-16 15:39   ` Andy Shevchenko
  2025-04-16 16:25     ` Philipp Stanner
  0 siblings, 1 reply; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 15:39 UTC (permalink / raw)
  To: Philipp Stanner
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 03:12:12PM +0200, Philipp Stanner wrote:
> 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.

...

>  	bus->remap_addr = pci_ioremap_bar(pci, 0);
>  	if (!bus->remap_addr) {
>  		dev_err(bus->dev, "ioremap error\n");
> -		ret = -ENXIO;
> -		goto err_remap_bar0;
> +		return -ENXIO;

Here and everywhere else these can now be converted to dev_err_probe().
Are you planning to do so?

...

>  err_remap_bar4:
>  	iounmap(bus->remap_addr);

This looks weird if the driver already is using pcim_enable_device().
Doesn't this look to you as an existing bug?

> -err_remap_bar0:
> -	pci_release_regions(pci);
>  	return ret;

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 03/31] AsoC: intel/atom: Use pure devres PCI
  2025-04-16 13:12 ` [PATCH 03/31] AsoC: intel/atom: " Philipp Stanner
@ 2025-04-16 15:41   ` Andy Shevchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 15:41 UTC (permalink / raw)
  To: Philipp Stanner
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 03:12:13PM +0200, Philipp Stanner wrote:
> 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 call to pci_release_regions(), since pcim_ functions do
> cleanup automatically.
> 
> Pass 0 as length parameter to pcim_iomap(), which is the standard way
> for ioremapping an entire BAR.

...

>  sound/soc/intel/atom/sst/sst_pci.c | 56 ++++++++++++------------------
>  1 file changed, 23 insertions(+), 33 deletions(-)

Cool cleanup!

...

>  	/* DRAM */
>  	ctx->dram_end = pci_resource_end(pci, 4);
>  	ctx->dram_base = pci_resource_start(pci, 4);
> +	ctx->dram = pcim_iomap(pci, 4, 0);
> +	if (!ctx->dram)
> +		return -EINVAL;

Why EINVAL and not ENOMEM? mapping is about memory, no?

> +
>  	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
> -do_release_regions:
> -	pci_release_regions(pci);
>  	return ret;

Now it seems

	return 0;

should suffice here.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/31] sound: Phase out hybrid PCI devres API
  2025-04-16 15:34 ` [PATCH 00/31] sound: Phase out hybrid PCI devres API Andy Shevchenko
@ 2025-04-16 15:43   ` Andy Shevchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 15:43 UTC (permalink / raw)
  To: Philipp Stanner
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 06:34:35PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 16, 2025 at 03:12:10PM +0200, Philipp Stanner wrote:

> > a year ago we spent quite some work trying to get PCI into better shape.
> > Some pci_ functions can be sometimes managed with devres, which is
> > obviously bad. We want to provide an obvious API, where pci_ functions
> > are never, and pcim_ functions are always managed.
> > 
> > Thus, everyone enabling his device with pcim_enable_device() must be
> > ported to pcim_ functions. Porting all users will later enable us to
> > significantly simplify parts of the PCI subsystem. See here [1] for
> > details.
> > 
> > This patch series does that for sound.
> 
> AFAIK the ASoC and ALSA maintained by different people and perhaps you would
> need to split, but I'm not the guy in charge, so wait for them to tell you
> their preferences.

Seems split is a good to have as I just looked to all of them and ALSA are
pretty straightforward, while for every patch in ASoC I have a comment.

So, here is a formal tag for all ALSA patches. Feel free to send a v2
with them and the tag.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 02/31] ASoC: intel/avs: Use pure devres PCI
  2025-04-16 15:39   ` Andy Shevchenko
@ 2025-04-16 16:25     ` Philipp Stanner
  2025-04-16 18:03       ` Andy Shevchenko
  0 siblings, 1 reply; 39+ messages in thread
From: Philipp Stanner @ 2025-04-16 16:25 UTC (permalink / raw)
  To: Andy Shevchenko, Philipp Stanner, Bjorn Helgaas,
	Krzysztof Wilczyński
  Cc: Jaroslav Kysela, Takashi Iwai, Jaya Kumar, Clemens Ladisch,
	Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Daniel Baluta, Colin Ian King, David Rhodes, liujing,
	Jerome Brunet, Andres Urian Florez, Oswald Buddenhagen,
	Thorsten Blum, Thomas Gleixner, Ingo Molnar,
	Amadeusz Sławiński, Charles Keepax, linux-sound,
	linux-kernel, sound-open-firmware

+Cc Bjorn, Krzysztof

On Wed, 2025-04-16 at 18:39 +0300, Andy Shevchenko wrote:
> On Wed, Apr 16, 2025 at 03:12:12PM +0200, Philipp Stanner wrote:
> > 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.
> 
> ...
> 
> >  	bus->remap_addr = pci_ioremap_bar(pci, 0);
> >  	if (!bus->remap_addr) {
> >  		dev_err(bus->dev, "ioremap error\n");
> > -		ret = -ENXIO;
> > -		goto err_remap_bar0;
> > +		return -ENXIO;
> 
> Here and everywhere else these can now be converted to
> dev_err_probe().
> Are you planning to do so?

I want to do what's necessary to get PCI in better shape, since that's
what the GPUs and accelerators we / I care about use :)

IOW, I want pci_request_regions() removed from here.

> 
> ...
> 
> >  err_remap_bar4:
> >  	iounmap(bus->remap_addr);
> 
> This looks weird if the driver already is using pcim_enable_device().
> Doesn't this look to you as an existing bug?

I looked briefly at it and it doesn't appear like an obvious bug to me
because the drivers uses the (very old? deprecated?) pci_ioremap_bar().

In any case the driver doesn't set up any devres callback, so has to
iounmap() manually.

@Bjorn:
Any comments on pci_ioremap_bar()? Should we mark that as deprecated?

P.

> 
> > -err_remap_bar0:
> > -	pci_release_regions(pci);
> >  	return ret;
> 


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 02/31] ASoC: intel/avs: Use pure devres PCI
  2025-04-16 16:25     ` Philipp Stanner
@ 2025-04-16 18:03       ` Andy Shevchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Andy Shevchenko @ 2025-04-16 18:03 UTC (permalink / raw)
  To: phasta
  Cc: Bjorn Helgaas, Krzysztof Wilczyński, Jaroslav Kysela,
	Takashi Iwai, Jaya Kumar, Clemens Ladisch, Cezary Rojewski,
	Liam Girdwood, Peter Ujfalusi, Bard Liao, Ranjani Sridharan,
	Kai Vehmanen, Pierre-Louis Bossart, Mark Brown, Daniel Baluta,
	Colin Ian King, David Rhodes, liujing, Jerome Brunet,
	Andres Urian Florez, Oswald Buddenhagen, Thorsten Blum,
	Thomas Gleixner, Ingo Molnar, Amadeusz Sławiński,
	Charles Keepax, linux-sound, linux-kernel, sound-open-firmware

On Wed, Apr 16, 2025 at 06:25:52PM +0200, Philipp Stanner wrote:
> On Wed, 2025-04-16 at 18:39 +0300, Andy Shevchenko wrote:
> > On Wed, Apr 16, 2025 at 03:12:12PM +0200, Philipp Stanner wrote:

...

> > >  	bus->remap_addr = pci_ioremap_bar(pci, 0);
> > >  	if (!bus->remap_addr) {
> > >  		dev_err(bus->dev, "ioremap error\n");
> > > -		ret = -ENXIO;
> > > -		goto err_remap_bar0;
> > > +		return -ENXIO;
> > 
> > Here and everywhere else these can now be converted to
> > dev_err_probe().
> > Are you planning to do so?
> 
> I want to do what's necessary to get PCI in better shape, since that's
> what the GPUs and accelerators we / I care about use :)
> 
> IOW, I want pci_request_regions() removed from here.

Okay!

...

> > >  err_remap_bar4:
> > >  	iounmap(bus->remap_addr);
> > 
> > This looks weird if the driver already is using pcim_enable_device().
> > Doesn't this look to you as an existing bug?
> 
> I looked briefly at it and it doesn't appear like an obvious bug to me
> because the drivers uses the (very old? deprecated?) pci_ioremap_bar().

> In any case the driver doesn't set up any devres callback, so has to
> iounmap() manually.

Okay, so they are using managed and non-managed APIs, but release / error path
ordering is fine. So, false alarm then.

> @Bjorn:
> Any comments on pci_ioremap_bar()? Should we mark that as deprecated?

> > > -err_remap_bar0:
> > > -	pci_release_regions(pci);
> > >  	return ret;

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-04-16 18:04 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
2025-04-16 13:12 ` [PATCH 01/31] ASoC: sof: Use pure devres PCI Philipp Stanner
2025-04-16 15:36   ` Andy Shevchenko
2025-04-16 13:12 ` [PATCH 02/31] ASoC: intel/avs: " Philipp Stanner
2025-04-16 15:39   ` Andy Shevchenko
2025-04-16 16:25     ` Philipp Stanner
2025-04-16 18:03       ` Andy Shevchenko
2025-04-16 13:12 ` [PATCH 03/31] AsoC: intel/atom: " Philipp Stanner
2025-04-16 15:41   ` Andy Shevchenko
2025-04-16 13:12 ` [PATCH 04/31] ALSA: sonicvibes: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 05/31] ALSA: rme96: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 06/31] ALSA: rme32: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 07/31] ALSA: ens1370: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 08/31] ALSA: cmipci: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 09/31] ALSA: via82: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 10/31] ALSA: sis7019: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 11/31] ALSA: intel8x: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 12/31] ALSA: fm801: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 13/31] ALSA: es19x8: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 14/31] ALSA: azt3328: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 15/31] ALSA: als: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 16/31] ALSA: oxygen: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 17/31] ALSA: lx6464es: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 18/31] ALSA: vx222: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 19/31] ALSA: trident: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 20/31] ALSA: rme9652: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 21/31] ALSA: ymfpci: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 22/31] ALSA: riptide: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 23/31] ALSA: nm256: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 24/31] ALSA: ice: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 25/31] ALSA: emu10k1: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 26/31] ALSA: echoaudio: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 27/31] ALSA: cs5535: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 28/31] ALSA: cs46xx: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 29/31] ALSA: ca0106: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 30/31] ALSA: ali5451: " Philipp Stanner
2025-04-16 13:12 ` [PATCH 31/31] ALSA: maestro3: " Philipp Stanner
2025-04-16 15:34 ` [PATCH 00/31] sound: Phase out hybrid PCI devres API Andy Shevchenko
2025-04-16 15:43   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox