mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/connector: Check for destroy implementation
Connectors need to be cleaned up with a call to drm_connector_cleanup() in their drm_connector_funcs.destroy implementation. Let's check for this and complain if there's no such function. Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
This commit is contained in:
committed by
Dom Cobley
parent
682ed35911
commit
c085410c70
@@ -347,6 +347,9 @@ int drm_connector_init(struct drm_device *dev,
|
|||||||
const struct drm_connector_funcs *funcs,
|
const struct drm_connector_funcs *funcs,
|
||||||
int connector_type)
|
int connector_type)
|
||||||
{
|
{
|
||||||
|
if (drm_WARN_ON(dev, !(funcs && funcs->destroy)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
return __drm_connector_init(dev, connector, funcs, connector_type, NULL);
|
return __drm_connector_init(dev, connector, funcs, connector_type, NULL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_connector_init);
|
EXPORT_SYMBOL(drm_connector_init);
|
||||||
@@ -377,6 +380,9 @@ int drm_connector_init_with_ddc(struct drm_device *dev,
|
|||||||
int connector_type,
|
int connector_type,
|
||||||
struct i2c_adapter *ddc)
|
struct i2c_adapter *ddc)
|
||||||
{
|
{
|
||||||
|
if (drm_WARN_ON(dev, !(funcs && funcs->destroy)))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
return __drm_connector_init(dev, connector, funcs, connector_type, ddc);
|
return __drm_connector_init(dev, connector, funcs, connector_type, ddc);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_connector_init_with_ddc);
|
EXPORT_SYMBOL(drm_connector_init_with_ddc);
|
||||||
|
|||||||
Reference in New Issue
Block a user