|
@@ -1067,6 +1067,46 @@ void drm_connector_unregister(struct drm_connector *connector)
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_connector_unregister);
|
|
|
|
|
|
+/**
|
|
|
+ * drm_connector_register_all - register all connectors
|
|
|
+ * @dev: drm device
|
|
|
+ *
|
|
|
+ * This function registers all connectors in sysfs and other places so that
|
|
|
+ * userspace can start to access them. Drivers can call it after calling
|
|
|
+ * drm_dev_register() to complete the device registration, if they don't call
|
|
|
+ * drm_connector_register() on each connector individually.
|
|
|
+ *
|
|
|
+ * When a device is unplugged and should be removed from userspace access,
|
|
|
+ * call drm_connector_unregister_all(), which is the inverse of this
|
|
|
+ * function.
|
|
|
+ *
|
|
|
+ * Returns:
|
|
|
+ * Zero on success, error code on failure.
|
|
|
+ */
|
|
|
+int drm_connector_register_all(struct drm_device *dev)
|
|
|
+{
|
|
|
+ struct drm_connector *connector;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ mutex_lock(&dev->mode_config.mutex);
|
|
|
+
|
|
|
+ drm_for_each_connector(connector, dev) {
|
|
|
+ ret = drm_connector_register(connector);
|
|
|
+ if (ret)
|
|
|
+ goto err;
|
|
|
+ }
|
|
|
+
|
|
|
+ mutex_unlock(&dev->mode_config.mutex);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+
|
|
|
+err:
|
|
|
+ mutex_unlock(&dev->mode_config.mutex);
|
|
|
+ drm_connector_unregister_all(dev);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_connector_register_all);
|
|
|
+
|
|
|
/**
|
|
|
* drm_connector_unregister_all - unregister connector userspace interfaces
|
|
|
* @dev: drm device
|