drm: renesas: shmobile: remove now-redundant call to drm_connector_attach_encoder()

shmob_drm_connector_create() can init the connector in two ways, based on
the 'if (sdev->pdata)':

 1. manually in shmob_drm_connector_create(), or
 2. delegating to drm_bridge_connector_init()

Whichever branch is taken, drm_connector_attach_encoder() is called
immediately after to attach the connector to the encoder.

Now drm_bridge_connector_init() calls drm_connector_attach_encoder() on the
connector so it is not needed anymore in case 2 and should be removed, but
it is still needed in case 1. Move drm_connector_attach_encoder() from the
common path to inside shmob_drm_connector_create() in order to get back to
a single drm_connector_attach_encoder() in both cases.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260423115550.444930-7-luca.ceresoli@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
Luca Ceresoli 2026-04-23 13:55:50 +02:00
parent d5d8e04dc0
commit 6533278b0d

View File

@ -583,6 +583,13 @@ shmob_drm_connector_init(struct shmob_drm_device *sdev,
drm_connector_helper_add(connector, &connector_helper_funcs);
ret = drm_connector_attach_encoder(connector, encoder);
if (ret < 0) {
drm_connector_cleanup(connector);
kfree(scon);
return ERR_PTR(ret);
}
return connector;
}
@ -594,7 +601,6 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
struct drm_encoder *encoder)
{
struct drm_connector *connector;
int ret;
if (sdev->pdata)
connector = shmob_drm_connector_init(sdev, encoder);
@ -606,17 +612,9 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
return PTR_ERR(connector);
}
ret = drm_connector_attach_encoder(connector, encoder);
if (ret < 0)
goto error;
connector->dpms = DRM_MODE_DPMS_OFF;
sdev->connector = connector;
return 0;
error:
drm_connector_cleanup(connector);
return ret;
}