diff mbox series

[2/5] drm/exynos: Remove struct exynos_drm_fbdev

Message ID 20230330073635.7409-3-tzimmermann@suse.de (mailing list archive)
State Accepted
Commit 50e97607f8853ad7efe1a8d451ccdd8f50e7fbe1
Headers show
Series drm/exynos: Convert fbdev to DRM client | expand

Commit Message

Thomas Zimmermann March 30, 2023, 7:36 a.m. UTC
Remove struct exynos_drm_fbdev, which is an empty wrapper around
struct drm_fb_helper. Use the latter directly. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index f11895d32982..e7059850baa2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -28,13 +28,6 @@ 
 #define MAX_CONNECTOR		4
 #define PREFERRED_BPP		32
 
-#define to_exynos_fbdev(x)	container_of(x, struct exynos_drm_fbdev,\
-				drm_fb_helper)
-
-struct exynos_drm_fbdev {
-	struct drm_fb_helper	drm_fb_helper;
-};
-
 static int exynos_drm_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
 	struct drm_fb_helper *helper = info->par;
@@ -144,7 +137,6 @@  static const struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = {
 
 int exynos_drm_fbdev_init(struct drm_device *dev)
 {
-	struct exynos_drm_fbdev *fbdev;
 	struct exynos_drm_private *private = dev->dev_private;
 	struct drm_fb_helper *helper;
 	int ret;
@@ -152,11 +144,11 @@  int exynos_drm_fbdev_init(struct drm_device *dev)
 	if (!dev->mode_config.num_crtc)
 		return 0;
 
-	fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
-	if (!fbdev)
+	helper = kzalloc(sizeof(*helper), GFP_KERNEL);
+	if (!helper)
 		return -ENOMEM;
 
-	private->fb_helper = helper = &fbdev->drm_fb_helper;
+	private->fb_helper = helper;
 
 	drm_fb_helper_prepare(dev, helper, PREFERRED_BPP, &exynos_drm_fb_helper_funcs);
 
@@ -181,7 +173,7 @@  int exynos_drm_fbdev_init(struct drm_device *dev)
 err_init:
 	drm_fb_helper_unprepare(helper);
 	private->fb_helper = NULL;
-	kfree(fbdev);
+	kfree(helper);
 
 	return ret;
 }
@@ -206,16 +198,13 @@  static void exynos_drm_fbdev_destroy(struct drm_device *dev,
 void exynos_drm_fbdev_fini(struct drm_device *dev)
 {
 	struct exynos_drm_private *private = dev->dev_private;
-	struct exynos_drm_fbdev *fbdev;
 
 	if (!private || !private->fb_helper)
 		return;
 
-	fbdev = to_exynos_fbdev(private->fb_helper);
-
 	exynos_drm_fbdev_destroy(dev, private->fb_helper);
 	drm_fb_helper_unprepare(private->fb_helper);
-	kfree(fbdev);
+	kfree(private->fb_helper);
 	private->fb_helper = NULL;
 }