Commit a65eb01f authored by Noralf Trønnes's avatar Noralf Trønnes

drm/fb-helper: Set/clear dev->fb_helper in dummy init/fini

Set dev->fb_helper even when fbdev emulation is compiled out,
so drivers can use it to free the structure.
Clear it for consistency.

Fixes: 29ad20b2 ("drm: Add drm_device->fb_helper pointer")
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-2-noralf@tronnes.org
parent eb393dbc
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
struct drm_fb_helper; struct drm_fb_helper;
#include <drm/drm_crtc.h> #include <drm/drm_crtc.h>
#include <drm/drm_device.h>
#include <linux/kgdb.h> #include <linux/kgdb.h>
enum mode_set_atomic { enum mode_set_atomic {
...@@ -332,11 +333,17 @@ static inline int drm_fb_helper_init(struct drm_device *dev, ...@@ -332,11 +333,17 @@ static inline int drm_fb_helper_init(struct drm_device *dev,
struct drm_fb_helper *helper, struct drm_fb_helper *helper,
int max_conn) int max_conn)
{ {
/* So drivers can use it to free the struct */
helper->dev = dev;
dev->fb_helper = helper;
return 0; return 0;
} }
static inline void drm_fb_helper_fini(struct drm_fb_helper *helper) static inline void drm_fb_helper_fini(struct drm_fb_helper *helper)
{ {
if (helper && helper->dev)
helper->dev->fb_helper = NULL;
} }
static inline int drm_fb_helper_blank(int blank, struct fb_info *info) static inline int drm_fb_helper_blank(int blank, struct fb_info *info)
......
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