The sun4i TV connector reset implementation creates a pristine state and initializes the analog TV properties. It does not perform any hardware reset.
Since this is equivalent to what atomic_create_state expects, convert the reset function to an atomic_create_state hook that returns the initialized state. Signed-off-by: Maxime Ripard <[email protected]> --- Cc: Chen-Yu Tsai <[email protected]> Cc: Samuel Holland <[email protected]> Cc: [email protected] --- drivers/gpu/drm/sun4i/sun4i_tv.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c index ea86f8a6a35e..a68e5f7a03d2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tv.c +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c @@ -403,20 +403,28 @@ static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { static const struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { .atomic_check = drm_atomic_helper_connector_tv_check, .get_modes = drm_connector_helper_tv_get_modes, }; -static void sun4i_tv_connector_reset(struct drm_connector *connector) +static struct drm_connector_state * +sun4i_tv_connector_create_state(struct drm_connector *connector) { - drm_atomic_helper_connector_reset(connector); - drm_atomic_helper_connector_tv_state_init(connector->state, connector); + struct drm_connector_state *connector_state; + + connector_state = drm_atomic_helper_connector_create_state(connector); + if (IS_ERR(connector_state)) + return connector_state; + + drm_atomic_helper_connector_tv_state_init(connector_state, connector); + + return connector_state; } static const struct drm_connector_funcs sun4i_tv_comp_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, - .reset = sun4i_tv_connector_reset, + .atomic_create_state = sun4i_tv_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static const struct regmap_config sun4i_tv_regmap_config = { -- 2.55.0
