diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-03-30 11:36:03 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2023-04-05 18:06:07 +0300 |
commit | 08263e91f26025cbaa7049a322f7f9b13c56f2ee (patch) | |
tree | b11409a124ed7adb10fab4047cd1df288fced8a5 /drivers/gpu | |
parent | dc06f4a495df1cf88c7cb0a383a97bdd8eddcf95 (diff) | |
download | linux-08263e91f26025cbaa7049a322f7f9b13c56f2ee.tar.xz |
drm/tegra: Removed fb from struct tegra_fbdev
Fbdev's struct fb_helper stores a pointer to the framebuffer. Remove
struct tegra_fbdev.fb, which contains the same value. No functional
changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/tegra/drm.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/tegra/fb.c | 23 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 845e60f144c7..8f8e5cda78da 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -32,7 +32,6 @@ struct reset_control; #ifdef CONFIG_DRM_FBDEV_EMULATION struct tegra_fbdev { struct drm_fb_helper base; - struct drm_framebuffer *fb; }; #endif diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 35b90fac5a47..44051fc44325 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -218,7 +218,6 @@ static const struct fb_ops tegra_fb_ops = { static int tegra_fbdev_probe(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { - struct tegra_fbdev *fbdev = to_tegra_fbdev(helper); struct tegra_drm *tegra = helper->dev->dev_private; struct drm_device *drm = helper->dev; struct drm_mode_fb_cmd2 cmd = { 0 }; @@ -253,16 +252,15 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, return PTR_ERR(info); } - fbdev->fb = tegra_fb_alloc(drm, &cmd, &bo, 1); - if (IS_ERR(fbdev->fb)) { - err = PTR_ERR(fbdev->fb); + fb = tegra_fb_alloc(drm, &cmd, &bo, 1); + if (IS_ERR(fb)) { + err = PTR_ERR(fb); dev_err(drm->dev, "failed to allocate DRM framebuffer: %d\n", err); drm_gem_object_put(&bo->gem); - return PTR_ERR(fbdev->fb); + return PTR_ERR(fb); } - fb = fbdev->fb; helper->fb = fb; helper->info = info; @@ -350,10 +348,13 @@ fini: static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) { - drm_fb_helper_unregister_info(&fbdev->base); + struct drm_fb_helper *helper = &fbdev->base; + struct drm_framebuffer *fb = helper->fb; - if (fbdev->fb) { - struct tegra_bo *bo = tegra_fb_get_plane(fbdev->fb, 0); + drm_fb_helper_unregister_info(helper); + + if (fb) { + struct tegra_bo *bo = tegra_fb_get_plane(fb, 0); /* Undo the special mapping we made in fbdev probe. */ if (bo && bo->pages) { @@ -361,10 +362,10 @@ static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) bo->vaddr = NULL; } - drm_framebuffer_remove(fbdev->fb); + drm_framebuffer_remove(fb); } - drm_fb_helper_fini(&fbdev->base); + drm_fb_helper_fini(helper); tegra_fbdev_free(fbdev); } #endif |