]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/i2c: tda998x: don't register the connector
authorBrian Starkey <brian.starkey@arm.com>
Mon, 25 Jul 2016 10:55:48 +0000 (11:55 +0100)
committerSean Paul <seanpaul@chromium.org>
Thu, 22 Sep 2016 11:04:24 +0000 (04:04 -0700)
The connector shouldn't be registered until the rest of the whole device
is set up, so that consistent state is presented to userspace.

As drm_dev_register() now registers all of the connectors anyway,
there's no need to explicitly do it in individual drivers so remove
the calls to drm_connector_register()/drm_connector_unregister().

This allows componentised drivers to use tda998x without having racy
initialisation.

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1469444148-19003-1-git-send-email-brian.starkey@arm.com
Link: http://patchwork.freedesktop.org/patch/msgid/545C835D.1050008@arm.com
drivers/gpu/drm/i2c/tda998x_drv.c

index 9798d400d8174750522b1704be66364fe9425318..088900d78ceb5c2946705c4252d3f5ec296a01ce 100644 (file)
@@ -1584,7 +1584,6 @@ const struct drm_connector_helper_funcs tda998x_connector_helper_funcs = {
 
 static void tda998x_connector_destroy(struct drm_connector *connector)
 {
-       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 
@@ -1656,16 +1655,10 @@ static int tda998x_bind(struct device *dev, struct device *master, void *data)
        if (ret)
                goto err_connector;
 
-       ret = drm_connector_register(&priv->connector);
-       if (ret)
-               goto err_sysfs;
-
        drm_mode_connector_attach_encoder(&priv->connector, &priv->encoder);
 
        return 0;
 
-err_sysfs:
-       drm_connector_cleanup(&priv->connector);
 err_connector:
        drm_encoder_cleanup(&priv->encoder);
 err_encoder:
@@ -1678,7 +1671,6 @@ static void tda998x_unbind(struct device *dev, struct device *master,
 {
        struct tda998x_priv *priv = dev_get_drvdata(dev);
 
-       drm_connector_unregister(&priv->connector);
        drm_connector_cleanup(&priv->connector);
        drm_encoder_cleanup(&priv->encoder);
        tda998x_destroy(priv);