Define the module's parameter 'fbdev' in fbdev code. No other code uses it. No functional changes, but simplifies the later conversion to struct drm_client. Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx> --- drivers/gpu/drm/msm/msm_drv.c | 10 ++-------- drivers/gpu/drm/msm/msm_fbdev.c | 7 +++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 14f4bc33b50b..4bf486f0ebb9 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -63,12 +63,6 @@ static const struct drm_mode_config_helper_funcs mode_config_helper_funcs = { .atomic_commit_tail = msm_atomic_commit_tail, }; -#ifdef CONFIG_DRM_FBDEV_EMULATION -static bool fbdev = true; -MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer"); -module_param(fbdev, bool, 0600); -#endif - static char *vram = "16m"; MODULE_PARM_DESC(vram, "Configure VRAM size (for devices without IOMMU/GPUMMU)"); module_param(vram, charp, 0); @@ -242,7 +236,7 @@ static int msm_drm_uninit(struct device *dev) msm_rd_debugfs_cleanup(priv); #ifdef CONFIG_DRM_FBDEV_EMULATION - if (fbdev && ddev->fb_helper) + if (ddev->fb_helper) msm_fbdev_free(ddev); #endif @@ -536,7 +530,7 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) drm_mode_config_reset(ddev); #ifdef CONFIG_DRM_FBDEV_EMULATION - if (kms && fbdev) + if (kms) msm_fbdev_init(ddev); #endif diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 0bd0cb85c538..7d205632b165 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -14,6 +14,10 @@ #include "msm_gem.h" #include "msm_kms.h" +static bool fbdev = true; +MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer"); +module_param(fbdev, bool, 0600); + /* * fbdev funcs, to implement legacy fbdev interface on top of drm driver */ @@ -125,6 +129,9 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev) struct drm_fb_helper *helper; int ret; + if (!fbdev) + return NULL; + helper = kzalloc(sizeof(*helper), GFP_KERNEL); if (!helper) return NULL; -- 2.40.0