drm: add register and unregister functions for connectors
authorThomas Wood <thomas.wood@intel.com>
Thu, 29 May 2014 15:57:41 +0000 (16:57 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 19 Jun 2014 06:55:28 +0000 (08:55 +0200)
Introduce generic functions to register and unregister connectors. This
provides a common place to add and remove associated user space
interfaces.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
49 files changed:
Documentation/DocBook/drm.tmpl
drivers/gpu/drm/armada/armada_output.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/bridge/ptn3460.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_sysfs.c
drivers/gpu/drm/exynos/exynos_dp_core.c
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_dpi.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_dp.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/mdfld_dsi_output.c
drivers/gpu/drm/gma500/oaktrail_hdmi.c
drivers/gpu/drm/gma500/oaktrail_lvds.c
drivers/gpu/drm/gma500/psb_intel_lvds.c
drivers/gpu/drm/gma500/psb_intel_sdvo.c
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/mgag200/mgag200_mode.c
drivers/gpu/drm/msm/hdmi/hdmi_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/omapdrm/omap_connector.c
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/radeon/radeon_connectors.c
drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
drivers/gpu/drm/shmobile/shmob_drm_crtc.c
drivers/gpu/drm/tegra/output.c
drivers/gpu/drm/tilcdc/tilcdc_panel.c
drivers/gpu/drm/tilcdc/tilcdc_slave.c
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
drivers/gpu/drm/udl/udl_connector.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
drivers/staging/imx-drm/imx-drm-core.c
include/drm/drm_crtc.h

index 7df3134ebc0e1d4b88985132eda82f26b267f4f3..b314a42bb18c24d52f76e331ea999017264050f9 100644 (file)
@@ -1610,7 +1610,7 @@ int max_width, max_height;</synopsis>
           The connector is then registered with a call to
           <function>drm_connector_init</function> with a pointer to the connector
           functions and a connector type, and exposed through sysfs with a call to
-          <function>drm_sysfs_connector_add</function>.
+          <function>drm_connector_register</function>.
         </para>
         <para>
           Supported connector types are
@@ -1768,7 +1768,7 @@ int max_width, max_height;</synopsis>
        (<function>drm_encoder_cleanup</function>) and connectors
        (<function>drm_connector_cleanup</function>). Furthermore, connectors
        that have been added to sysfs must be removed by a call to
-       <function>drm_sysfs_connector_remove</function> before calling
+       <function>drm_connector_unregister</function> before calling
        <function>drm_connector_cleanup</function>.
       </para>
       <para>
@@ -1813,7 +1813,7 @@ void intel_crt_init(struct drm_device *dev)
        drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
        drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 }]]></programlisting>
       <para>
         In the example above (taken from the i915 driver), a CRTC, connector and
index d685a5421485fde0280b3ad5db8eab90a7f5ab3f..abbc309fe539e9d917464980b344e30ed3a1d58f 100644 (file)
@@ -48,7 +48,7 @@ static void armada_drm_connector_destroy(struct drm_connector *conn)
 {
        struct armada_connector *dconn = drm_to_armada_conn(conn);
 
-       drm_sysfs_connector_remove(conn);
+       drm_connector_unregister(conn);
        drm_connector_cleanup(conn);
        kfree(dconn);
 }
@@ -141,7 +141,7 @@ int armada_output_create(struct drm_device *dev,
        if (ret)
                goto err_conn;
 
-       ret = drm_sysfs_connector_add(&dconn->conn);
+       ret = drm_connector_register(&dconn->conn);
        if (ret)
                goto err_sysfs;
 
index 114aee941d46b417f87a7aad1c20502374873ef8..9896286ed262d867e8e0f0138a7128ffca4f7a88 100644 (file)
@@ -829,7 +829,7 @@ static void ast_connector_destroy(struct drm_connector *connector)
 {
        struct ast_connector *ast_connector = to_ast_connector(connector);
        ast_i2c_destroy(ast_connector->i2c);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -871,7 +871,7 @@ static int ast_connector_init(struct drm_device *dev)
        connector->interlace_allowed = 0;
        connector->doublescan_allowed = 0;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        connector->polled = DRM_CONNECTOR_POLL_CONNECT;
 
index 98fd17ae491690b3f63de688dae611bf617b529a..d466696ed5e8ca00211988e3952c4d872ba2150b 100644 (file)
@@ -328,7 +328,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder,
        }
        drm_connector_helper_add(&ptn_bridge->connector,
                        &ptn3460_connector_helper_funcs);
-       drm_sysfs_connector_add(&ptn_bridge->connector);
+       drm_connector_register(&ptn_bridge->connector);
        drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder);
 
        return 0;
index fe94cc10cd350f8dcf06f989f7f131fb392771a9..c50c827cefb6c93eed0217e48e11c747fe17aa3b 100644 (file)
@@ -920,6 +920,34 @@ void drm_connector_cleanup(struct drm_connector *connector)
 }
 EXPORT_SYMBOL(drm_connector_cleanup);
 
+/**
+ * drm_connector_register - register a connector
+ * @connector: the connector to register
+ *
+ * Register userspace interfaces for a connector
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_connector_register(struct drm_connector *connector)
+{
+       return drm_sysfs_connector_add(connector);
+}
+EXPORT_SYMBOL(drm_connector_register);
+
+/**
+ * drm_connector_unregister - unregister a connector
+ * @connector: the connector to unregister
+ *
+ * Unregister userspace interfaces for a connector
+ */
+void drm_connector_unregister(struct drm_connector *connector)
+{
+       drm_sysfs_connector_remove(connector);
+}
+EXPORT_SYMBOL(drm_connector_unregister);
+
+
 /**
  * drm_connector_unplug_all - unregister connector userspace interfaces
  * @dev: drm device
@@ -934,7 +962,7 @@ void drm_connector_unplug_all(struct drm_device *dev)
 
        /* taking the mode config mutex ends up in a clash with sysfs */
        list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-               drm_sysfs_connector_remove(connector);
+               drm_connector_unregister(connector);
 
 }
 EXPORT_SYMBOL(drm_connector_unplug_all);
index 369b26278e76601b519f19ef82fe771d297ea250..7827dad8fcf4fbf1e08fd76be6798277b992436d 100644 (file)
@@ -438,7 +438,6 @@ err_out_files:
 out:
        return ret;
 }
-EXPORT_SYMBOL(drm_sysfs_connector_add);
 
 /**
  * drm_sysfs_connector_remove - remove an connector device from sysfs
@@ -468,7 +467,6 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
        device_unregister(connector->kdev);
        connector->kdev = NULL;
 }
-EXPORT_SYMBOL(drm_sysfs_connector_remove);
 
 /**
  * drm_sysfs_hotplug_event - generate a DRM uevent
index a8ffc8c1477b07e2ac4d90936872c0d1694818e7..86dc69d9eabbe343e66911962ee4bdbeba113d28 100644 (file)
@@ -1018,7 +1018,7 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,
        }
 
        drm_connector_helper_add(connector, &exynos_dp_connector_helper_funcs);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        return 0;
index 9a16dbe121d11e3a24c7f72b6c55ca5db50319fb..25c788832e2eaba66683433ba6e27cc05367c052 100644 (file)
@@ -185,7 +185,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector)
        struct exynos_drm_connector *exynos_connector =
                to_exynos_connector(connector);
 
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(exynos_connector);
 }
@@ -230,7 +230,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
        drm_connector_init(dev, connector, &exynos_connector_funcs, type);
        drm_connector_helper_add(connector, &exynos_connector_helper_funcs);
 
-       err = drm_sysfs_connector_add(connector);
+       err = drm_connector_register(connector);
        if (err)
                goto err_connector;
 
@@ -250,7 +250,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
        return connector;
 
 err_sysfs:
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
 err_connector:
        drm_connector_cleanup(connector);
        kfree(exynos_connector);
index 482127f633c573fe84db8faffbe7cf5210df7ac3..4693531ebd48b699cc51a5b58c6692516fa6bd31 100644 (file)
@@ -48,7 +48,7 @@ exynos_dpi_detect(struct drm_connector *connector, bool force)
 
 static void exynos_dpi_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 
@@ -117,7 +117,7 @@ static int exynos_dpi_create_connector(struct exynos_drm_display *display,
        }
 
        drm_connector_helper_add(connector, &exynos_dpi_connector_helper_funcs);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        return 0;
index 6302aa64f6c1e328bb315a8ccd70e07e3489d17a..2df3592166def1338f238b5aabc753cdcff1c21a 100644 (file)
@@ -1246,7 +1246,7 @@ static int exynos_dsi_create_connector(struct exynos_drm_display *display,
        }
 
        drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        return 0;
index 2fb8705d6461f68457f476cd7d231b0c776eabdc..9528d81d8004d70bcd9f395a68f37ab12de5d9d5 100644 (file)
@@ -562,7 +562,7 @@ static int vidi_create_connector(struct exynos_drm_display *display,
        }
 
        drm_connector_helper_add(connector, &vidi_connector_helper_funcs);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        return 0;
index c104d0c9b385a3860a4a21b8989bb8aede5abcbd..dd565c4e5b4d6adff67b7de022d5dff9dbf4ac00 100644 (file)
@@ -1129,7 +1129,7 @@ static int hdmi_create_connector(struct exynos_drm_display *display,
        }
 
        drm_connector_helper_add(connector, &hdmi_connector_helper_funcs);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        return 0;
index c18268cd516ef5798d06824a6b0b436011ef3438..248c33a35ebf116c6b574b284b2c0a2848750a12 100644 (file)
@@ -192,7 +192,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
        struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
 
        psb_intel_i2c_destroy(gma_encoder->ddc_bus);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -304,7 +304,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
        drm_connector_helper_add(connector,
                                        &cdv_intel_crt_connector_helper_funcs);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        return;
 failed_ddc:
index 9ff30c2efadbf99c8901bf0fe26f22cea73f63b5..a4cc0e60a1be732c035c06754571dafa09e4d0c8 100644 (file)
@@ -1713,7 +1713,7 @@ cdv_intel_dp_destroy(struct drm_connector *connector)
                }
        }
        i2c_del_adapter(&intel_dp->adapter);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -1847,7 +1847,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
        connector->interlace_allowed = false;
        connector->doublescan_allowed = false;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        /* Set up the DDC bus. */
        switch (output_reg) {
index b99084b3f706e0e50d35330ab6accc9a0fcaf08f..4268bf2100344167243ff9f7bbb20c0370658eb6 100644 (file)
@@ -248,7 +248,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
 
        if (gma_encoder->i2c_bus)
                psb_intel_i2c_destroy(gma_encoder->i2c_bus);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -356,7 +356,7 @@ void cdv_hdmi_init(struct drm_device *dev,
 
        hdmi_priv->hdmi_i2c_adapter = &(gma_encoder->i2c_bus->adapter);
        hdmi_priv->dev = dev;
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return;
 
 failed_ddc:
index 8ecc920fc26d1c3f8f331004305180aab88413d4..0b770396548c6674c88d3b2802695b703189ae7b 100644 (file)
@@ -446,7 +446,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
 
        if (gma_encoder->i2c_bus)
                psb_intel_i2c_destroy(gma_encoder->i2c_bus);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -774,7 +774,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 
 out:
        mutex_unlock(&dev->mode_config.mutex);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return;
 
 failed_find:
index 6e91b20ce2e500fd766103ce1d11403a4257f383..abf2248da61ecffec15d80fc0d07f0137f7418c0 100644 (file)
@@ -318,7 +318,7 @@ static void mdfld_dsi_connector_destroy(struct drm_connector *connector)
 
        if (!dsi_connector)
                return;
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        sender = dsi_connector->pkg_sender;
        mdfld_dsi_pkg_sender_destroy(sender);
@@ -597,7 +597,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
        dsi_config->encoder = encoder;
        encoder->base.type = (pipe == 0) ? INTEL_OUTPUT_MIPI :
                INTEL_OUTPUT_MIPI2;
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return;
 
        /*TODO: add code to destroy outputs on error*/
index cf018ddcc5a646caf91d027d4cd79343d6e7c124..e6f5c620a0a21c1a1110d6638db5098b65abada4 100644 (file)
@@ -665,7 +665,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
        connector->display_info.subpixel_order = SubPixelHorizontalRGB;
        connector->interlace_allowed = false;
        connector->doublescan_allowed = false;
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        dev_info(dev->dev, "HDMI initialised.\n");
 
        return;
index 9b099468a5dbb496d0892f8c465131522aae7d9a..0d39da6e8b7a0627d7923d70b795a3f31db69e04 100644 (file)
@@ -404,7 +404,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
 out:
        mutex_unlock(&dev->mode_config.mutex);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return;
 
 failed_find:
index d7778d0472c18569cbd89fbd9c70b5aa3f3a913b..88aad95bde091ab82e0f5461361cbe682ec8ab10 100644 (file)
@@ -563,7 +563,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
 
        if (lvds_priv->ddc_bus)
                psb_intel_i2c_destroy(lvds_priv->ddc_bus);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -829,7 +829,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
         */
 out:
        mutex_unlock(&dev->mode_config.mutex);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return;
 
 failed_find:
index deeb0829b1298d29130f51e7bad4bf4a415c6adc..0be96fdb5e28ba4e63ae51b6eb2b2d9a947028d4 100644 (file)
@@ -1682,7 +1682,7 @@ static void psb_intel_sdvo_destroy(struct drm_connector *connector)
                                     psb_intel_sdvo_connector->tv_format);
 
        psb_intel_sdvo_destroy_enhance_property(connector);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -2071,7 +2071,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
        connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
 
        gma_connector_attach_encoder(&connector->base, &encoder->base);
-       drm_sysfs_connector_add(&connector->base.base);
+       drm_connector_register(&connector->base.base);
 }
 
 static void
