public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@kernel.org>
To: "Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Jaya Kumar" <jayakumar.alsa@gmail.com>,
	"Clemens Ladisch" <clemens@ladisch.de>,
	"Cezary Rojewski" <cezary.rojewski@intel.com>,
	"Liam Girdwood" <liam.r.girdwood@linux.intel.com>,
	"Peter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	"Bard Liao" <yung-chuan.liao@linux.intel.com>,
	"Ranjani Sridharan" <ranjani.sridharan@linux.intel.com>,
	"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.dev>,
	"Mark Brown" <broonie@kernel.org>,
	"Daniel Baluta" <daniel.baluta@nxp.com>,
	"Colin Ian King" <colin.i.king@gmail.com>,
	"Philipp Stanner" <phasta@kernel.org>,
	"David Rhodes" <drhodes@opensource.cirrus.com>,
	liujing <liujing@cmss.chinamobile.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Andres Urian Florez" <andres.emb.sys@gmail.com>,
	"Oswald Buddenhagen" <oswald.buddenhagen@gmx.de>,
	"Thorsten Blum" <thorsten.blum@linux.dev>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>,
	"Charles Keepax" <ckeepax@opensource.cirrus.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	sound-open-firmware@alsa-project.org
Subject: [PATCH 01/31] ASoC: sof: Use pure devres PCI
Date: Wed, 16 Apr 2025 15:12:11 +0200	[thread overview]
Message-ID: <20250416131241.107903-2-phasta@kernel.org> (raw)
In-Reply-To: <20250416131241.107903-1-phasta@kernel.org>

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


  reply	other threads:[~2025-04-16 13:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 13:12 [PATCH 00/31] sound: Phase out hybrid PCI devres API Philipp Stanner
2025-04-16 13:12 ` Philipp Stanner [this message]
2025-04-16 15:36   ` [PATCH 01/31] ASoC: sof: Use pure devres PCI 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250416131241.107903-2-phasta@kernel.org \
    --to=phasta@kernel.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=andres.emb.sys@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=clemens@ladisch.de \
    --cc=colin.i.king@gmail.com \
    --cc=daniel.baluta@nxp.com \
    --cc=drhodes@opensource.cirrus.com \
    --cc=jayakumar.alsa@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=liujing@cmss.chinamobile.com \
    --cc=mingo@kernel.org \
    --cc=oswald.buddenhagen@gmx.de \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tglx@linutronix.de \
    --cc=thorsten.blum@linux.dev \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox