Commit d33b58d0 authored by Daniel Vetter's avatar Daniel Vetter

drm: Garbage collect drm_dev_fini

It has become empty. Given the few users I figured not much point
splitting this up.

v2: Rebase over i915 changes.

v3: Rebase over patch split fix.
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch
parent c23d686f
...@@ -529,7 +529,6 @@ static void cirrus_mode_config_init(struct cirrus_device *cirrus) ...@@ -529,7 +529,6 @@ static void cirrus_mode_config_init(struct cirrus_device *cirrus)
static void cirrus_release(struct drm_device *dev) static void cirrus_release(struct drm_device *dev)
{ {
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
drm_dev_fini(dev);
} }
DEFINE_DRM_GEM_FOPS(cirrus_fops); DEFINE_DRM_GEM_FOPS(cirrus_fops);
......
...@@ -282,7 +282,6 @@ void drm_minor_release(struct drm_minor *minor) ...@@ -282,7 +282,6 @@ void drm_minor_release(struct drm_minor *minor)
* struct driver_device *priv = container_of(...); * struct driver_device *priv = container_of(...);
* *
* drm_mode_config_cleanup(drm); * drm_mode_config_cleanup(drm);
* drm_dev_fini(drm);
* } * }
* *
* static struct drm_driver driver_drm_driver = { * static struct drm_driver driver_drm_driver = {
...@@ -737,23 +736,6 @@ int devm_drm_dev_init(struct device *parent, ...@@ -737,23 +736,6 @@ int devm_drm_dev_init(struct device *parent,
} }
EXPORT_SYMBOL(devm_drm_dev_init); EXPORT_SYMBOL(devm_drm_dev_init);
/**
* drm_dev_fini - Finalize a dead DRM device
* @dev: DRM device
*
* Finalize a dead DRM device. This is the converse to drm_dev_init() and
* frees up all data allocated by it. All driver private data should be
* finalized first. Note that this function does not free the @dev, that is
* left to the caller.
*
* The ref-count of @dev must be zero, and drm_dev_fini() should only be called
* from a &drm_driver.release callback.
*/
void drm_dev_fini(struct drm_device *dev)
{
}
EXPORT_SYMBOL(drm_dev_fini);
/** /**
* drm_dev_alloc - Allocate new DRM device * drm_dev_alloc - Allocate new DRM device
* @driver: DRM driver to allocate device for * @driver: DRM driver to allocate device for
...@@ -804,8 +786,6 @@ static void drm_dev_release(struct kref *ref) ...@@ -804,8 +786,6 @@ static void drm_dev_release(struct kref *ref)
if (dev->driver->release) if (dev->driver->release)
dev->driver->release(dev); dev->driver->release(dev);
else
drm_dev_fini(dev);
drm_managed_release(dev); drm_managed_release(dev);
......
...@@ -592,7 +592,6 @@ void mipi_dbi_release(struct drm_device *drm) ...@@ -592,7 +592,6 @@ void mipi_dbi_release(struct drm_device *drm)
DRM_DEBUG_DRIVER("\n"); DRM_DEBUG_DRIVER("\n");
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
drm_dev_fini(drm);
} }
EXPORT_SYMBOL(mipi_dbi_release); EXPORT_SYMBOL(mipi_dbi_release);
......
...@@ -906,11 +906,6 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -906,11 +906,6 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
return i915; return i915;
} }
static void i915_driver_destroy(struct drm_i915_private *i915)
{
drm_dev_fini(&i915->drm);
}
/** /**
* i915_driver_probe - setup chip and create an initial config * i915_driver_probe - setup chip and create an initial config
* @pdev: PCI device * @pdev: PCI device
...@@ -1013,7 +1008,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1013,7 +1008,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_disable_device(pdev); pci_disable_device(pdev);
out_fini: out_fini:
i915_probe_error(i915, "Device initialization failed (%d)\n", ret); i915_probe_error(i915, "Device initialization failed (%d)\n", ret);
i915_driver_destroy(i915);
drm_dev_put(&i915->drm); drm_dev_put(&i915->drm);
return ret; return ret;
} }
...@@ -1070,7 +1064,6 @@ static void i915_driver_release(struct drm_device *dev) ...@@ -1070,7 +1064,6 @@ static void i915_driver_release(struct drm_device *dev)
intel_runtime_pm_driver_release(rpm); intel_runtime_pm_driver_release(rpm);
i915_driver_late_release(dev_priv); i915_driver_late_release(dev_priv);
i915_driver_destroy(dev_priv);
} }
static int i915_driver_open(struct drm_device *dev, struct drm_file *file) static int i915_driver_open(struct drm_device *dev, struct drm_file *file)
......
...@@ -76,7 +76,6 @@ static void mock_device_release(struct drm_device *dev) ...@@ -76,7 +76,6 @@ static void mock_device_release(struct drm_device *dev)
drm_mode_config_cleanup(&i915->drm); drm_mode_config_cleanup(&i915->drm);
drm_dev_fini(&i915->drm);
out: out:
put_device(&i915->drm.pdev->dev); put_device(&i915->drm.pdev->dev);
i915->drm.pdev = NULL; i915->drm.pdev = NULL;
...@@ -215,7 +214,6 @@ struct drm_i915_private *mock_gem_device(void) ...@@ -215,7 +214,6 @@ struct drm_i915_private *mock_gem_device(void)
intel_gt_driver_late_release(&i915->gt); intel_gt_driver_late_release(&i915->gt);
intel_memory_regions_driver_release(i915); intel_memory_regions_driver_release(i915);
drm_mode_config_cleanup(&i915->drm); drm_mode_config_cleanup(&i915->drm);
drm_dev_fini(&i915->drm);
drm_dev_put(&i915->drm); drm_dev_put(&i915->drm);
return NULL; return NULL;
......
...@@ -492,7 +492,6 @@ static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg) ...@@ -492,7 +492,6 @@ static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg)
static void ingenic_drm_release(struct drm_device *drm) static void ingenic_drm_release(struct drm_device *drm)
{ {
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
drm_dev_fini(drm);
} }
static int ingenic_drm_enable_vblank(struct drm_crtc *crtc) static int ingenic_drm_enable_vblank(struct drm_crtc *crtc)
......
...@@ -221,7 +221,6 @@ static int mcde_modeset_init(struct drm_device *drm) ...@@ -221,7 +221,6 @@ static int mcde_modeset_init(struct drm_device *drm)
static void mcde_release(struct drm_device *drm) static void mcde_release(struct drm_device *drm)
{ {
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
drm_dev_fini(drm);
} }
DEFINE_DRM_GEM_CMA_FOPS(drm_fops); DEFINE_DRM_GEM_CMA_FOPS(drm_fops);
......
...@@ -108,8 +108,6 @@ static void tidss_release(struct drm_device *ddev) ...@@ -108,8 +108,6 @@ static void tidss_release(struct drm_device *ddev)
drm_kms_helper_poll_fini(ddev); drm_kms_helper_poll_fini(ddev);
tidss_modeset_cleanup(tidss); tidss_modeset_cleanup(tidss);
drm_dev_fini(ddev);
} }
DEFINE_DRM_GEM_CMA_FOPS(tidss_fops); DEFINE_DRM_GEM_CMA_FOPS(tidss_fops);
......
...@@ -637,7 +637,6 @@ static void gm12u320_driver_release(struct drm_device *dev) ...@@ -637,7 +637,6 @@ static void gm12u320_driver_release(struct drm_device *dev)
gm12u320_usb_free(gm12u320); gm12u320_usb_free(gm12u320);
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
drm_dev_fini(dev);
} }
DEFINE_DRM_GEM_FOPS(gm12u320_fops); DEFINE_DRM_GEM_FOPS(gm12u320_fops);
......
...@@ -914,7 +914,6 @@ static void repaper_release(struct drm_device *drm) ...@@ -914,7 +914,6 @@ static void repaper_release(struct drm_device *drm)
DRM_DEBUG_DRIVER("\n"); DRM_DEBUG_DRIVER("\n");
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
drm_dev_fini(drm);
} }
static const uint32_t repaper_formats[] = { static const uint32_t repaper_formats[] = {
......
...@@ -38,7 +38,6 @@ static void udl_driver_release(struct drm_device *dev) ...@@ -38,7 +38,6 @@ static void udl_driver_release(struct drm_device *dev)
{ {
udl_fini(dev); udl_fini(dev);
udl_modeset_cleanup(dev); udl_modeset_cleanup(dev);
drm_dev_fini(dev);
} }
static struct drm_driver driver = { static struct drm_driver driver = {
......
...@@ -432,7 +432,6 @@ static void vgem_release(struct drm_device *dev) ...@@ -432,7 +432,6 @@ static void vgem_release(struct drm_device *dev)
struct vgem_device *vgem = container_of(dev, typeof(*vgem), drm); struct vgem_device *vgem = container_of(dev, typeof(*vgem), drm);
platform_device_unregister(vgem->platform); platform_device_unregister(vgem->platform);
drm_dev_fini(&vgem->drm);
} }
static struct drm_driver vgem_driver = { static struct drm_driver vgem_driver = {
......
...@@ -64,7 +64,6 @@ static void vkms_release(struct drm_device *dev) ...@@ -64,7 +64,6 @@ static void vkms_release(struct drm_device *dev)
platform_device_unregister(vkms->platform); platform_device_unregister(vkms->platform);
drm_atomic_helper_shutdown(&vkms->drm); drm_atomic_helper_shutdown(&vkms->drm);
drm_mode_config_cleanup(&vkms->drm); drm_mode_config_cleanup(&vkms->drm);
drm_dev_fini(&vkms->drm);
destroy_workqueue(vkms->output.composer_workq); destroy_workqueue(vkms->output.composer_workq);
} }
......
...@@ -460,8 +460,6 @@ static void xen_drm_drv_release(struct drm_device *dev) ...@@ -460,8 +460,6 @@ static void xen_drm_drv_release(struct drm_device *dev)
drm_atomic_helper_shutdown(dev); drm_atomic_helper_shutdown(dev);
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
drm_dev_fini(dev);
if (front_info->cfg.be_alloc) if (front_info->cfg.be_alloc)
xenbus_switch_state(front_info->xb_dev, xenbus_switch_state(front_info->xb_dev,
XenbusStateInitialising); XenbusStateInitialising);
......
...@@ -262,9 +262,7 @@ struct drm_driver { ...@@ -262,9 +262,7 @@ struct drm_driver {
* @release: * @release:
* *
* Optional callback for destroying device data after the final * Optional callback for destroying device data after the final
* reference is released, i.e. the device is being destroyed. Drivers * reference is released, i.e. the device is being destroyed.
* using this callback are responsible for calling drm_dev_fini()
* to finalize the device and then freeing the struct themselves.
*/ */
void (*release) (struct drm_device *); void (*release) (struct drm_device *);
...@@ -620,7 +618,6 @@ int drm_dev_init(struct drm_device *dev, ...@@ -620,7 +618,6 @@ int drm_dev_init(struct drm_device *dev,
int devm_drm_dev_init(struct device *parent, int devm_drm_dev_init(struct device *parent,
struct drm_device *dev, struct drm_device *dev,
struct drm_driver *driver); struct drm_driver *driver);
void drm_dev_fini(struct drm_device *dev);
struct drm_device *drm_dev_alloc(struct drm_driver *driver, struct drm_device *drm_dev_alloc(struct drm_driver *driver,
struct device *parent); struct device *parent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment