aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2014-05-29 11:57:41 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-19 02:55:28 -0400
commit34ea3d386347cd6de4c2fa2491dd85c9e753e7e4 (patch)
tree8f8f3af34e12d01b95ad15b7f0d065fe17cbd504
parentc3e25ae34fab3557b17a585446b5576e49d2f203 (diff)
drm: add register and unregister functions for connectors
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>
-rw-r--r--Documentation/DocBook/drm.tmpl6
-rw-r--r--drivers/gpu/drm/armada/armada_output.c4
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c4
-rw-r--r--drivers/gpu/drm/bridge/ptn3460.c2
-rw-r--r--drivers/gpu/drm/drm_crtc.c30
-rw-r--r--drivers/gpu/drm/drm_sysfs.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_dp_core.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_connector.c6
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dpi.c4
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c2
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c2
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_crt.c4
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_dp.c4
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_hdmi.c4
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_lvds.c4
-rw-r--r--drivers/gpu/drm/gma500/mdfld_dsi_output.c4
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_hdmi.c2
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_lvds.c2
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_lvds.c4
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_sdvo.c4
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c4
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c2
-rw-r--r--drivers/gpu/drm/i915/intel_dvo.c2
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c2
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c2
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c10
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c2
-rw-r--r--drivers/gpu/drm/msm/hdmi/hdmi_connector.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c4
-rw-r--r--drivers/gpu/drm/omapdrm/omap_connector.c4
-rw-r--r--drivers/gpu/drm/qxl/qxl_display.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c6
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c4
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_vgacon.c4
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_crtc.c6
-rw-r--r--drivers/gpu/drm/tegra/output.c4
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_panel.c2
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_slave.c2
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_tfp410.c2
-rw-r--r--drivers/gpu/drm/udl/udl_connector.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c2
-rw-r--r--drivers/staging/imx-drm/imx-drm-core.c6
-rw-r--r--include/drm/drm_crtc.h2
49 files changed, 110 insertions, 82 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index 7df3134ebc0e..b314a42bb18c 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -1610,7 +1610,7 @@ int max_width, max_height;</synopsis>
1610 The connector is then registered with a call to 1610 The connector is then registered with a call to
1611 <function>drm_connector_init</function> with a pointer to the connector 1611 <function>drm_connector_init</function> with a pointer to the connector
1612 functions and a connector type, and exposed through sysfs with a call to 1612 functions and a connector type, and exposed through sysfs with a call to
1613 <function>drm_sysfs_connector_add</function>. 1613 <function>drm_connector_register</function>.
1614 </para> 1614 </para>
1615 <para> 1615 <para>
1616 Supported connector types are 1616 Supported connector types are
@@ -1768,7 +1768,7 @@ int max_width, max_height;</synopsis>
1768 (<function>drm_encoder_cleanup</function>) and connectors 1768 (<function>drm_encoder_cleanup</function>) and connectors
1769 (<function>drm_connector_cleanup</function>). Furthermore, connectors 1769 (<function>drm_connector_cleanup</function>). Furthermore, connectors
1770 that have been added to sysfs must be removed by a call to 1770 that have been added to sysfs must be removed by a call to
1771 <function>drm_sysfs_connector_remove</function> before calling 1771 <function>drm_connector_unregister</function> before calling
1772 <function>drm_connector_cleanup</function>. 1772 <function>drm_connector_cleanup</function>.
1773 </para> 1773 </para>
1774 <para> 1774 <para>
@@ -1813,7 +1813,7 @@ void intel_crt_init(struct drm_device *dev)
1813 drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs); 1813 drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
1814 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); 1814 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
1815 1815
1816 drm_sysfs_connector_add(connector); 1816 drm_connector_register(connector);
1817}]]></programlisting> 1817}]]></programlisting>
1818 <para> 1818 <para>
1819 In the example above (taken from the i915 driver), a CRTC, connector and 1819 In the example above (taken from the i915 driver), a CRTC, connector and
diff --git a/drivers/gpu/drm/armada/armada_output.c b/drivers/gpu/drm/armada/armada_output.c
index d685a5421485..abbc309fe539 100644
--- a/drivers/gpu/drm/armada/armada_output.c
+++ b/drivers/gpu/drm/armada/armada_output.c
@@ -48,7 +48,7 @@ static void armada_drm_connector_destroy(struct drm_connector *conn)
48{ 48{
49 struct armada_connector *dconn = drm_to_armada_conn(conn); 49 struct armada_connector *dconn = drm_to_armada_conn(conn);
50 50
51 drm_sysfs_connector_remove(conn); 51 drm_connector_unregister(conn);
52 drm_connector_cleanup(conn); 52 drm_connector_cleanup(conn);
53 kfree(dconn); 53 kfree(dconn);
54} 54}
@@ -141,7 +141,7 @@ int armada_output_create(struct drm_device *dev,
141 if (ret) 141 if (ret)
142 goto err_conn; 142 goto err_conn;
143 143
144 ret = drm_sysfs_connector_add(&dconn->conn); 144 ret = drm_connector_register(&dconn->conn);
145 if (ret) 145 if (ret)
146 goto err_sysfs; 146 goto err_sysfs;
147 147
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 114aee941d46..9896286ed262 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -829,7 +829,7 @@ static void ast_connector_destroy(struct drm_connector *connector)
829{ 829{
830 struct ast_connector *ast_connector = to_ast_connector(connector); 830 struct ast_connector *ast_connector = to_ast_connector(connector);
831 ast_i2c_destroy(ast_connector->i2c); 831 ast_i2c_destroy(ast_connector->i2c);
832 drm_sysfs_connector_remove(connector); 832 drm_connector_unregister(connector);
833 drm_connector_cleanup(connector); 833 drm_connector_cleanup(connector);
834 kfree(connector); 834 kfree(connector);
835} 835}
@@ -871,7 +871,7 @@ static int ast_connector_init(struct drm_device *dev)
871 connector->interlace_allowed = 0; 871 connector->interlace_allowed = 0;
872 connector->doublescan_allowed = 0; 872 connector->doublescan_allowed = 0;
873 873
874 drm_sysfs_connector_add(connector); 874 drm_connector_register(connector);
875 875
876 connector->polled = DRM_CONNECTOR_POLL_CONNECT; 876 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
877 877
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index 98fd17ae4916..d466696ed5e8 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -328,7 +328,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder,
328 } 328 }
329 drm_connector_helper_add(&ptn_bridge->connector, 329 drm_connector_helper_add(&ptn_bridge->connector,
330 &ptn3460_connector_helper_funcs); 330 &ptn3460_connector_helper_funcs);
331 drm_sysfs_connector_add(&ptn_bridge->connector); 331 drm_connector_register(&ptn_bridge->connector);
332 drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder); 332 drm_mode_connector_attach_encoder(&ptn_bridge->connector, encoder);
333 333
334 return 0; 334 return 0;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index fe94cc10cd35..c50c827cefb6 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -921,6 +921,34 @@ void drm_connector_cleanup(struct drm_connector *connector)
921EXPORT_SYMBOL(drm_connector_cleanup); 921EXPORT_SYMBOL(drm_connector_cleanup);
922 922
923/** 923/**
924 * drm_connector_register - register a connector
925 * @connector: the connector to register
926 *
927 * Register userspace interfaces for a connector
928 *
929 * Returns:
930 * Zero on success, error code on failure.
931 */
932int drm_connector_register(struct drm_connector *connector)
933{
934 return drm_sysfs_connector_add(connector);
935}
936EXPORT_SYMBOL(drm_connector_register);
937
938/**
939 * drm_connector_unregister - unregister a connector
940 * @connector: the connector to unregister
941 *
942 * Unregister userspace interfaces for a connector
943 */
944void drm_connector_unregister(struct drm_connector *connector)
945{
946 drm_sysfs_connector_remove(connector);
947}
948EXPORT_SYMBOL(drm_connector_unregister);
949
950
951/**
924 * drm_connector_unplug_all - unregister connector userspace interfaces 952 * drm_connector_unplug_all - unregister connector userspace interfaces
925 * @dev: drm device 953 * @dev: drm device
926 * 954 *
@@ -934,7 +962,7 @@ void drm_connector_unplug_all(struct drm_device *dev)
934 962
935 /* taking the mode config mutex ends up in a clash with sysfs */ 963 /* taking the mode config mutex ends up in a clash with sysfs */
936 list_for_each_entry(connector, &dev->mode_config.connector_list, head) 964 list_for_each_entry(connector, &dev->mode_config.connector_list, head)
937 drm_sysfs_connector_remove(connector); 965 drm_connector_unregister(connector);
938 966
939} 967}
940EXPORT_SYMBOL(drm_connector_unplug_all); 968EXPORT_SYMBOL(drm_connector_unplug_all);
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 369b26278e76..7827dad8fcf4 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -438,7 +438,6 @@ err_out_files:
438out: 438out:
439 return ret; 439 return ret;
440} 440}
441EXPORT_SYMBOL(drm_sysfs_connector_add);
442 441
443/** 442/**
444 * drm_sysfs_connector_remove - remove an connector device from sysfs 443 * drm_sysfs_connector_remove - remove an connector device from sysfs
@@ -468,7 +467,6 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
468 device_unregister(connector->kdev); 467 device_unregister(connector->kdev);
469 connector->kdev = NULL; 468 connector->kdev = NULL;
470} 469}
471EXPORT_SYMBOL(drm_sysfs_connector_remove);
472 470
473/** 471/**
474 * drm_sysfs_hotplug_event - generate a DRM uevent 472 * drm_sysfs_hotplug_event - generate a DRM uevent
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
index a8ffc8c1477b..86dc69d9eabb 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -1018,7 +1018,7 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,
1018 } 1018 }
1019 1019
1020 drm_connector_helper_add(connector, &exynos_dp_connector_helper_funcs); 1020 drm_connector_helper_add(connector, &exynos_dp_connector_helper_funcs);
1021 drm_sysfs_connector_add(connector); 1021 drm_connector_register(connector);
1022 drm_mode_connector_attach_encoder(connector, encoder); 1022 drm_mode_connector_attach_encoder(connector, encoder);
1023 1023
1024 return 0; 1024 return 0;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index 9a16dbe121d1..25c788832e2e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -185,7 +185,7 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector)
185 struct exynos_drm_connector *exynos_connector = 185 struct exynos_drm_connector *exynos_connector =
186 to_exynos_connector(connector); 186 to_exynos_connector(connector);
187 187
188 drm_sysfs_connector_remove(connector); 188 drm_connector_unregister(connector);
189 drm_connector_cleanup(connector); 189 drm_connector_cleanup(connector);
190 kfree(exynos_connector); 190 kfree(exynos_connector);
191} 191}
@@ -230,7 +230,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
230 drm_connector_init(dev, connector, &exynos_connector_funcs, type); 230 drm_connector_init(dev, connector, &exynos_connector_funcs, type);
231 drm_connector_helper_add(connector, &exynos_connector_helper_funcs); 231 drm_connector_helper_add(connector, &exynos_connector_helper_funcs);
232 232
233 err = drm_sysfs_connector_add(connector); 233 err = drm_connector_register(connector);
234 if (err) 234 if (err)
235 goto err_connector; 235 goto err_connector;
236 236
@@ -250,7 +250,7 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
250 return connector; 250 return connector;
251 251
252err_sysfs: 252err_sysfs:
253 drm_sysfs_connector_remove(connector); 253 drm_connector_unregister(connector);
254err_connector: 254err_connector:
255 drm_connector_cleanup(connector); 255 drm_connector_cleanup(connector);
256 kfree(exynos_connector); 256 kfree(exynos_connector);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
index 482127f633c5..4693531ebd48 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
@@ -48,7 +48,7 @@ exynos_dpi_detect(struct drm_connector *connector, bool force)
48 48
49static void exynos_dpi_connector_destroy(struct drm_connector *connector) 49static void exynos_dpi_connector_destroy(struct drm_connector *connector)
50{ 50{
51 drm_sysfs_connector_remove(connector); 51 drm_connector_unregister(connector);
52 drm_connector_cleanup(connector); 52 drm_connector_cleanup(connector);
53} 53}
54 54
@@ -117,7 +117,7 @@ static int exynos_dpi_create_connector(struct exynos_drm_display *display,
117 } 117 }
118 118
119 drm_connector_helper_add(connector, &exynos_dpi_connector_helper_funcs); 119 drm_connector_helper_add(connector, &exynos_dpi_connector_helper_funcs);
120 drm_sysfs_connector_add(connector); 120 drm_connector_register(connector);
121 drm_mode_connector_attach_encoder(connector, encoder); 121 drm_mode_connector_attach_encoder(connector, encoder);
122 122
123 return 0; 123 return 0;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 6302aa64f6c1..2df3592166de 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1246,7 +1246,7 @@ static int exynos_dsi_create_connector(struct exynos_drm_display *display,
1246 } 1246 }
1247 1247
1248 drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs); 1248 drm_connector_helper_add(connector, &exynos_dsi_connector_helper_funcs);
1249 drm_sysfs_connector_add(connector); 1249 drm_connector_register(connector);
1250 drm_mode_connector_attach_encoder(connector, encoder); 1250 drm_mode_connector_attach_encoder(connector, encoder);
1251 1251
1252 return 0; 1252 return 0;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 2fb8705d6461..9528d81d8004 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -562,7 +562,7 @@ static int vidi_create_connector(struct exynos_drm_display *display,
562 } 562 }
563 563
564 drm_connector_helper_add(connector, &vidi_connector_helper_funcs); 564 drm_connector_helper_add(connector, &vidi_connector_helper_funcs);
565 drm_sysfs_connector_add(connector); 565 drm_connector_register(connector);
566 drm_mode_connector_attach_encoder(connector, encoder); 566 drm_mode_connector_attach_encoder(connector, encoder);
567 567
568 return 0; 568 return 0;
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index c104d0c9b385..dd565c4e5b4d 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1129,7 +1129,7 @@ static int hdmi_create_connector(struct exynos_drm_display *display,
1129 } 1129 }
1130 1130
1131 drm_connector_helper_add(connector, &hdmi_connector_helper_funcs); 1131 drm_connector_helper_add(connector, &hdmi_connector_helper_funcs);
1132 drm_sysfs_connector_add(connector); 1132 drm_connector_register(connector);
1133 drm_mode_connector_attach_encoder(connector, encoder); 1133 drm_mode_connector_attach_encoder(connector, encoder);
1134 1134
1135 return 0; 1135 return 0;
diff --git a/drivers/gpu/drm/gma500/cdv_intel_crt.c b/drivers/gpu/drm/gma500/cdv_intel_crt.c
index c18268cd516e..248c33a35ebf 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_crt.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_crt.c
@@ -192,7 +192,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
192 struct gma_encoder *gma_encoder = gma_attached_encoder(connector); 192 struct gma_encoder *gma_encoder = gma_attached_encoder(connector);
193 193
194 psb_intel_i2c_destroy(gma_encoder->ddc_bus); 194 psb_intel_i2c_destroy(gma_encoder->ddc_bus);
195 drm_sysfs_connector_remove(connector); 195 drm_connector_unregister(connector);
196 drm_connector_cleanup(connector); 196 drm_connector_cleanup(connector);
197 kfree(connector); 197 kfree(connector);
198} 198}
@@ -304,7 +304,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
304 drm_connector_helper_add(connector, 304 drm_connector_helper_add(connector,
305 &cdv_intel_crt_connector_helper_funcs); 305 &cdv_intel_crt_connector_helper_funcs);
306 306
307 drm_sysfs_connector_add(connector); 307 drm_connector_register(connector);
308 308
309 return; 309 return;
310failed_ddc: 310failed_ddc:
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index 9ff30c2efadb..a4cc0e60a1be 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -1713,7 +1713,7 @@ cdv_intel_dp_destroy(struct drm_connector *connector)
1713 } 1713 }
1714 } 1714 }
1715 i2c_del_adapter(&intel_dp->adapter); 1715 i2c_del_adapter(&intel_dp->adapter);
1716 drm_sysfs_connector_remove(connector); 1716 drm_connector_unregister(connector);
1717 drm_connector_cleanup(connector); 1717 drm_connector_cleanup(connector);
1718 kfree(connector); 1718 kfree(connector);
1719} 1719}
@@ -1847,7 +1847,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
1847 connector->interlace_allowed = false; 1847 connector->interlace_allowed = false;
1848 connector->doublescan_allowed = false; 1848 connector->doublescan_allowed = false;
1849 1849
1850 drm_sysfs_connector_add(connector); 1850 drm_connector_register(connector);
1851 1851
1852 /* Set up the DDC bus. */ 1852 /* Set up the DDC bus. */
1853 switch (output_reg) { 1853 switch (output_reg) {
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index b99084b3f706..4268bf210034 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -248,7 +248,7 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
248 248
249 if (gma_encoder->i2c_bus) 249 if (gma_encoder->i2c_bus)
250 psb_intel_i2c_destroy(gma_encoder->i2c_bus); 250 psb_intel_i2c_destroy(gma_encoder->i2c_bus);
251 drm_sysfs_connector_remove(connector); 251 drm_connector_unregister(connector);
252 drm_connector_cleanup(connector); 252 drm_connector_cleanup(connector);
253 kfree(connector); 253 kfree(connector);
254} 254}
@@ -356,7 +356,7 @@ void cdv_hdmi_init(struct drm_device *dev,
356 356
357 hdmi_priv->hdmi_i2c_adapter = &(gma_encoder->i2c_bus->adapter); 357 hdmi_priv->hdmi_i2c_adapter = &(gma_encoder->i2c_bus->adapter);
358 hdmi_priv->dev = dev; 358 hdmi_priv->dev = dev;
359 drm_sysfs_connector_add(connector); 359 drm_connector_register(connector);
360 return; 360 return;
361 361
362failed_ddc: 362failed_ddc:
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 8ecc920fc26d..0b770396548c 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -446,7 +446,7 @@ static void cdv_intel_lvds_destroy(struct drm_connector *connector)
446 446
447 if (gma_encoder->i2c_bus) 447 if (gma_encoder->i2c_bus)
448 psb_intel_i2c_destroy(gma_encoder->i2c_bus); 448 psb_intel_i2c_destroy(gma_encoder->i2c_bus);
449 drm_sysfs_connector_remove(connector); 449 drm_connector_unregister(connector);
450 drm_connector_cleanup(connector); 450 drm_connector_cleanup(connector);
451 kfree(connector); 451 kfree(connector);
452} 452}
@@ -774,7 +774,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
774 774
775out: 775out:
776 mutex_unlock(&dev->mode_config.mutex); 776 mutex_unlock(&dev->mode_config.mutex);
777 drm_sysfs_connector_add(connector); 777 drm_connector_register(connector);
778 return; 778 return;
779 779
780failed_find: 780failed_find:
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 6e91b20ce2e5..abf2248da61e 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -318,7 +318,7 @@ static void mdfld_dsi_connector_destroy(struct drm_connector *connector)
318 318
319 if (!dsi_connector) 319 if (!dsi_connector)
320 return; 320 return;
321 drm_sysfs_connector_remove(connector); 321 drm_connector_unregister(connector);
322 drm_connector_cleanup(connector); 322 drm_connector_cleanup(connector);
323 sender = dsi_connector->pkg_sender; 323 sender = dsi_connector->pkg_sender;
324 mdfld_dsi_pkg_sender_destroy(sender); 324 mdfld_dsi_pkg_sender_destroy(sender);
@@ -597,7 +597,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
597 dsi_config->encoder = encoder; 597 dsi_config->encoder = encoder;
598 encoder->base.type = (pipe == 0) ? INTEL_OUTPUT_MIPI : 598 encoder->base.type = (pipe == 0) ? INTEL_OUTPUT_MIPI :
599 INTEL_OUTPUT_MIPI2; 599 INTEL_OUTPUT_MIPI2;
600 drm_sysfs_connector_add(connector); 600 drm_connector_register(connector);
601 return; 601 return;
602 602
603 /*TODO: add code to destroy outputs on error*/ 603 /*TODO: add code to destroy outputs on error*/
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
index cf018ddcc5a6..e6f5c620a0a2 100644
--- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
@@ -665,7 +665,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
665 connector->display_info.subpixel_order = SubPixelHorizontalRGB; 665 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
666 connector->interlace_allowed = false; 666 connector->interlace_allowed = false;
667 connector->doublescan_allowed = false; 667 connector->doublescan_allowed = false;
668 drm_sysfs_connector_add(connector); 668 drm_connector_register(connector);
669 dev_info(dev->dev, "HDMI initialised.\n"); 669 dev_info(dev->dev, "HDMI initialised.\n");
670 670
671 return; 671 return;
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index 9b099468a5db..0d39da6e8b7a 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -404,7 +404,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
404out: 404out:
405 mutex_unlock(&dev->mode_config.mutex); 405 mutex_unlock(&dev->mode_config.mutex);
406 406
407 drm_sysfs_connector_add(connector); 407 drm_connector_register(connector);
408 return; 408 return;
409 409
410failed_find: 410failed_find:
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index d7778d0472c1..88aad95bde09 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -563,7 +563,7 @@ void psb_intel_lvds_destroy(struct drm_connector *connector)
563 563
564 if (lvds_priv->ddc_bus) 564 if (lvds_priv->ddc_bus)
565 psb_intel_i2c_destroy(lvds_priv->ddc_bus); 565 psb_intel_i2c_destroy(lvds_priv->ddc_bus);
566 drm_sysfs_connector_remove(connector); 566 drm_connector_unregister(connector);
567 drm_connector_cleanup(connector); 567 drm_connector_cleanup(connector);
568 kfree(connector); 568 kfree(connector);
569} 569}
@@ -829,7 +829,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
829 */ 829 */
830out: 830out:
831 mutex_unlock(&dev->mode_config.mutex); 831 mutex_unlock(&dev->mode_config.mutex);
832 drm_sysfs_connector_add(connector); 832 drm_connector_register(connector);
833 return; 833 return;
834 834
835failed_find: 835failed_find:
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index deeb0829b129..0be96fdb5e28 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -1682,7 +1682,7 @@ static void psb_intel_sdvo_destroy(struct drm_connector *connector)
1682 psb_intel_sdvo_connector->tv_format); 1682 psb_intel_sdvo_connector->tv_format);
1683 1683
1684 psb_intel_sdvo_destroy_enhance_property(connector); 1684 psb_intel_sdvo_destroy_enhance_property(connector);
1685 drm_sysfs_connector_remove(connector); 1685 drm_connector_unregister(connector);
1686 drm_connector_cleanup(connector); 1686 drm_connector_cleanup(connector);
1687 kfree(connector); 1687 kfree(connector);
1688} 1688}
@@ -2071,7 +2071,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
2071 connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB; 2071 connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
2072 2072
2073 gma_connector_attach_encoder(&connector->base, &encoder->base); 2073 gma_connector_attach_encoder(&connector->base, &encoder->base);
2074 drm_sysfs_connector_add(&connector->base.base); 2074 drm_connector_register(&connector->base.base);
2075} 2075}
2076 2076
2077static void 2077static void
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 5a045d3bd77e..8da5ef9f4828 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -869,7 +869,7 @@ void intel_crt_init(struct drm_device *dev)
869 869
870 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs); 870 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
871 871
872 drm_sysfs_connector_add(connector); 872 drm_connector_register(connector);
873 873
874 if (!I915_HAS_HOTPLUG(dev)) 874 if (!I915_HAS_HOTPLUG(dev))
875 intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT; 875 intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index efd3cf50cb0f..dbabaec6ae2d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12234,7 +12234,7 @@ void intel_connector_unregister(struct intel_connector *intel_connector)
12234 struct drm_connector *connector = &intel_connector->base; 12234 struct drm_connector *connector = &intel_connector->base;
12235 12235
12236 intel_panel_destroy_backlight(connector); 12236 intel_panel_destroy_backlight(connector);
12237 drm_sysfs_connector_remove(connector); 12237 drm_connector_unregister(connector);
12238} 12238}
12239 12239
12240void intel_modeset_cleanup(struct drm_device *dev) 12240void intel_modeset_cleanup(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 52fda950fd2a..99f033f69189 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4246,7 +4246,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
4246 edp_panel_vdd_work); 4246 edp_panel_vdd_work);
4247 4247
4248 intel_connector_attach_encoder(intel_connector, intel_encoder); 4248 intel_connector_attach_encoder(intel_connector, intel_encoder);
4249 drm_sysfs_connector_add(connector); 4249 drm_connector_register(connector);
4250 4250
4251 if (HAS_DDI(dev)) 4251 if (HAS_DDI(dev))
4252 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; 4252 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,
4289 edp_panel_vdd_off_sync(intel_dp); 4289 edp_panel_vdd_off_sync(intel_dp);
4290 drm_modeset_unlock(&dev->mode_config.connection_mutex); 4290 drm_modeset_unlock(&dev->mode_config.connection_mutex);
4291 } 4291 }
4292 drm_sysfs_connector_remove(connector); 4292 drm_connector_unregister(connector);
4293 drm_connector_cleanup(connector); 4293 drm_connector_cleanup(connector);
4294 return false; 4294 return false;
4295 } 4295 }
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 02f99d768d49..7c07ee07a8ee 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -742,7 +742,7 @@ bool intel_dsi_init(struct drm_device *dev)
742 742
743 intel_connector_attach_encoder(intel_connector, intel_encoder); 743 intel_connector_attach_encoder(intel_connector, intel_encoder);
744 744
745 drm_sysfs_connector_add(connector); 745 drm_connector_register(connector);
746 746
747 fixed_mode = dsi->dev_ops->get_modes(&intel_dsi->dev); 747 fixed_mode = dsi->dev_ops->get_modes(&intel_dsi->dev);
748 if (!fixed_mode) { 748 if (!fixed_mode) {
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index a3631c0a5c28..3fb71a04e14f 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -558,7 +558,7 @@ void intel_dvo_init(struct drm_device *dev)
558 intel_dvo->panel_wants_dither = true; 558 intel_dvo->panel_wants_dither = true;
559 } 559 }
560 560
561 drm_sysfs_connector_add(connector); 561 drm_connector_register(connector);
562 return; 562 return;
563 } 563 }
564 564
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index eee2bbec2958..0b603102cb3b 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1490,7 +1490,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1490 intel_hdmi_add_properties(intel_hdmi, connector); 1490 intel_hdmi_add_properties(intel_hdmi, connector);
1491 1491
1492 intel_connector_attach_encoder(intel_connector, intel_encoder); 1492 intel_connector_attach_encoder(intel_connector, intel_encoder);
1493 drm_sysfs_connector_add(connector); 1493 drm_connector_register(connector);
1494 1494
1495 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written 1495 /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written
1496 * 0xd. Failure to do so will result in spurious interrupts being 1496 * 0xd. Failure to do so will result in spurious interrupts being
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 23126023aeba..4d29a83fd163 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -1097,7 +1097,7 @@ out:
1097 DRM_DEBUG_KMS("lid notifier registration failed\n"); 1097 DRM_DEBUG_KMS("lid notifier registration failed\n");
1098 lvds_connector->lid_notifier.notifier_call = NULL; 1098 lvds_connector->lid_notifier.notifier_call = NULL;
1099 } 1099 }
1100 drm_sysfs_connector_add(connector); 1100 drm_connector_register(connector);
1101 1101
1102 intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode); 1102 intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
1103 intel_panel_setup_backlight(connector); 1103 intel_panel_setup_backlight(connector);
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 6a4d5bc17697..e0be8ae75c15 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2431,7 +2431,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
2431 connector->base.unregister = intel_sdvo_connector_unregister; 2431 connector->base.unregister = intel_sdvo_connector_unregister;
2432 2432
2433 intel_connector_attach_encoder(&connector->base, &encoder->base); 2433 intel_connector_attach_encoder(&connector->base, &encoder->base);
2434 ret = drm_sysfs_connector_add(drm_connector); 2434 ret = drm_connector_register(drm_connector);
2435 if (ret < 0) 2435 if (ret < 0)
2436 goto err1; 2436 goto err1;
2437 2437
@@ -2444,7 +2444,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
2444 return 0; 2444 return 0;
2445 2445
2446err2: 2446err2:
2447 drm_sysfs_connector_remove(drm_connector); 2447 drm_connector_unregister(drm_connector);
2448err1: 2448err1:
2449 drm_connector_cleanup(drm_connector); 2449 drm_connector_cleanup(drm_connector);
2450 2450
@@ -2557,7 +2557,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
2557 return true; 2557 return true;
2558 2558
2559err: 2559err:
2560 drm_sysfs_connector_remove(connector); 2560 drm_connector_unregister(connector);
2561 intel_sdvo_destroy(connector); 2561 intel_sdvo_destroy(connector);
2562 return false; 2562 return false;
2563} 2563}
@@ -2636,7 +2636,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
2636 return true; 2636 return true;
2637 2637
2638err: 2638err:
2639 drm_sysfs_connector_remove(connector); 2639 drm_connector_unregister(connector);
2640 intel_sdvo_destroy(connector); 2640 intel_sdvo_destroy(connector);
2641 return false; 2641 return false;
2642} 2642}
@@ -2709,7 +2709,7 @@ static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
2709 list_for_each_entry_safe(connector, tmp, 2709 list_for_each_entry_safe(connector, tmp,
2710 &dev->mode_config.connector_list, head) { 2710 &dev->mode_config.connector_list, head) {
2711 if (intel_attached_encoder(connector) == &intel_sdvo->base) { 2711 if (intel_attached_encoder(connector) == &intel_sdvo->base) {
2712 drm_sysfs_connector_remove(connector); 2712 drm_connector_unregister(connector);
2713 intel_sdvo_destroy(connector); 2713 intel_sdvo_destroy(connector);
2714 } 2714 }
2715 } 2715 }
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 67c6c9a2eb1c..e211eef4b7e4 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1680,5 +1680,5 @@ intel_tv_init(struct drm_device *dev)
1680 drm_object_attach_property(&connector->base, 1680 drm_object_attach_property(&connector->base,
1681 dev->mode_config.tv_bottom_margin_property, 1681 dev->mode_config.tv_bottom_margin_property,
1682 intel_tv->margin[TV_MARGIN_BOTTOM]); 1682 intel_tv->margin[TV_MARGIN_BOTTOM]);
1683 drm_sysfs_connector_add(connector); 1683 drm_connector_register(connector);
1684} 1684}
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index a034ed408252..f9fe390920f1 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1621,7 +1621,7 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)
1621 1621
1622 drm_connector_helper_add(connector, &mga_vga_connector_helper_funcs); 1622 drm_connector_helper_add(connector, &mga_vga_connector_helper_funcs);
1623 1623
1624 drm_sysfs_connector_add(connector); 1624 drm_connector_register(connector);
1625 1625
1626 mga_connector->i2c = mgag200_i2c_create(dev); 1626 mga_connector->i2c = mgag200_i2c_create(dev);
1627 if (!mga_connector->i2c) 1627 if (!mga_connector->i2c)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index e56a6196867c..56c64c14c9b0 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -298,7 +298,7 @@ static void hdmi_connector_destroy(struct drm_connector *connector)
298 298
299 hdp_disable(hdmi_connector); 299 hdp_disable(hdmi_connector);
300 300
301 drm_sysfs_connector_remove(connector); 301 drm_connector_unregister(connector);
302 drm_connector_cleanup(connector); 302 drm_connector_cleanup(connector);
303 303
304 hdmi_unreference(hdmi_connector->hdmi); 304 hdmi_unreference(hdmi_connector->hdmi);
@@ -408,7 +408,7 @@ struct drm_connector *hdmi_connector_init(struct hdmi *hdmi)
408 connector->interlace_allowed = 1; 408 connector->interlace_allowed = 1;
409 connector->doublescan_allowed = 0; 409 connector->doublescan_allowed = 0;
410 410
411 drm_sysfs_connector_add(connector); 411 drm_connector_register(connector);
412 412
413 ret = hpd_enable(hdmi_connector); 413 ret = hpd_enable(hdmi_connector);
414 if (ret) { 414 if (ret) {
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 1fa222e8f007..680f46d007a0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -104,7 +104,7 @@ nouveau_connector_destroy(struct drm_connector *connector)
104 struct nouveau_connector *nv_connector = nouveau_connector(connector); 104 struct nouveau_connector *nv_connector = nouveau_connector(connector);
105 nouveau_event_ref(NULL, &nv_connector->hpd); 105 nouveau_event_ref(NULL, &nv_connector->hpd);
106 kfree(nv_connector->edid); 106 kfree(nv_connector->edid);
107 drm_sysfs_connector_remove(connector); 107 drm_connector_unregister(connector);
108 drm_connector_cleanup(connector); 108 drm_connector_cleanup(connector);
109 if (nv_connector->aux.transfer) 109 if (nv_connector->aux.transfer)
110 drm_dp_aux_unregister(&nv_connector->aux); 110 drm_dp_aux_unregister(&nv_connector->aux);
@@ -1236,6 +1236,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
1236 1236
1237 INIT_WORK(&nv_connector->work, nouveau_connector_hotplug_work); 1237 INIT_WORK(&nv_connector->work, nouveau_connector_hotplug_work);
1238 1238
1239 drm_sysfs_connector_add(connector); 1239 drm_connector_register(connector);
1240 return connector; 1240 return connector;
1241} 1241}
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index 86f4ead0441d..36bc5cc80816 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -130,7 +130,7 @@ static void omap_connector_destroy(struct drm_connector *connector)
130 struct omap_dss_device *dssdev = omap_connector->dssdev; 130 struct omap_dss_device *dssdev = omap_connector->dssdev;
131 131
132 DBG("%s", omap_connector->dssdev->name); 132 DBG("%s", omap_connector->dssdev->name);
133 drm_sysfs_connector_remove(connector); 133 drm_connector_unregister(connector);
134 drm_connector_cleanup(connector); 134 drm_connector_cleanup(connector);
135 kfree(omap_connector); 135 kfree(omap_connector);
136 136
@@ -307,7 +307,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
307 connector->interlace_allowed = 1; 307 connector->interlace_allowed = 1;
308 connector->doublescan_allowed = 0; 308 connector->doublescan_allowed = 0;
309 309
310 drm_sysfs_connector_add(connector); 310 drm_connector_register(connector);
311 311
312 return connector; 312 return connector;
313 313
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 5d7ea2461852..b8ced08b6291 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -835,7 +835,7 @@ static void qxl_conn_destroy(struct drm_connector *connector)
835 struct qxl_output *qxl_output = 835 struct qxl_output *qxl_output =
836 drm_connector_to_qxl_output(connector); 836 drm_connector_to_qxl_output(connector);
837 837
838 drm_sysfs_connector_remove(connector); 838 drm_connector_unregister(connector);
839 drm_connector_cleanup(connector); 839 drm_connector_cleanup(connector);
840 kfree(qxl_output); 840 kfree(qxl_output);
841} 841}
@@ -902,7 +902,7 @@ static int qdev_output_init(struct drm_device *dev, int num_output)
902 902
903 drm_object_attach_property(&connector->base, 903 drm_object_attach_property(&connector->base,
904 qdev->hotplug_mode_update_property, 0); 904 qdev->hotplug_mode_update_property, 0);
905 drm_sysfs_connector_add(connector); 905 drm_connector_register(connector);
906 return 0; 906 return 0;
907} 907}
908 908
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 933c5c39654d..5b1a611c30eb 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -737,7 +737,7 @@ static void radeon_connector_destroy(struct drm_connector *connector)
737 if (radeon_connector->edid) 737 if (radeon_connector->edid)
738 kfree(radeon_connector->edid); 738 kfree(radeon_connector->edid);
739 kfree(radeon_connector->con_priv); 739 kfree(radeon_connector->con_priv);
740 drm_sysfs_connector_remove(connector); 740 drm_connector_unregister(connector);
741 drm_connector_cleanup(connector); 741 drm_connector_cleanup(connector);
742 kfree(connector); 742 kfree(connector);
743} 743}
@@ -2038,7 +2038,7 @@ radeon_add_atom_connector(struct drm_device *dev,
2038 connector->polled = DRM_CONNECTOR_POLL_HPD; 2038 connector->polled = DRM_CONNECTOR_POLL_HPD;
2039 2039
2040 connector->display_info.subpixel_order = subpixel_order; 2040 connector->display_info.subpixel_order = subpixel_order;
2041 drm_sysfs_connector_add(connector); 2041 drm_connector_register(connector);
2042 2042
2043 if (has_aux) 2043 if (has_aux)
2044 radeon_dp_aux_init(radeon_connector); 2044 radeon_dp_aux_init(radeon_connector);
@@ -2199,5 +2199,5 @@ radeon_add_legacy_connector(struct drm_device *dev,
2199 } else 2199 } else
2200 connector->polled = DRM_CONNECTOR_POLL_HPD; 2200 connector->polled = DRM_CONNECTOR_POLL_HPD;
2201 connector->display_info.subpixel_order = subpixel_order; 2201 connector->display_info.subpixel_order = subpixel_order;
2202 drm_sysfs_connector_add(connector); 2202 drm_connector_register(connector);
2203} 2203}
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
index 289048d1c7b2..21426bd234eb 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
@@ -64,7 +64,7 @@ static const struct drm_connector_helper_funcs connector_helper_funcs = {
64 64
65static void rcar_du_lvds_connector_destroy(struct drm_connector *connector) 65static void rcar_du_lvds_connector_destroy(struct drm_connector *connector)
66{ 66{
67 drm_sysfs_connector_remove(connector); 67 drm_connector_unregister(connector);
68 drm_connector_cleanup(connector); 68 drm_connector_cleanup(connector);
69} 69}
70 70
@@ -105,7 +105,7 @@ int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
105 return ret; 105 return ret;
106 106
107 drm_connector_helper_add(connector, &connector_helper_funcs); 107 drm_connector_helper_add(connector, &connector_helper_funcs);
108 ret = drm_sysfs_connector_add(connector); 108 ret = drm_connector_register(connector);
109 if (ret < 0) 109 if (ret < 0)
110 return ret; 110 return ret;
111 111
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
index ccfe64c7188f..8af3944d31b9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
@@ -32,7 +32,7 @@ static const struct drm_connector_helper_funcs connector_helper_funcs = {
32 32
33static void rcar_du_vga_connector_destroy(struct drm_connector *connector) 33static void rcar_du_vga_connector_destroy(struct drm_connector *connector)
34{ 34{
35 drm_sysfs_connector_remove(connector); 35 drm_connector_unregister(connector);
36 drm_connector_cleanup(connector); 36 drm_connector_cleanup(connector);
37} 37}
38 38
@@ -70,7 +70,7 @@ int rcar_du_vga_connector_init(struct rcar_du_device *rcdu,
70 return ret; 70 return ret;
71 71
72 drm_connector_helper_add(connector, &connector_helper_funcs); 72 drm_connector_helper_add(connector, &connector_helper_funcs);
73 ret = drm_sysfs_connector_add(connector); 73 ret = drm_connector_register(connector);
74 if (ret < 0) 74 if (ret < 0)
75 return ret; 75 return ret;
76 76
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
index faf176b2daf9..47875de89010 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
@@ -692,7 +692,7 @@ static void shmob_drm_connector_destroy(struct drm_connector *connector)
692 struct shmob_drm_connector *scon = to_shmob_connector(connector); 692 struct shmob_drm_connector *scon = to_shmob_connector(connector);
693 693
694 shmob_drm_backlight_exit(scon); 694 shmob_drm_backlight_exit(scon);
695 drm_sysfs_connector_remove(connector); 695 drm_connector_unregister(connector);
696 drm_connector_cleanup(connector); 696 drm_connector_cleanup(connector);
697} 697}
698 698
@@ -726,7 +726,7 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
726 return ret; 726 return ret;
727 727
728 drm_connector_helper_add(connector, &connector_helper_funcs); 728 drm_connector_helper_add(connector, &connector_helper_funcs);
729 ret = drm_sysfs_connector_add(connector); 729 ret = drm_connector_register(connector);
730 if (ret < 0) 730 if (ret < 0)
731 goto err_cleanup; 731 goto err_cleanup;
732 732
@@ -749,7 +749,7 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
749err_backlight: 749err_backlight:
750 shmob_drm_backlight_exit(&sdev->connector); 750 shmob_drm_backlight_exit(&sdev->connector);
751err_sysfs: 751err_sysfs:
752 drm_sysfs_connector_remove(connector); 752 drm_connector_unregister(connector);
753err_cleanup: 753err_cleanup:
754 drm_connector_cleanup(connector); 754 drm_connector_cleanup(connector);
755 return ret; 755 return ret;
diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
index a3e4f1eca6f7..446837e955b6 100644
--- a/drivers/gpu/drm/tegra/output.c
+++ b/drivers/gpu/drm/tegra/output.c
@@ -105,7 +105,7 @@ static void drm_connector_clear(struct drm_connector *connector)
105 105
106static void tegra_connector_destroy(struct drm_connector *connector) 106static void tegra_connector_destroy(struct drm_connector *connector)
107{ 107{
108 drm_sysfs_connector_remove(connector); 108 drm_connector_unregister(connector);
109 drm_connector_cleanup(connector); 109 drm_connector_cleanup(connector);
110 drm_connector_clear(connector); 110 drm_connector_clear(connector);
111} 111}
@@ -318,7 +318,7 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output)
318 drm_encoder_helper_add(&output->encoder, &encoder_helper_funcs); 318 drm_encoder_helper_add(&output->encoder, &encoder_helper_funcs);
319 319
320 drm_mode_connector_attach_encoder(&output->connector, &output->encoder); 320 drm_mode_connector_attach_encoder(&output->connector, &output->encoder);
321 drm_sysfs_connector_add(&output->connector); 321 drm_connector_register(&output->connector);
322 322
323 output->encoder.possible_crtcs = 0x3; 323 output->encoder.possible_crtcs = 0x3;
324 324
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 86c67329b605..0c0bce7e9007 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -247,7 +247,7 @@ static struct drm_connector *panel_connector_create(struct drm_device *dev,
247 if (ret) 247 if (ret)
248 goto fail; 248 goto fail;
249 249
250 drm_sysfs_connector_add(connector); 250 drm_connector_register(connector);
251 251
252 return connector; 252 return connector;
253 253
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
index 595068ba2d5e..c578d144ce6d 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
@@ -261,7 +261,7 @@ static struct drm_connector *slave_connector_create(struct drm_device *dev,
261 if (ret) 261 if (ret)
262 goto fail; 262 goto fail;
263 263
264 drm_sysfs_connector_add(connector); 264 drm_connector_register(connector);
265 265
266 return connector; 266 return connector;
267 267
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index c38b56b268ac..5324dfd0b5ed 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -261,7 +261,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev,
261 if (ret) 261 if (ret)
262 goto fail; 262 goto fail;
263 263
264 drm_sysfs_connector_add(connector); 264 drm_connector_register(connector);
265 265
266 return connector; 266 return connector;
267 267
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
index b44d548c56f8..dea38ab6c47d 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -124,7 +124,7 @@ static int udl_connector_set_property(struct drm_connector *connector,
124 124
125static void udl_connector_destroy(struct drm_connector *connector) 125static void udl_connector_destroy(struct drm_connector *connector)
126{ 126{
127 drm_sysfs_connector_remove(connector); 127 drm_connector_unregister(connector);
128 drm_connector_cleanup(connector); 128 drm_connector_cleanup(connector);
129 kfree(connector); 129 kfree(connector);
130} 130}
@@ -154,7 +154,7 @@ int udl_connector_init(struct drm_device *dev, struct drm_encoder *encoder)
154 drm_connector_init(dev, connector, &udl_connector_funcs, DRM_MODE_CONNECTOR_DVII); 154 drm_connector_init(dev, connector, &udl_connector_funcs, DRM_MODE_CONNECTOR_DVII);
155 drm_connector_helper_add(connector, &udl_connector_helper_funcs); 155 drm_connector_helper_add(connector, &udl_connector_helper_funcs);
156 156
157 drm_sysfs_connector_add(connector); 157 drm_connector_register(connector);
158 drm_mode_connector_attach_encoder(connector, encoder); 158 drm_mode_connector_attach_encoder(connector, encoder);
159 159
160 drm_object_attach_property(&connector->base, 160 drm_object_attach_property(&connector->base,
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 8f3edc4710f2..1a024e3b7285 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -75,7 +75,7 @@ void vmw_display_unit_cleanup(struct vmw_display_unit *du)
75 vmw_surface_unreference(&du->cursor_surface); 75 vmw_surface_unreference(&du->cursor_surface);
76 if (du->cursor_dmabuf) 76 if (du->cursor_dmabuf)
77 vmw_dmabuf_unreference(&du->cursor_dmabuf); 77 vmw_dmabuf_unreference(&du->cursor_dmabuf);
78 drm_sysfs_connector_remove(&du->connector); 78 drm_connector_unregister(&du->connector);
79 drm_crtc_cleanup(&du->crtc); 79 drm_crtc_cleanup(&du->crtc);
80 drm_encoder_cleanup(&du->encoder); 80 drm_encoder_cleanup(&du->encoder);
81 drm_connector_cleanup(&du->connector); 81 drm_connector_cleanup(&du->connector);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index b2b9bd23aeee..15e185ae4c99 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -371,7 +371,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
371 encoder->possible_crtcs = (1 << unit); 371 encoder->possible_crtcs = (1 << unit);
372 encoder->possible_clones = 0; 372 encoder->possible_clones = 0;
373 373
374 (void) drm_sysfs_connector_add(connector); 374 (void) drm_connector_register(connector);
375 375
376 drm_crtc_init(dev, crtc, &vmw_legacy_crtc_funcs); 376 drm_crtc_init(dev, crtc, &vmw_legacy_crtc_funcs);
377 377
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
index a95d3a0cabe4..b295463a60b3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
@@ -467,7 +467,7 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit)
467 encoder->possible_crtcs = (1 << unit); 467 encoder->possible_crtcs = (1 << unit);
468 encoder->possible_clones = 0; 468 encoder->possible_clones = 0;
469 469
470 (void) drm_sysfs_connector_add(connector); 470 (void) drm_connector_register(connector);
471 471
472 drm_crtc_init(dev, crtc, &vmw_screen_object_crtc_funcs); 472 drm_crtc_init(dev, crtc, &vmw_screen_object_crtc_funcs);
473 473
diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
index def8280d7ee6..6f54ff4f9372 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -202,7 +202,7 @@ static const struct file_operations imx_drm_driver_fops = {
202 202
203void imx_drm_connector_destroy(struct drm_connector *connector) 203void imx_drm_connector_destroy(struct drm_connector *connector)
204{ 204{
205 drm_sysfs_connector_remove(connector); 205 drm_connector_unregister(connector);
206 drm_connector_cleanup(connector); 206 drm_connector_cleanup(connector);
207} 207}
208EXPORT_SYMBOL_GPL(imx_drm_connector_destroy); 208EXPORT_SYMBOL_GPL(imx_drm_connector_destroy);
@@ -293,10 +293,10 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
293 * userspace will expect to be able to access DRM at this point. 293 * userspace will expect to be able to access DRM at this point.
294 */ 294 */
295 list_for_each_entry(connector, &drm->mode_config.connector_list, head) { 295 list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
296 ret = drm_sysfs_connector_add(connector); 296 ret = drm_connector_register(connector);
297 if (ret) { 297 if (ret) {
298 dev_err(drm->dev, 298 dev_err(drm->dev,
299 "[CONNECTOR:%d:%s] drm_sysfs_connector_add failed: %d\n", 299 "[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
300 connector->base.id, 300 connector->base.id,
301 connector->name, ret); 301 connector->name, ret);
302 goto err_unbind; 302 goto err_unbind;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 251b75e6bf7a..5512c9968d77 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -878,6 +878,8 @@ extern int drm_connector_init(struct drm_device *dev,
878 struct drm_connector *connector, 878 struct drm_connector *connector,
879 const struct drm_connector_funcs *funcs, 879 const struct drm_connector_funcs *funcs,
880 int connector_type); 880 int connector_type);
881int drm_connector_register(struct drm_connector *connector);
882void drm_connector_unregister(struct drm_connector *connector);
881 883
882extern void drm_connector_cleanup(struct drm_connector *connector); 884extern void drm_connector_cleanup(struct drm_connector *connector);
883/* helper to unplug all connectors from sysfs for device */ 885/* helper to unplug all connectors from sysfs for device */