The q40fb driver uses a fixed physical address but never reserves
the corresponding I/O region. Reserve the range  as suggested in
Documentation/gpu/todo.rst ("Request memory regions in all fbdev drivers").

No functional change beyond claming the resource. This change is compile
tested only.

Signed-off-by: Sukrut Heroorkar <[email protected]>
---
 drivers/video/fbdev/q40fb.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/video/fbdev/q40fb.c b/drivers/video/fbdev/q40fb.c
index 1ff8fa176124..935260326c6f 100644
--- a/drivers/video/fbdev/q40fb.c
+++ b/drivers/video/fbdev/q40fb.c
@@ -101,6 +101,12 @@ static int q40fb_probe(struct platform_device *dev)
        info->par = NULL;
        info->screen_base = (char *) q40fb_fix.smem_start;
 
+       if (!request_mem_region(q40fb_fix.smem_start, q40fb_fix.smem_len,
+                               "q40fb")) {
+               dev_err(&dev->dev, "cannot reserve video memory at 0x%lx\n",
+                       q40fb_fix.smem_start);
+       }
+
        if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
                framebuffer_release(info);
                return -ENOMEM;
@@ -144,6 +150,7 @@ static int __init q40fb_init(void)
                if (ret)
                        platform_driver_unregister(&q40fb_driver);
        }
+
        return ret;
 }
 
-- 
2.43.0

Reply via email to