index 5a045d3bd77e7c7f77c7e8fc55292d37714eab3a..8da5ef9f48281a3b97daa1f212bb4c64a2c3447b 100644 (file)
@@ -869,7 +869,7 @@ void intel_crt_init(struct drm_device *dev)
 
        drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        if (!I915_HAS_HOTPLUG(dev))
                intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT;
index efd3cf50cb0f6a647d670a0f2a7b886b4e1d0b8a..dbabaec6ae2dcf0a95053e3d971cf6aeed51faa2 100644 (file)
@@ -12234,7 +12234,7 @@ void intel_connector_unregister(struct intel_connector *intel_connector)
        struct drm_connector *connector = &intel_connector->base;
 
        intel_panel_destroy_backlight(connector);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
 }
 
 void intel_modeset_cleanup(struct drm_device *dev)
index 52fda950fd2a1556cb23fc000e5a7a575e58e4e1..99f033f6918978df13e4d832286d9d987d2a79db 100644 (file)
@@ -4246,7 +4246,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
                          edp_panel_vdd_work);
 
        intel_connector_attach_encoder(intel_connector, intel_encoder);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        if (HAS_DDI(dev))
                intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
@@ -4289,7 +4289,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
                        edp_panel_vdd_off_sync(intel_dp);
                        drm_modeset_unlock(&dev->mode_config.connection_mutex);
                }
-               drm_sysfs_connector_remove(connector);
+               drm_connector_unregister(connector);
                drm_connector_cleanup(connector);
                return false;
        }
index 02f99d768d49f4f76d6eb1ec9de683911d3332c5..7c07ee07a8ee69f8f4e3636da4ca43986cbf9849 100644 (file)
@@ -742,7 +742,7 @@ bool intel_dsi_init(struct drm_device *dev)
 
        intel_connector_attach_encoder(intel_connector, intel_encoder);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        fixed_mode = dsi->dev_ops->get_modes(&intel_dsi->dev);
        if (!fixed_mode) {
index a3631c0a5c283695ac75147dda830618f3ad55cc..3fb71a04e14f555761e77b4266990f866d182c00 100644 (file)
@@ -558,7 +558,7 @@ void intel_dvo_init(struct drm_device *dev)
                        intel_dvo->panel_wants_dither = true;
                }
 
-               drm_sysfs_connector_add(connector);
+               drm_connector_register(connector);
                return;
        }
 
index eee2bbec2958d4d569dcc67c1c293b51fc9e5c34..0b603102cb3be10a3917b0316db0f9699f9e57d7 100644 (file)
@@ -1490,7 +1490,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
        intel_hdmi_add_properties(intel_hdmi, connector);
 
        intel_connector_attach_encoder(intel_connector, intel_encoder);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
         * 0xd.  Failure to do so will result in spurious interrupts being
index 23126023aeba04e6819d9ad1fdd64f2b8d69b646..4d29a83fd163b3c657e12e2bb78f408b818ff898 100644 (file)
@@ -1097,7 +1097,7 @@ out:
                DRM_DEBUG_KMS("lid notifier registration failed\n");
                lvds_connector->lid_notifier.notifier_call = NULL;
        }
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
        intel_panel_setup_backlight(connector);
index 6a4d5bc17697867c00f34dd9476a294d3145d015..e0be8ae75c15a7aefb3553fa66c0c83b7a0be976 100644 (file)
@@ -2431,7 +2431,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
        connector->base.unregister = intel_sdvo_connector_unregister;
 
        intel_connector_attach_encoder(&connector->base, &encoder->base);
