diff mbox

drm/arcpgu: remove drm_encoder_slave

Message ID 20180117135307.26660-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Jan. 17, 2018, 1:53 p.m. UTC
drm_encoder_slave is the old way to write bridge drivers, for i2c
bridges only. It's deprecated, and definitely should not be used in
new drivers.

What's even strange is that arcpgu doesn't even use any of this, it
really only wants a plain normal drm_encoder. Nuke all the surplus
real estate.

v2: Actually git add after compile testing ...

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/arc/arcpgu_sim.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Laurent Pinchart Jan. 17, 2018, 2:02 p.m. UTC | #1
Hi Daniel,

Thank you for the patch.

On Wednesday, 17 January 2018 15:53:07 EET Daniel Vetter wrote:
> drm_encoder_slave is the old way to write bridge drivers, for i2c
> bridges only. It's deprecated, and definitely should not be used in
> new drivers.
> 
> What's even strange is that arcpgu doesn't even use any of this, it
> really only wants a plain normal drm_encoder. Nuke all the surplus
> real estate.
> 
> v2: Actually git add after compile testing ...
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Could you merge this along with "[PATCH] drm: Don't include drm/
drm_encoder_slave.h when not needed" ? We will then only have two users of the 
encoder slave API left, nouveau and armada (and of course the encoder slave 
drivers themselves), and no stray occurrence of the encoder slave term in 
other source files.

> ---
>  drivers/gpu/drm/arc/arcpgu_sim.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c
> b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..19f5a781666d 100644
> --- a/drivers/gpu/drm/arc/arcpgu_sim.c
> +++ b/drivers/gpu/drm/arc/arcpgu_sim.c
> @@ -29,7 +29,6 @@
> 
>  struct arcpgu_drm_connector {
>  	struct drm_connector connector;
> -	struct drm_encoder_slave *encoder_slave;
>  };
> 
>  static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
> @@ -68,7 +67,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs =
> { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) {
>  	struct arcpgu_drm_connector *arcpgu_connector;
> -	struct drm_encoder_slave *encoder;
> +	struct drm_encoder *encoder;
>  	struct drm_connector *connector;
>  	int ret;
> 
> @@ -76,10 +75,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct
> device_node *np) if (encoder == NULL)
>  		return -ENOMEM;
> 
> -	encoder->base.possible_crtcs = 1;
> -	encoder->base.possible_clones = 0;
> +	encoder->possible_crtcs = 1;
> +	encoder->possible_clones = 0;
> 
> -	ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
> +	ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs,
>  			       DRM_MODE_ENCODER_VIRTUAL, NULL);
>  	if (ret)
>  		return ret;
> @@ -101,21 +100,19 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct
> device_node *np) goto error_encoder_cleanup;
>  	}
> 
> -	ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
> +	ret = drm_mode_connector_attach_encoder(connector, encoder);
>  	if (ret < 0) {
>  		dev_err(drm->dev, "could not attach connector to encoder\n");
>  		drm_connector_unregister(connector);
>  		goto error_connector_cleanup;
>  	}
> 
> -	arcpgu_connector->encoder_slave = encoder;
> -
>  	return 0;
> 
>  error_connector_cleanup:
>  	drm_connector_cleanup(connector);
> 
>  error_encoder_cleanup:
> -	drm_encoder_cleanup(&encoder->base);
> +	drm_encoder_cleanup(encoder);
>  	return ret;
>  }
diff mbox

Patch

diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c
index bca3a678c955..19f5a781666d 100644
--- a/drivers/gpu/drm/arc/arcpgu_sim.c
+++ b/drivers/gpu/drm/arc/arcpgu_sim.c
@@ -29,7 +29,6 @@ 
 
 struct arcpgu_drm_connector {
 	struct drm_connector connector;
-	struct drm_encoder_slave *encoder_slave;
 };
 
 static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
@@ -68,7 +67,7 @@  static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
 int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
 {
 	struct arcpgu_drm_connector *arcpgu_connector;
-	struct drm_encoder_slave *encoder;
+	struct drm_encoder *encoder;
 	struct drm_connector *connector;
 	int ret;
 
@@ -76,10 +75,10 @@  int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
 	if (encoder == NULL)
 		return -ENOMEM;
 
-	encoder->base.possible_crtcs = 1;
-	encoder->base.possible_clones = 0;
+	encoder->possible_crtcs = 1;
+	encoder->possible_clones = 0;
 
-	ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
+	ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs,
 			       DRM_MODE_ENCODER_VIRTUAL, NULL);
 	if (ret)
 		return ret;
@@ -101,21 +100,19 @@  int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
 		goto error_encoder_cleanup;
 	}
 
-	ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
+	ret = drm_mode_connector_attach_encoder(connector, encoder);
 	if (ret < 0) {
 		dev_err(drm->dev, "could not attach connector to encoder\n");
 		drm_connector_unregister(connector);
 		goto error_connector_cleanup;
 	}
 
-	arcpgu_connector->encoder_slave = encoder;
-
 	return 0;
 
 error_connector_cleanup:
 	drm_connector_cleanup(connector);
 
 error_encoder_cleanup:
-	drm_encoder_cleanup(&encoder->base);
+	drm_encoder_cleanup(encoder);
 	return ret;
 }