diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-12-15 12:51:13 -0500 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2017-12-20 08:50:19 -0500 |
commit | a65eb01ffcc50b42d1e4ea2e79c274e7f7a240c6 (patch) | |
tree | e67f9e3741bad8d02eccdb8b59fde4ed16b76905 | |
parent | eb393dbc8f5b2ca7c87749795fd49b8cf77ab04b (diff) |
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: 29ad20b22c8f ("drm: Add drm_device->fb_helper pointer")
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171215175119.36181-2-noralf@tronnes.org
-rw-r--r-- | include/drm/drm_fb_helper.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 1494b12a984a..1bd624579db7 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -33,6 +33,7 @@ | |||
33 | struct drm_fb_helper; | 33 | struct drm_fb_helper; |
34 | 34 | ||
35 | #include <drm/drm_crtc.h> | 35 | #include <drm/drm_crtc.h> |
36 | #include <drm/drm_device.h> | ||
36 | #include <linux/kgdb.h> | 37 | #include <linux/kgdb.h> |
37 | 38 | ||
38 | enum mode_set_atomic { | 39 | enum mode_set_atomic { |
@@ -332,11 +333,17 @@ static inline int drm_fb_helper_init(struct drm_device *dev, | |||
332 | struct drm_fb_helper *helper, | 333 | struct drm_fb_helper *helper, |
333 | int max_conn) | 334 | int max_conn) |
334 | { | 335 | { |
336 | /* So drivers can use it to free the struct */ | ||
337 | helper->dev = dev; | ||
338 | dev->fb_helper = helper; | ||
339 | |||
335 | return 0; | 340 | return 0; |
336 | } | 341 | } |
337 | 342 | ||
338 | static inline void drm_fb_helper_fini(struct drm_fb_helper *helper) | 343 | static inline void drm_fb_helper_fini(struct drm_fb_helper *helper) |
339 | { | 344 | { |
345 | if (helper && helper->dev) | ||
346 | helper->dev->fb_helper = NULL; | ||
340 | } | 347 | } |
341 | 348 | ||
342 | static inline int drm_fb_helper_blank(int blank, struct fb_info *info) | 349 | static inline int drm_fb_helper_blank(int blank, struct fb_info *info) |