forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/video/fbdev/intelfb/intelfbdrv.c
....@@ -193,7 +193,7 @@
193193 static int num_registered = 0;
194194
195195 /* fb ops */
196
-static struct fb_ops intel_fb_ops = {
196
+static const struct fb_ops intel_fb_ops = {
197197 .owner = THIS_MODULE,
198198 .fb_open = intelfb_open,
199199 .fb_release = intelfb_release,
....@@ -491,10 +491,9 @@
491491 }
492492
493493 info = framebuffer_alloc(sizeof(struct intelfb_info), &pdev->dev);
494
- if (!info) {
495
- ERR_MSG("Could not allocate memory for intelfb_info.\n");
496
- return -ENODEV;
497
- }
494
+ if (!info)
495
+ return -ENOMEM;
496
+
498497 if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
499498 ERR_MSG("Could not allocate cmap for intelfb_info.\n");
500499 goto err_out_cmap;
....@@ -655,7 +654,7 @@
655654 }
656655
657656 dinfo->mmio_base =
658
- (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys,
657
+ (u8 __iomem *)ioremap(dinfo->mmio_base_phys,
659658 INTEL_REG_SIZE);
660659 if (!dinfo->mmio_base) {
661660 ERR_MSG("Cannot remap MMIO region.\n");
....@@ -1215,6 +1214,9 @@
12151214
12161215 dinfo = GET_DINFO(info);
12171216
1217
+ if (!var->pixclock)
1218
+ return -EINVAL;
1219
+
12181220 /* update the pitch */
12191221 if (intelfbhw_validate_mode(dinfo, var) != 0)
12201222 return -EINVAL;