diff mbox series

[v5,17/24] drm/mgag200: Provide ddc symlink in connector sysfs directory

Message ID f86dfa1ed6e84ab8b36a0b2c24df897bdb957294.1563960855.git.andrzej.p@collabora.com (mailing list archive)
State New, archived
Headers show
Series Associate ddc adapters with connectors | expand

Commit Message

Andrzej Pietrasiewicz July 24, 2019, 1:59 p.m. UTC
Use the ddc pointer provided by the generic connector.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Thomas Zimmermann July 24, 2019, 5:17 p.m. UTC | #1
Am 24.07.19 um 15:59 schrieb Andrzej Pietrasiewicz:
> Use the ddc pointer provided by the generic connector.
> 
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> ---
>  drivers/gpu/drm/mgag200/mgag200_mode.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 822f2a13748f..5e778b5f1a10 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1678,18 +1678,19 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)
>  		return NULL;
>  
>  	connector = &mga_connector->base;
> +	mga_connector->i2c = mgag200_i2c_create(dev);
> +	if (!mga_connector->i2c)
> +		DRM_ERROR("failed to add ddc bus\n");
>  
> -	drm_connector_init(dev, connector,
> -			   &mga_vga_connector_funcs, DRM_MODE_CONNECTOR_VGA);
> +	drm_connector_init_with_ddc(dev, connector,
> +				    &mga_vga_connector_funcs,
> +				    DRM_MODE_CONNECTOR_VGA,
> +				    &mga_connector->i2c->adapter);
>  
>  	drm_connector_helper_add(connector, &mga_vga_connector_helper_funcs);
>  
>  	drm_connector_register(connector);
>  
> -	mga_connector->i2c = mgag200_i2c_create(dev);
> -	if (!mga_connector->i2c)
> -		DRM_ERROR("failed to add ddc bus\n");
> -
>  	return connector;
>  }
>  
> 

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 822f2a13748f..5e778b5f1a10 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1678,18 +1678,19 @@  static struct drm_connector *mga_vga_init(struct drm_device *dev)
 		return NULL;
 
 	connector = &mga_connector->base;
+	mga_connector->i2c = mgag200_i2c_create(dev);
+	if (!mga_connector->i2c)
+		DRM_ERROR("failed to add ddc bus\n");
 
-	drm_connector_init(dev, connector,
-			   &mga_vga_connector_funcs, DRM_MODE_CONNECTOR_VGA);
+	drm_connector_init_with_ddc(dev, connector,
+				    &mga_vga_connector_funcs,
+				    DRM_MODE_CONNECTOR_VGA,
+				    &mga_connector->i2c->adapter);
 
 	drm_connector_helper_add(connector, &mga_vga_connector_helper_funcs);
 
 	drm_connector_register(connector);
 
-	mga_connector->i2c = mgag200_i2c_create(dev);
-	if (!mga_connector->i2c)
-		DRM_ERROR("failed to add ddc bus\n");
-
 	return connector;
 }