[PATCH 2/5] drm/exynos: Remove struct exynos_drm_fbdev
Thomas Zimmermann
tzimmermann at suse.de
Thu Mar 30 00:36:32 PDT 2023
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 at suse.de>
---
drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
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;
}
--
2.40.0
More information about the linux-arm-kernel
mailing list