Use info->screen_buffer when reading and writing framebuffers in
system memory. It's the correct pointer for this address space.

The struct fb_info has a union to store the framebuffer memory. This can
either be info->screen_base if the framebuffer is stored in I/O memory,
or info->screen_buffer if the framebuffer is stored in system memory.

As the driver operates on the latter address space, it is wrong to use
.screen_base and .screen_buffer must be used instead.

Signed-off-by: Thomas Zimmermann <[email protected]>
---
 drivers/video/fbdev/smscufx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c
index 2ad6e98ce10d..17cec62cc65d 100644
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -1150,7 +1150,7 @@ static void ufx_free_framebuffer(struct ufx_data *dev)
                fb_dealloc_cmap(&info->cmap);
        if (info->monspecs.modedb)
                fb_destroy_modedb(info->monspecs.modedb);
-       vfree(info->screen_base);
+       vfree(info->screen_buffer);
 
        fb_destroy_modelist(&info->modelist);
 
@@ -1257,7 +1257,7 @@ static int ufx_ops_set_par(struct fb_info *info)
 
        if ((result == 0) && (dev->fb_count == 0)) {
                /* paint greenscreen */
-               pix_framebuffer = (u16 *) info->screen_base;
+               pix_framebuffer = (u16 *)info->screen_buffer;
                for (i = 0; i < info->fix.smem_len / 2; i++)
                        pix_framebuffer[i] = 0x37e6;
 
@@ -1303,7 +1303,7 @@ static int ufx_realloc_framebuffer(struct ufx_data *dev, 
struct fb_info *info)
 {
        int old_len = info->fix.smem_len;
        int new_len;
-       unsigned char *old_fb = info->screen_base;
+       unsigned char *old_fb = info->screen_buffer;
        unsigned char *new_fb;
 
        pr_debug("Reallocating framebuffer. Addresses will change!");
@@ -1318,12 +1318,12 @@ static int ufx_realloc_framebuffer(struct ufx_data 
*dev, struct fb_info *info)
                if (!new_fb)
                        return -ENOMEM;
 
-               if (info->screen_base) {
+               if (info->screen_buffer) {
                        memcpy(new_fb, old_fb, old_len);
-                       vfree(info->screen_base);
+                       vfree(info->screen_buffer);
                }
 
-               info->screen_base = new_fb;
+               info->screen_buffer = new_fb;
                info->fix.smem_len = PAGE_ALIGN(new_len);
                info->fix.smem_start = (unsigned long) new_fb;
                info->flags = smscufx_info_flags;
@@ -1746,7 +1746,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
        atomic_set(&dev->usb_active, 0);
 setup_modes:
        fb_destroy_modedb(info->monspecs.modedb);
-       vfree(info->screen_base);
+       vfree(info->screen_buffer);
        fb_destroy_modelist(&info->modelist);
 error:
        fb_dealloc_cmap(&info->cmap);
-- 
2.40.0

Reply via email to