-       ret = drm_sysfs_connector_add(drm_connector);
+       ret = drm_connector_register(drm_connector);
        if (ret < 0)
                goto err1;
 
@@ -2444,7 +2444,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
        return 0;
 
 err2:
-       drm_sysfs_connector_remove(drm_connector);
+       drm_connector_unregister(drm_connector);
 err1:
        drm_connector_cleanup(drm_connector);
 
@@ -2557,7 +2557,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
        return true;
 
 err:
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        intel_sdvo_destroy(connector);
        return false;
 }
@@ -2636,7 +2636,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
        return true;
 
 err:
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        intel_sdvo_destroy(connector);
        return false;
 }
@@ -2709,7 +2709,7 @@ static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
        list_for_each_entry_safe(connector, tmp,
                                 &dev->mode_config.connector_list, head) {
                if (intel_attached_encoder(connector) == &intel_sdvo->base) {
-                       drm_sysfs_connector_remove(connector);
+                       drm_connector_unregister(connector);
                        intel_sdvo_destroy(connector);
                }
        }
index 67c6c9a2eb1c9f3ed3d0d6979a686b52fdabe9fe..e211eef4b7e4cac5a1eae5c88119537621f788a8 100644 (file)
@@ -1680,5 +1680,5 @@ intel_tv_init(struct drm_device *dev)
        drm_object_attach_property(&connector->base,
                                   dev->mode_config.tv_bottom_margin_property,
                                   intel_tv->margin[TV_MARGIN_BOTTOM]);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 }
index a034ed408252eb08e57e166ba6afed4a50931e31..f9fe390920f1446d9970c69822b2173989ce6f1a 100644 (file)
@@ -1621,7 +1621,7 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)
 
        drm_connector_helper_add(connector, &mga_vga_connector_helper_funcs);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        mga_connector->i2c = mgag200_i2c_create(dev);
        if (!mga_connector->i2c)
index e56a6196867c6609c4940555d359cd898a4155bd..56c64c14c9b0f81b4736e56fefb5e32991bce719 100644 (file)
@@ -298,7 +298,7 @@ static void hdmi_connector_destroy(struct drm_connector *connector)
 
        hdp_disable(hdmi_connector);
 
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 
        hdmi_unreference(hdmi_connector->hdmi);
@@ -408,7 +408,7 @@ struct drm_connector *hdmi_connector_init(struct hdmi *hdmi)
        connector->interlace_allowed = 1;
        connector->doublescan_allowed = 0;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        ret = hpd_enable(hdmi_connector);
        if (ret) {
index 1fa222e8f007ba5e0b8f94a8bfcf911bee34a49d..680f46d007a00bb94fc6edbc986b855a0d1dc95e 100644 (file)
@@ -104,7 +104,7 @@ nouveau_connector_destroy(struct drm_connector *connector)
        struct nouveau_connector *nv_connector = nouveau_connector(connector);
        nouveau_event_ref(NULL, &nv_connector->hpd);
        kfree(nv_connector->edid);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        if (nv_connector->aux.transfer)
                drm_dp_aux_unregister(&nv_connector->aux);
@@ -1236,6 +1236,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
 
        INIT_WORK(&nv_connector->work, nouveau_connector_hotplug_work);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return connector;
 }
index 86f4ead0441d0d2b6e27f8441974f14dd68ed801..36bc5cc8081606e04535ef34201a31e0021ab1f9 100644 (file)
@@ -130,7 +130,7 @@ static void omap_connector_destroy(struct drm_connector *connector)
        struct omap_dss_device *dssdev = omap_connector->dssdev;
 
        DBG("%s", omap_connector->dssdev->name);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(omap_connector);
 
@@ -307,7 +307,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
        connector->interlace_allowed = 1;
        connector->doublescan_allowed = 0;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        return connector;
 
index 5d7ea24618524bc0c23187a2b58e551eb96cdbc9..b8ced08b62916b643436375aa853a82c2560a947 100644 (file)
@@ -835,7 +835,7 @@ static void qxl_conn_destroy(struct drm_connector *connector)
        struct qxl_output *qxl_output =
                drm_connector_to_qxl_output(connector);
 
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(qxl_output);
 }
@@ -902,7 +902,7 @@ static int qdev_output_init(struct drm_device *dev, int num_output)
 
        drm_object_attach_property(&connector->base,
                                   qdev->hotplug_mode_update_property, 0);
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        return 0;
 }
 
