| .. | .. |
|---|
| 193 | 193 | static int num_registered = 0; |
|---|
| 194 | 194 | |
|---|
| 195 | 195 | /* fb ops */ |
|---|
| 196 | | -static struct fb_ops intel_fb_ops = { |
|---|
| 196 | +static const struct fb_ops intel_fb_ops = { |
|---|
| 197 | 197 | .owner = THIS_MODULE, |
|---|
| 198 | 198 | .fb_open = intelfb_open, |
|---|
| 199 | 199 | .fb_release = intelfb_release, |
|---|
| .. | .. |
|---|
| 491 | 491 | } |
|---|
| 492 | 492 | |
|---|
| 493 | 493 | 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 | + |
|---|
| 498 | 497 | if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) { |
|---|
| 499 | 498 | ERR_MSG("Could not allocate cmap for intelfb_info.\n"); |
|---|
| 500 | 499 | goto err_out_cmap; |
|---|
| .. | .. |
|---|
| 655 | 654 | } |
|---|
| 656 | 655 | |
|---|
| 657 | 656 | dinfo->mmio_base = |
|---|
| 658 | | - (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, |
|---|
| 657 | + (u8 __iomem *)ioremap(dinfo->mmio_base_phys, |
|---|
| 659 | 658 | INTEL_REG_SIZE); |
|---|
| 660 | 659 | if (!dinfo->mmio_base) { |
|---|
| 661 | 660 | ERR_MSG("Cannot remap MMIO region.\n"); |
|---|
| .. | .. |
|---|
| 1215 | 1214 | |
|---|
| 1216 | 1215 | dinfo = GET_DINFO(info); |
|---|
| 1217 | 1216 | |
|---|
| 1217 | + if (!var->pixclock) |
|---|
| 1218 | + return -EINVAL; |
|---|
| 1219 | + |
|---|
| 1218 | 1220 | /* update the pitch */ |
|---|
| 1219 | 1221 | if (intelfbhw_validate_mode(dinfo, var) != 0) |
|---|
| 1220 | 1222 | return -EINVAL; |
|---|