Commit 5f8dec20 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Maxime Ripard

drm/drv: propagate errors from drm_modeset_register_all()

In case the drm_modeset_register_all() function fails, its error code
will be ignored. Instead make the drm_dev_register() bail out in case of
such an error.

Fixes: 79190ea2 ("drm: Add callbacks for late registering")
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231202225552.1283638-1-dmitry.baryshkov@linaro.org
parent 72ef65ab
...@@ -949,8 +949,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) ...@@ -949,8 +949,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
goto err_minors; goto err_minors;
} }
if (drm_core_check_feature(dev, DRIVER_MODESET)) if (drm_core_check_feature(dev, DRIVER_MODESET)) {
drm_modeset_register_all(dev); ret = drm_modeset_register_all(dev);
if (ret)
goto err_unload;
}
DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
driver->name, driver->major, driver->minor, driver->name, driver->major, driver->minor,
...@@ -960,6 +963,9 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) ...@@ -960,6 +963,9 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
goto out_unlock; goto out_unlock;
err_unload:
if (dev->driver->unload)
dev->driver->unload(dev);
err_minors: err_minors:
remove_compat_control_link(dev); remove_compat_control_link(dev);
drm_minor_unregister(dev, DRM_MINOR_ACCEL); drm_minor_unregister(dev, DRM_MINOR_ACCEL);
......
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