@@ -72,7 +72,7 @@ ast_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
@@ -64,7 +64,7 @@ static void cirrus_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static const struct file_operations cirrus_driver_fops = {
@@ -388,6 +388,12 @@ err_g1:
}
EXPORT_SYMBOL(drm_get_pci_dev);
+void drm_put_pci_dev(struct drm_device *dev)
+{
+ drm_put_dev(dev);
+}
+EXPORT_SYMBOL(drm_put_pci_dev);
+
/**
* PCI device initialization. Called direct from modules at load time.
*
@@ -585,7 +585,7 @@ static void psb_driver_preclose(struct drm_device *dev, struct drm_file *priv)
static void psb_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static const struct dev_pm_ops psb_pm_ops = {
@@ -856,7 +856,7 @@ i915_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static int i915_pm_suspend(struct device *dev)
@@ -73,7 +73,7 @@ static void mga_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static const struct file_operations mgag200_driver_fops = {
@@ -168,7 +168,7 @@ nouveau_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
int
@@ -308,7 +308,7 @@ radeon_pci_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static int
@@ -982,7 +982,7 @@ static void vmw_remove(struct pci_dev *pdev)
{
struct drm_device *dev = pci_get_drvdata(pdev);
- drm_put_dev(dev);
+ drm_put_pci_dev(dev);
}
static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
@@ -1748,6 +1748,7 @@ extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
extern int drm_get_pci_dev(struct pci_dev *pdev,
const struct pci_device_id *ent,
struct drm_driver *driver);
+extern void drm_put_pci_dev(struct drm_device *dev);
#define DRM_PCIE_SPEED_25 1
#define DRM_PCIE_SPEED_50 2
When deferred initialization support for pci devices is added some additional cleanup will be needed. Add a pci-specific put function to serve this purpose, and convert the pci drivers over to using it. For now it just calls drm_put_dev(), so this commit has no functional change. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> --- drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/cirrus/cirrus_drv.c | 2 +- drivers/gpu/drm/drm_pci.c | 6 ++++++ drivers/gpu/drm/gma500/psb_drv.c | 2 +- drivers/gpu/drm/i915/i915_drv.c | 2 +- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +- drivers/gpu/drm/nouveau/nouveau_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- include/drm/drmP.h | 1 + 10 files changed, 15 insertions(+), 8 deletions(-)