drm/fb-helper: Remove struct drm_fb_helper.fb_probe
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 12 Dec 2024 17:08:53 +0000 (18:08 +0100)
committerMaarten Lankhorst <dev@lankhorst.se>
Wed, 5 Mar 2025 20:48:50 +0000 (21:48 +0100)
The callback fb_probe in struct drm_fb_helper is unused. Remove it.
New drivers should set struct drm_driver.fbdev_probe instead and call
drm_client_setup() to instantiate in-kernel DRM clients.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241212170913.185939-13-tzimmermann@suse.de
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
drivers/gpu/drm/drm_fb_helper.c
include/drm/drm_fb_helper.h

index 0703fddd750f05be4aa48f64b96247db18a09644..937c3939e5027c999d7ddf2c590774b1f11c063c 100644 (file)
@@ -1634,6 +1634,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
        struct fb_info *info;
        int ret;
 
+       if (drm_WARN_ON(dev, !dev->driver->fbdev_probe))
+               return -EINVAL;
+
        ret = drm_fb_helper_find_sizes(fb_helper, &sizes);
        if (ret) {
                /* First time: disable all crtc's.. */
@@ -1643,10 +1646,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
        }
 
        /* push down into drivers */
-       if (dev->driver->fbdev_probe)
-               ret = dev->driver->fbdev_probe(fb_helper, &sizes);
-       else if (fb_helper->funcs)
-               ret = fb_helper->funcs->fb_probe(fb_helper, &sizes);
+       ret = dev->driver->fbdev_probe(fb_helper, &sizes);
        if (ret < 0)
                return ret;
 
index ddce2408ca2b571b4486a65b47cd5446329e28bd..c1d38d54a11204fe9fe3795f1f6b382dd7aa5a93 100644 (file)
@@ -69,23 +69,6 @@ struct drm_fb_helper_surface_size {
  * Driver callbacks used by the fbdev emulation helper library.
  */
 struct drm_fb_helper_funcs {
-       /**
-        * @fb_probe:
-        *
-        * Driver callback to allocate and initialize the fbdev info structure.
-        * Furthermore it also needs to allocate the DRM framebuffer used to
-        * back the fbdev.
-        *
-        * This callback is mandatory.
-        *
-        * RETURNS:
-        *
-        * The driver should return 0 on success and a negative error code on
-        * failure.
-        */
-       int (*fb_probe)(struct drm_fb_helper *helper,
-                       struct drm_fb_helper_surface_size *sizes);
-
        /**
         * @fb_dirty:
         *