Commit ec3e00b4 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/i915: stop registering if drm_dev_register() fails

If drm_dev_register() fails there is no reason to continue registering
the driver and initializing.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210213042756.953007-1-lucas.demarchi@intel.com
parent 29b6f88d
...@@ -664,17 +664,19 @@ static void i915_driver_register(struct drm_i915_private *dev_priv) ...@@ -664,17 +664,19 @@ static void i915_driver_register(struct drm_i915_private *dev_priv)
intel_vgpu_register(dev_priv); intel_vgpu_register(dev_priv);
/* Reveal our presence to userspace */ /* Reveal our presence to userspace */
if (drm_dev_register(dev, 0) == 0) { if (drm_dev_register(dev, 0)) {
i915_debugfs_register(dev_priv);
if (HAS_DISPLAY(dev_priv))
intel_display_debugfs_register(dev_priv);
i915_setup_sysfs(dev_priv);
/* Depends on sysfs having been initialized */
i915_perf_register(dev_priv);
} else
drm_err(&dev_priv->drm, drm_err(&dev_priv->drm,
"Failed to register driver for userspace access!\n"); "Failed to register driver for userspace access!\n");
return;
}
i915_debugfs_register(dev_priv);
if (HAS_DISPLAY(dev_priv))
intel_display_debugfs_register(dev_priv);
i915_setup_sysfs(dev_priv);
/* Depends on sysfs having been initialized */
i915_perf_register(dev_priv);
if (HAS_DISPLAY(dev_priv)) { if (HAS_DISPLAY(dev_priv)) {
/* Must be done after probing outputs */ /* Must be done after probing outputs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment