From: Dmitry Baryshkov <[email protected]> The driver uses drm_writeback_connector_init() instead of its drmm counterpart, but it doesn't perform the job queue cleanup (neither manually nor by calling drm_writeback_connector_cleanup()). On the contrary, the drmm_writeback_connector_init() function ensures the proper cleanup of the job queue.
Use drmm_writeback_connector_init() in order to initialize writeback connector instance. v2: Drop unbind call as no longer necessary (complained by Sashiko). Reviewed-by: Louis Chauvet <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: John Harrison <[email protected]> --- drivers/gpu/drm/vc4/vc4_txp.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_txp.c b/drivers/gpu/drm/vc4/vc4_txp.c index bc3f366fc3e6..322cc65dc787 100644 --- a/drivers/gpu/drm/vc4/vc4_txp.c +++ b/drivers/gpu/drm/vc4/vc4_txp.c @@ -377,7 +377,6 @@ vc4_txp_connector_detect(struct drm_connector *connector, bool force) static const struct drm_connector_funcs vc4_txp_connector_funcs = { .detect = vc4_txp_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = drm_connector_cleanup, .reset = drm_atomic_helper_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, @@ -601,10 +600,10 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) drm_connector_helper_add(&txp->connector.base, &vc4_txp_connector_helper_funcs); - ret = drm_writeback_connector_init_with_encoder(drm, &txp->connector, - encoder, - &vc4_txp_connector_funcs, - drm_fmts, ARRAY_SIZE(drm_fmts)); + ret = drmm_writeback_connector_init(drm, &txp->connector, + &vc4_txp_connector_funcs, + encoder, + drm_fmts, ARRAY_SIZE(drm_fmts)); if (ret) return ret; @@ -618,17 +617,8 @@ static int vc4_txp_bind(struct device *dev, struct device *master, void *data) return 0; } -static void vc4_txp_unbind(struct device *dev, struct device *master, - void *data) -{ - struct vc4_txp *txp = dev_get_drvdata(dev); - - drm_connector_cleanup(&txp->connector.base); -} - static const struct component_ops vc4_txp_ops = { .bind = vc4_txp_bind, - .unbind = vc4_txp_unbind, }; static int vc4_txp_probe(struct platform_device *pdev) -- 2.43.0
