Re: [PATCH] PCI: Remove pci_request_region_exclusive()

From: Bjorn Helgaas
Date: Wed Apr 17 2019 - 16:21:02 EST


On Wed, Apr 17, 2019 at 10:23:56AM +0200, Johannes Thumshirn wrote:
> pci_request_region_exclusive() was introduced with commit e8de1481fd71
> ("resource: allow MMIO exclusivity for device drivers") in 2.6.29 which
> was released 2008.
>
> It never had an in tree user since then, so after 11 years later let's
> remove it.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@xxxxxxx>

Applied to pci/misc for v5.2, thanks a lot!

> ---
> drivers/pci/pci.c | 25 -------------------------
> include/linux/pci.h | 1 -
> 2 files changed, 26 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 7c1b362f599a..d185b49e105a 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3706,31 +3706,6 @@ int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
> }
> EXPORT_SYMBOL(pci_request_region);
>
> -/**
> - * pci_request_region_exclusive - Reserved PCI I/O and memory resource
> - * @pdev: PCI device whose resources are to be reserved
> - * @bar: BAR to be reserved
> - * @res_name: Name to be associated with resource.
> - *
> - * Mark the PCI region associated with PCI device @pdev BR @bar as
> - * being reserved by owner @res_name. Do not access any
> - * address inside the PCI regions unless this call returns
> - * successfully.
> - *
> - * Returns 0 on success, or %EBUSY on error. A warning
> - * message is also printed on failure.
> - *
> - * The key difference that _exclusive makes it that userspace is
> - * explicitly not allowed to map the resource via /dev/mem or
> - * sysfs.
> - */
> -int pci_request_region_exclusive(struct pci_dev *pdev, int bar,
> - const char *res_name)
> -{
> - return __pci_request_region(pdev, bar, res_name, IORESOURCE_EXCLUSIVE);
> -}
> -EXPORT_SYMBOL(pci_request_region_exclusive);
> -
> /**
> * pci_release_selected_regions - Release selected PCI I/O and memory resources
> * @pdev: PCI device whose resources were previously reserved
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 77448215ef5b..5f32275358cf 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1233,7 +1233,6 @@ int __must_check pci_request_regions(struct pci_dev *, const char *);
> int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
> void pci_release_regions(struct pci_dev *);
> int __must_check pci_request_region(struct pci_dev *, int, const char *);
> -int __must_check pci_request_region_exclusive(struct pci_dev *, int, const char *);
> void pci_release_region(struct pci_dev *, int);
> int pci_request_selected_regions(struct pci_dev *, int, const char *);
> int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *);
> --
> 2.16.4
>