]> Git Repo - linux.git/commitdiff
drm/client: Fix: drm_client_new: Don't require DRM to be registered
authorNoralf Trønnes <[email protected]>
Wed, 11 Jul 2018 15:56:32 +0000 (17:56 +0200)
committerNoralf Trønnes <[email protected]>
Wed, 11 Jul 2018 20:25:51 +0000 (22:25 +0200)
Commit 894a677f4b3e ("drm/cma-helper: Use the generic fbdev emulation")
broke almost all drivers that use the CMA helper.

The reason is that drm_client_new() requires that the DRM device has
been registered, but the drivers register fbdev before registering DRM.

Remove the requirement that DRM should be registered when creating a
new client.

Fixes: c76f0f7cb546 ("drm: Begin an API for in-kernel clients")
Cc: Maxime Ripard <[email protected]>
Cc: Icenowy Zheng <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: Daniel Vetter <[email protected]>
Signed-off-by: Noralf Trønnes <[email protected]>
Tested-by: Icenowy Zheng <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/drm_client.c

index 4039a4d103a83acc315e2740697d1a00d93ae216..9b142f58d489ff9e67869c95dc0c6d0a46115aa0 100644 (file)
@@ -78,7 +78,6 @@ EXPORT_SYMBOL(drm_client_close);
 int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
                   const char *name, const struct drm_client_funcs *funcs)
 {
-       bool registered;
        int ret;
 
        if (!drm_core_check_feature(dev, DRIVER_MODESET) ||
@@ -97,21 +96,13 @@ int drm_client_new(struct drm_device *dev, struct drm_client_dev *client,
                goto err_put_module;
 
        mutex_lock(&dev->clientlist_mutex);
-       registered = dev->registered;
-       if (registered)
-               list_add(&client->list, &dev->clientlist);
+       list_add(&client->list, &dev->clientlist);
        mutex_unlock(&dev->clientlist_mutex);
-       if (!registered) {
-               ret = -ENODEV;
-               goto err_close;
-       }
 
        drm_dev_get(dev);
 
        return 0;
 
-err_close:
-       drm_client_close(client);
 err_put_module:
        if (funcs)
                module_put(funcs->owner);
This page took 0.057826 seconds and 4 git commands to generate.