index 933c5c39654d2d054a9271f5b780e3ec45b6f13b..5b1a611c30eb10be6fee4df028c83a2c8cfa05a4 100644 (file)
@@ -737,7 +737,7 @@ static void radeon_connector_destroy(struct drm_connector *connector)
        if (radeon_connector->edid)
                kfree(radeon_connector->edid);
        kfree(radeon_connector->con_priv);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -2038,7 +2038,7 @@ radeon_add_atom_connector(struct drm_device *dev,
                connector->polled = DRM_CONNECTOR_POLL_HPD;
 
        connector->display_info.subpixel_order = subpixel_order;
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        if (has_aux)
                radeon_dp_aux_init(radeon_connector);
@@ -2199,5 +2199,5 @@ radeon_add_legacy_connector(struct drm_device *dev,
        } else
                connector->polled = DRM_CONNECTOR_POLL_HPD;
        connector->display_info.subpixel_order = subpixel_order;
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 }
index 289048d1c7b2fd590e20eb2425266b758fbfbd88..21426bd234eb1d24ac2038e8ed58fd813ac61990 100644 (file)
@@ -64,7 +64,7 @@ static const struct drm_connector_helper_funcs connector_helper_funcs = {
 
 static void rcar_du_lvds_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 
@@ -105,7 +105,7 @@ int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
                return ret;
 
        drm_connector_helper_add(connector, &connector_helper_funcs);
-       ret = drm_sysfs_connector_add(connector);
+       ret = drm_connector_register(connector);
        if (ret < 0)
                return ret;
 
index ccfe64c7188fa902750a2fa9a05be5045baa7397..8af3944d31b9a3900afd3b86ec73b86e470a5d3c 100644 (file)
@@ -32,7 +32,7 @@ static const struct drm_connector_helper_funcs connector_helper_funcs = {
 
 static void rcar_du_vga_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 
@@ -70,7 +70,7 @@ int rcar_du_vga_connector_init(struct rcar_du_device *rcdu,
                return ret;
 
        drm_connector_helper_add(connector, &connector_helper_funcs);
-       ret = drm_sysfs_connector_add(connector);
+       ret = drm_connector_register(connector);
        if (ret < 0)
                return ret;
 
index faf176b2daf99ae628a16c862581d65b90a02943..47875de89010d7a29a5b62e3752ec40d4c201b2c 100644 (file)
@@ -692,7 +692,7 @@ static void shmob_drm_connector_destroy(struct drm_connector *connector)
        struct shmob_drm_connector *scon = to_shmob_connector(connector);
 
        shmob_drm_backlight_exit(scon);
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 
@@ -726,7 +726,7 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
                return ret;
 
        drm_connector_helper_add(connector, &connector_helper_funcs);
-       ret = drm_sysfs_connector_add(connector);
+       ret = drm_connector_register(connector);
        if (ret < 0)
                goto err_cleanup;
 
@@ -749,7 +749,7 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
 err_backlight:
        shmob_drm_backlight_exit(&sdev->connector);
 err_sysfs:
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
 err_cleanup:
        drm_connector_cleanup(connector);
        return ret;
index a3e4f1eca6f7b479796889498906c259d3faa882..446837e955b6f19e02118145b921d20f07cc759b 100644 (file)
@@ -105,7 +105,7 @@ static void drm_connector_clear(struct drm_connector *connector)
 
 static void tegra_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        drm_connector_clear(connector);
 }
@@ -318,7 +318,7 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
        drm_encoder_helper_add(&output->encoder, &encoder_helper_funcs);
 
        drm_mode_connector_attach_encoder(&output->connector, &output->encoder);
-       drm_sysfs_connector_add(&output->connector);
+       drm_connector_register(&output->connector);
 
        output->encoder.possible_crtcs = 0x3;
 
index 86c67329b6051e0a4f97b457022a1354925d1284..0c0bce7e90075d96ac1b5c43efafde723119568d 100644 (file)
@@ -247,7 +247,7 @@ static struct drm_connector *panel_connector_create(struct drm_device *dev,
        if (ret)
                goto fail;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        return connector;
 
index 595068ba2d5ed2322415f0ce1eb78c9b09817917..c578d144ce6d2cdd51e82355a88b605b035f92ff 100644 (file)
@@ -261,7 +261,7 @@ static struct drm_connector *slave_connector_create(struct drm_device *dev,
        if (ret)
                goto fail;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        return connector;
 
index c38b56b268ac0d8ba61a8826d13ad435f9f59fb7..5324dfd0b5ed269a7643d800fe8415425be36984 100644 (file)
@@ -261,7 +261,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev,
        if (ret)
                goto fail;
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
 
        return connector;
 
index b44d548c56f8e43a3e14878622c8f8ed3507bf35..dea38ab6c47d1a50761dc2d5911a76d7fae6e09f 100644 (file)
@@ -124,7 +124,7 @@ static int udl_connector_set_property(struct drm_connector *connector,
 
 static void udl_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
        kfree(connector);
 }
@@ -154,7 +154,7 @@ int udl_connector_init(struct drm_device *dev, struct drm_encoder *encoder)
        drm_connector_init(dev, connector, &udl_connector_funcs, DRM_MODE_CONNECTOR_DVII);
        drm_connector_helper_add(connector, &udl_connector_helper_funcs);
 
-       drm_sysfs_connector_add(connector);
+       drm_connector_register(connector);
        drm_mode_connector_attach_encoder(connector, encoder);
 
        drm_object_attach_property(&connector->base,
index 8f3edc4710f2869344fec29c6366caa2a1d77dc2..1a024e3b7285e2e55d68ca92fca7c533b48fda69 100644 (file)
@@ -75,7 +75,7 @@ void vmw_display_unit_cleanup(struct vmw_display_unit *du)
                vmw_surface_unreference(&du->cursor_surface);
        if (du->cursor_dmabuf)
                vmw_dmabuf_unreference(&du->cursor_dmabuf);
-       drm_sysfs_connector_remove(&du->connector);
+       drm_connector_unregister(&du->connector);
        drm_crtc_cleanup(&du->crtc);
        drm_encoder_cleanup(&du->encoder);
        drm_connector_cleanup(&du->connector);
index b2b9bd23aeee620fee8610c490e41a6ef297997e..15e185ae4c990788af33b20b5a63042638f67ef2 100644 (file)
@@ -371,7 +371,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
        encoder->possible_crtcs = (1 << unit);
        encoder->possible_clones = 0;
 
-       (void) drm_sysfs_connector_add(connector);
+       (void) drm_connector_register(connector);
 
        drm_crtc_init(dev, crtc, &vmw_legacy_crtc_funcs);
 
index a95d3a0cabe448672237b3c42bc8b182272effeb..b295463a60b3828686fb49b58d07b011ec38bdbe 100644 (file)
@@ -467,7 +467,7 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
        encoder->possible_crtcs = (1 << unit);
        encoder->possible_clones = 0;
 
-       (void) drm_sysfs_connector_add(connector);
+       (void) drm_connector_register(connector);
 
        drm_crtc_init(dev, crtc, &vmw_screen_object_crtc_funcs);
 
index def8280d7ee664ba949ae2b2157d1d6bfefddd23..6f54ff4f937277e37af48ba63796b4d9c605609f 100644 (file)
@@ -202,7 +202,7 @@ static const struct file_operations imx_drm_driver_fops = {
 
 void imx_drm_connector_destroy(struct drm_connector *connector)
 {
-       drm_sysfs_connector_remove(connector);
+       drm_connector_unregister(connector);
        drm_connector_cleanup(connector);
 }
 EXPORT_SYMBOL_GPL(imx_drm_connector_destroy);
@@ -293,10 +293,10 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
         * userspace will expect to be able to access DRM at this point.
         */
        list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
-               ret = drm_sysfs_connector_add(connector);
+               ret = drm_connector_register(connector);
                if (ret) {
                        dev_err(drm->dev,
-                               "[CONNECTOR:%d:%s] drm_sysfs_connector_add failed: %d\n",
+                               "[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
                                connector->base.id,
                                connector->name, ret);
                        goto err_unbind;
index 251b75e6bf7a173243a9623d8a013e8606c6ae62..5512c9968d77a31cf5cad7025078173f629fead5 100644 (file)
@@ -878,6 +878,8 @@ extern int drm_connector_init(struct drm_device *dev,
                              struct drm_connector *connector,
                              const struct drm_connector_funcs *funcs,
                              int connector_type);
+int drm_connector_register(struct drm_connector *connector);
+void drm_connector_unregister(struct drm_connector *connector);
 
 extern void drm_connector_cleanup(struct drm_connector *connector);
 /* helper to unplug all connectors from sysfs for device */