[PATCH v3 4/6] PCI: Remove request_flags relict from devres

Philipp Stanner posted 6 patches 7 months ago
There is a newer version of this series
[PATCH v3 4/6] PCI: Remove request_flags relict from devres
Posted by Philipp Stanner 7 months ago
pcim_request_region_exclusive(), the only user in PCI devres that needed
exclusive region requests, has been removed.

All features related to exclusive requests can, therefore, be removed,
too. Remove them.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
 drivers/pci/devres.c | 46 +++++++++++++++++++-------------------------
 1 file changed, 20 insertions(+), 26 deletions(-)

diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 769b92f4f66a..ae79e5f95c8a 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -808,31 +808,6 @@ int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name)
 }
 EXPORT_SYMBOL(pcim_iomap_regions);
 
-static int _pcim_request_region(struct pci_dev *pdev, int bar, const char *name,
-				int request_flags)
-{
-	int ret;
-	struct pcim_addr_devres *res;
-
-	if (!pci_bar_index_is_valid(bar))
-		return -EINVAL;
-
-	res = pcim_addr_devres_alloc(pdev);
-	if (!res)
-		return -ENOMEM;
-	res->type = PCIM_ADDR_DEVRES_TYPE_REGION;
-	res->bar = bar;
-
-	ret = __pcim_request_region(pdev, bar, name, request_flags);
-	if (ret != 0) {
-		pcim_addr_devres_free(res);
-		return ret;
-	}
-
-	devres_add(&pdev->dev, res);
-	return 0;
-}
-
 /**
  * pcim_request_region - Request a PCI BAR
  * @pdev: PCI device to request region for
@@ -848,7 +823,26 @@ static int _pcim_request_region(struct pci_dev *pdev, int bar, const char *name,
  */
 int pcim_request_region(struct pci_dev *pdev, int bar, const char *name)
 {
-	return _pcim_request_region(pdev, bar, name, 0);
+	int ret;
+	struct pcim_addr_devres *res;
+
+	if (!pci_bar_index_is_valid(bar))
+		return -EINVAL;
+
+	res = pcim_addr_devres_alloc(pdev);
+	if (!res)
+		return -ENOMEM;
+	res->type = PCIM_ADDR_DEVRES_TYPE_REGION;
+	res->bar = bar;
+
+	ret = __pcim_request_region(pdev, bar, name, 0);
+	if (ret != 0) {
+		pcim_addr_devres_free(res);
+		return ret;
+	}
+
+	devres_add(&pdev->dev, res);
+	return 0;
 }
 EXPORT_SYMBOL(pcim_request_region);
 
-- 
2.49.0
Re: [PATCH v3 4/6] PCI: Remove request_flags relict from devres
Posted by Bjorn Helgaas 7 months ago
s/relict/relic/ ? (in subject)

Would be nice to have a hint in the subject that this is related to
exclusive region requests, since "request_flags" doesn't include much
context.

On Mon, May 19, 2025 at 01:29:58PM +0200, Philipp Stanner wrote:
> pcim_request_region_exclusive(), the only user in PCI devres that needed
> exclusive region requests, has been removed.
> 
> All features related to exclusive requests can, therefore, be removed,
> too. Remove them.
Re: [PATCH v3 4/6] PCI: Remove request_flags relict from devres
Posted by Krzysztof Wilczyński 7 months ago
Hello,

> s/relict/relic/ ? (in subject)
> 
> Would be nice to have a hint in the subject that this is related to
> exclusive region requests, since "request_flags" doesn't include much
> context.

Fixed when applying.  Thank you!

	Krzysztof
Re: [PATCH v3 4/6] PCI: Remove request_flags relict from devres
Posted by Andy Shevchenko 7 months ago
On Mon, May 19, 2025 at 01:29:58PM +0200, Philipp Stanner wrote:
> pcim_request_region_exclusive(), the only user in PCI devres that needed
> exclusive region requests, has been removed.
> 
> All features related to exclusive requests can, therefore, be removed,
> too. Remove them.

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

-- 
With Best Regards,
Andy Shevchenko