diff mbox series

[3/3] drm/pci: Unexport drm_get_pci_dev

Message ID 20200222175433.2259158-3-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/amdgpu: Drop DRIVER_USE_AGP | expand

Commit Message

Daniel Vetter Feb. 22, 2020, 5:54 p.m. UTC
Only user left is the shadow attach for legacy drivers.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_pci.c | 22 +++-------------------
 include/drm/drm_pci.h     | 11 -----------
 2 files changed, 3 insertions(+), 30 deletions(-)

Comments

Emil Velikov Feb. 24, 2020, 4:33 p.m. UTC | #1
On Sat, 22 Feb 2020 at 17:54, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>
> Only user left is the shadow attach for legacy drivers.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Going the extra step, as outlined in 2/3 would be great. But if the
series goes as-is, 2/3 and 3/3 are:
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

-Emil
Thomas Zimmermann Feb. 25, 2020, 9:36 a.m. UTC | #2
Hi

Am 22.02.20 um 18:54 schrieb Daniel Vetter:
> Only user left is the shadow attach for legacy drivers.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_pci.c | 22 +++-------------------
>  include/drm/drm_pci.h     | 11 -----------
>  2 files changed, 3 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
> index c6bb98729a26..cc5af271a1b1 100644
> --- a/drivers/gpu/drm/drm_pci.c
> +++ b/drivers/gpu/drm/drm_pci.c
> @@ -75,7 +75,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
>  
>  	return dmah;
>  }
> -
>  EXPORT_SYMBOL(drm_pci_alloc);
>  
>  /**
> @@ -191,23 +190,9 @@ void drm_pci_agp_destroy(struct drm_device *dev)
>  	}
>  }
>  
> -/**
> - * drm_get_pci_dev - Register a PCI device with the DRM subsystem
> - * @pdev: PCI device
> - * @ent: entry from the PCI ID table that matches @pdev
> - * @driver: DRM device driver
> - *
> - * Attempt to gets inter module "drm" information. If we are first
> - * then register the character device and inter module information.
> - * Try and register, if we fail to register, backout previous work.
> - *
> - * NOTE: This function is deprecated, please use drm_dev_alloc() and
> - * drm_dev_register() instead and remove your &drm_driver.load callback.
> - *
> - * Return: 0 on success or a negative error code on failure.
> - */
> -int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
> -		    struct drm_driver *driver)
> +static int drm_get_pci_dev(struct pci_dev *pdev,
> +			   const struct pci_device_id *ent,
> +			   struct drm_driver *driver)
>  {
>  	struct drm_device *dev;
>  	int ret;
> @@ -250,7 +235,6 @@ int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
>  	drm_dev_put(dev);
>  	return ret;
>  }
> -EXPORT_SYMBOL(drm_get_pci_dev);
>  
>  #ifdef CONFIG_DRM_LEGACY

drm_get_pci_dev() is now only used by some legacy code. It should be
protected by CONFIG_DRM_LEGACY. With this change

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

>  
> diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h
> index 9031e217b506..3941b0255ecf 100644
> --- a/include/drm/drm_pci.h
> +++ b/include/drm/drm_pci.h
> @@ -45,10 +45,6 @@ struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
>  				     size_t align);
>  void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
>  
> -int drm_get_pci_dev(struct pci_dev *pdev,
> -		    const struct pci_device_id *ent,
> -		    struct drm_driver *driver);
> -
>  #else
>  
>  static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev,
> @@ -62,13 +58,6 @@ static inline void drm_pci_free(struct drm_device *dev,
>  {
>  }
>  
> -static inline int drm_get_pci_dev(struct pci_dev *pdev,
> -				  const struct pci_device_id *ent,
> -				  struct drm_driver *driver)
> -{
> -	return -ENOSYS;
> -}
> -
>  #endif
>  
>  #endif /* _DRM_PCI_H_ */
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index c6bb98729a26..cc5af271a1b1 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -75,7 +75,6 @@  drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
 
 	return dmah;
 }
-
 EXPORT_SYMBOL(drm_pci_alloc);
 
 /**
@@ -191,23 +190,9 @@  void drm_pci_agp_destroy(struct drm_device *dev)
 	}
 }
 
-/**
- * drm_get_pci_dev - Register a PCI device with the DRM subsystem
- * @pdev: PCI device
- * @ent: entry from the PCI ID table that matches @pdev
- * @driver: DRM device driver
- *
- * Attempt to gets inter module "drm" information. If we are first
- * then register the character device and inter module information.
- * Try and register, if we fail to register, backout previous work.
- *
- * NOTE: This function is deprecated, please use drm_dev_alloc() and
- * drm_dev_register() instead and remove your &drm_driver.load callback.
- *
- * Return: 0 on success or a negative error code on failure.
- */
-int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
-		    struct drm_driver *driver)
+static int drm_get_pci_dev(struct pci_dev *pdev,
+			   const struct pci_device_id *ent,
+			   struct drm_driver *driver)
 {
 	struct drm_device *dev;
 	int ret;
@@ -250,7 +235,6 @@  int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
 	drm_dev_put(dev);
 	return ret;
 }
-EXPORT_SYMBOL(drm_get_pci_dev);
 
 #ifdef CONFIG_DRM_LEGACY
 
diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h
index 9031e217b506..3941b0255ecf 100644
--- a/include/drm/drm_pci.h
+++ b/include/drm/drm_pci.h
@@ -45,10 +45,6 @@  struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
 				     size_t align);
 void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
 
-int drm_get_pci_dev(struct pci_dev *pdev,
-		    const struct pci_device_id *ent,
-		    struct drm_driver *driver);
-
 #else
 
 static inline struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev,
@@ -62,13 +58,6 @@  static inline void drm_pci_free(struct drm_device *dev,
 {
 }
 
-static inline int drm_get_pci_dev(struct pci_dev *pdev,
-				  const struct pci_device_id *ent,
-				  struct drm_driver *driver)
-{
-	return -ENOSYS;
-}
-
 #endif
 
 #endif /* _DRM_PCI_H_ */