| .. | .. |
|---|
| 54 | 54 | #define DPRINTK(a, b...) \ |
|---|
| 55 | 55 | printk(KERN_DEBUG "pm2fb: %s: " a, __func__ , ## b) |
|---|
| 56 | 56 | #else |
|---|
| 57 | | -#define DPRINTK(a, b...) |
|---|
| 57 | +#define DPRINTK(a, b...) no_printk(a, ##b) |
|---|
| 58 | 58 | #endif |
|---|
| 59 | 59 | |
|---|
| 60 | 60 | #define PM2_PIXMAP_SIZE (1600 * 4) |
|---|
| .. | .. |
|---|
| 233 | 233 | switch (bpp) { |
|---|
| 234 | 234 | case 24: |
|---|
| 235 | 235 | timing *= 3; |
|---|
| 236 | | - /* fall through */ |
|---|
| 236 | + fallthrough; |
|---|
| 237 | 237 | case 8: |
|---|
| 238 | 238 | timing >>= 1; |
|---|
| 239 | | - /* fall through */ |
|---|
| 239 | + fallthrough; |
|---|
| 240 | 240 | case 16: |
|---|
| 241 | 241 | timing >>= 1; |
|---|
| 242 | 242 | case 32: |
|---|
| .. | .. |
|---|
| 613 | 613 | if (lpitch * var->yres_virtual > info->fix.smem_len) { |
|---|
| 614 | 614 | DPRINTK("no memory for screen (%ux%ux%u)\n", |
|---|
| 615 | 615 | var->xres, var->yres_virtual, var->bits_per_pixel); |
|---|
| 616 | + return -EINVAL; |
|---|
| 617 | + } |
|---|
| 618 | + |
|---|
| 619 | + if (!var->pixclock) { |
|---|
| 620 | + DPRINTK("pixclock is zero\n"); |
|---|
| 616 | 621 | return -EINVAL; |
|---|
| 617 | 622 | } |
|---|
| 618 | 623 | |
|---|
| .. | .. |
|---|
| 1483 | 1488 | * Frame buffer operations |
|---|
| 1484 | 1489 | */ |
|---|
| 1485 | 1490 | |
|---|
| 1486 | | -static struct fb_ops pm2fb_ops = { |
|---|
| 1491 | +static const struct fb_ops pm2fb_ops = { |
|---|
| 1487 | 1492 | .owner = THIS_MODULE, |
|---|
| 1488 | 1493 | .fb_check_var = pm2fb_check_var, |
|---|
| 1489 | 1494 | .fb_set_par = pm2fb_set_par, |
|---|
| .. | .. |
|---|
| 1563 | 1568 | goto err_exit_neither; |
|---|
| 1564 | 1569 | } |
|---|
| 1565 | 1570 | default_par->v_regs = |
|---|
| 1566 | | - ioremap_nocache(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len); |
|---|
| 1571 | + ioremap(pm2fb_fix.mmio_start, pm2fb_fix.mmio_len); |
|---|
| 1567 | 1572 | if (!default_par->v_regs) { |
|---|
| 1568 | 1573 | printk(KERN_WARNING "pm2fb: Can't remap %s register area.\n", |
|---|
| 1569 | 1574 | pm2fb_fix.id); |
|---|