[PATCH v2 11/20] drm/tilcdc: Rename external_encoder and external_connector to encoder and connector

Kory Maincent (TI.com)
2025-12-11T16:40:16Z

Remove the "external_" prefix from encoder and connector members in the
tilcdc driver. These are internal driver structures and the "external"
naming is misleading. The simpler names better reflect that these are
the primary encoder and connector managed by this driver.

Also rename tilcdc_attach_external_device() to tilcdc_encoder_create()
for consistency and to better describe the function's purpose.

Signed-off-by: Kory Maincent (TI.com) <kory.maincent@bootlin.com>
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 ++--
drivers/gpu/drm/tilcdc/tilcdc_drv.h | 4 ++--
drivers/gpu/drm/tilcdc/tilcdc_external.c | 24 ++++++++++++------------
drivers/gpu/drm/tilcdc/tilcdc_external.h | 2 +-
4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index a753cc47a59d7..bf6cd763ecd0f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -344,11 +344,11 @@ static int tilcdc_init(const struct drm_driver *ddrv, struct device *dev)
}
#endif

- ret = tilcdc_attach_external_device(ddev);
+ ret = tilcdc_encoder_create(ddev);
if (ret)
goto unregister_cpufreq_notif;

- if (!priv->external_connector) {
+ if (!priv->connector) {
dev_err(dev, "no encoders/connectors found\n");
ret = -EPROBE_DEFER;
goto unregister_cpufreq_notif;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 717529a331009..dafb00908d1d4 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -75,8 +75,8 @@ struct tilcdc_drm_private {

struct drm_crtc *crtc;

- struct drm_encoder *external_encoder;
- struct drm_connector *external_connector;
+ struct drm_encoder *encoder;
+ struct drm_connector *connector;

bool irq_enabled;
};
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
index 81c90c2754c6c..0c18d05dc7101 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_external.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
@@ -37,21 +37,21 @@ int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridge)
struct tilcdc_drm_private *priv = ddev->dev_private;
int ret;

- priv->external_encoder->possible_crtcs = BIT(0);
+ priv->encoder->possible_crtcs = BIT(0);

- ret = drm_bridge_attach(priv->external_encoder, bridge, NULL, 0);
+ ret = drm_bridge_attach(priv->encoder, bridge, NULL, 0);
if (ret)
return ret;

- priv->external_connector =
- tilcdc_encoder_find_connector(ddev, priv->external_encoder);
- if (!priv->external_connector)
+ priv->connector =
+ tilcdc_encoder_find_connector(ddev, priv->encoder);
+ if (!priv->connector)
return -ENODEV;

return 0;
}

-int tilcdc_attach_external_device(struct drm_device *ddev)
+int tilcdc_encoder_create(struct drm_device *ddev)
{
struct tilcdc_drm_private *priv = ddev->dev_private;
struct drm_bridge *bridge;
@@ -65,13 +65,13 @@ int tilcdc_attach_external_device(struct drm_device *ddev)
else if (ret)
return ret;

- priv->external_encoder = devm_kzalloc(ddev->dev,
- sizeof(*priv->external_encoder),
- GFP_KERNEL);
- if (!priv->external_encoder)
+ priv->encoder = devm_kzalloc(ddev->dev,
+ sizeof(*priv->encoder),
+ GFP_KERNEL);
+ if (!priv->encoder)
return -ENOMEM;

- ret = drm_simple_encoder_init(ddev, priv->external_encoder,
+ ret = drm_simple_encoder_init(ddev, priv->encoder,
DRM_MODE_ENCODER_NONE);
if (ret) {
dev_err(ddev->dev, "drm_encoder_init() failed %d\n", ret);
@@ -94,6 +94,6 @@ int tilcdc_attach_external_device(struct drm_device *ddev)
return 0;

err_encoder_cleanup:
- drm_encoder_cleanup(priv->external_encoder);
+ drm_encoder_cleanup(priv->encoder);
return ret;
}
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.h b/drivers/gpu/drm/tilcdc/tilcdc_external.h
index 285a132f3035d..c8f87f59024e6 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_external.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.h
@@ -7,5 +7,5 @@
#ifndef __TILCDC_EXTERNAL_H__
#define __TILCDC_EXTERNAL_H__

-int tilcdc_attach_external_device(struct drm_device *ddev);
+int tilcdc_encoder_create(struct drm_device *ddev);
#endif /* __TILCDC_SLAVE_H__ */

--
2.43.0