| .. | .. |
|---|
| 42 | 42 | #include <linux/delay.h> |
|---|
| 43 | 43 | #include <linux/fb.h> |
|---|
| 44 | 44 | #include <linux/init.h> |
|---|
| 45 | | -#include <asm/pgtable.h> |
|---|
| 46 | 45 | |
|---|
| 47 | 46 | #ifdef CONFIG_ZORRO |
|---|
| 48 | 47 | #include <linux/zorro.h> |
|---|
| .. | .. |
|---|
| 470 | 469 | return 0; |
|---|
| 471 | 470 | } |
|---|
| 472 | 471 | |
|---|
| 473 | | -static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var, |
|---|
| 472 | +static int cirrusfb_check_pixclock(struct fb_var_screeninfo *var, |
|---|
| 474 | 473 | struct fb_info *info) |
|---|
| 475 | 474 | { |
|---|
| 476 | 475 | long freq; |
|---|
| .. | .. |
|---|
| 479 | 478 | unsigned maxclockidx = var->bits_per_pixel >> 3; |
|---|
| 480 | 479 | |
|---|
| 481 | 480 | /* convert from ps to kHz */ |
|---|
| 482 | | - freq = PICOS2KHZ(var->pixclock); |
|---|
| 483 | | - |
|---|
| 484 | | - dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq); |
|---|
| 481 | + freq = PICOS2KHZ(var->pixclock ? : 1); |
|---|
| 485 | 482 | |
|---|
| 486 | 483 | maxclock = cirrusfb_board_info[cinfo->btype].maxclock[maxclockidx]; |
|---|
| 487 | 484 | cinfo->multiplexing = 0; |
|---|
| .. | .. |
|---|
| 489 | 486 | /* If the frequency is greater than we can support, we might be able |
|---|
| 490 | 487 | * to use multiplexing for the video mode */ |
|---|
| 491 | 488 | if (freq > maxclock) { |
|---|
| 492 | | - dev_err(info->device, |
|---|
| 493 | | - "Frequency greater than maxclock (%ld kHz)\n", |
|---|
| 494 | | - maxclock); |
|---|
| 495 | | - return -EINVAL; |
|---|
| 489 | + var->pixclock = KHZ2PICOS(maxclock); |
|---|
| 490 | + |
|---|
| 491 | + while ((freq = PICOS2KHZ(var->pixclock)) > maxclock) |
|---|
| 492 | + var->pixclock++; |
|---|
| 496 | 493 | } |
|---|
| 494 | + dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq); |
|---|
| 495 | + |
|---|
| 497 | 496 | /* |
|---|
| 498 | 497 | * Additional constraint: 8bpp uses DAC clock doubling to allow maximum |
|---|
| 499 | 498 | * pixel clock |
|---|
| .. | .. |
|---|
| 1477 | 1476 | mdelay(100); |
|---|
| 1478 | 1477 | /* mode */ |
|---|
| 1479 | 1478 | vga_wgfx(cinfo->regbase, CL_GR31, 0x00); |
|---|
| 1480 | | - /* fall through */ |
|---|
| 1479 | + fallthrough; |
|---|
| 1481 | 1480 | case BT_GD5480: |
|---|
| 1482 | 1481 | /* from Klaus' NetBSD driver: */ |
|---|
| 1483 | 1482 | vga_wgfx(cinfo->regbase, CL_GR2F, 0x00); |
|---|
| 1484 | | - /* fall through */ |
|---|
| 1483 | + fallthrough; |
|---|
| 1485 | 1484 | case BT_ALPINE: |
|---|
| 1486 | 1485 | /* put blitter into 542x compat */ |
|---|
| 1487 | 1486 | vga_wgfx(cinfo->regbase, CL_GR33, 0x00); |
|---|
| .. | .. |
|---|
| 1956 | 1955 | #endif /* CONFIG_ZORRO */ |
|---|
| 1957 | 1956 | |
|---|
| 1958 | 1957 | /* function table of the above functions */ |
|---|
| 1959 | | -static struct fb_ops cirrusfb_ops = { |
|---|
| 1958 | +static const struct fb_ops cirrusfb_ops = { |
|---|
| 1960 | 1959 | .owner = THIS_MODULE, |
|---|
| 1961 | 1960 | .fb_open = cirrusfb_open, |
|---|
| 1962 | 1961 | .fb_release = cirrusfb_release, |
|---|
| .. | .. |
|---|
| 2093 | 2092 | |
|---|
| 2094 | 2093 | info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev); |
|---|
| 2095 | 2094 | if (!info) { |
|---|
| 2096 | | - printk(KERN_ERR "cirrusfb: could not allocate memory\n"); |
|---|
| 2097 | 2095 | ret = -ENOMEM; |
|---|
| 2098 | 2096 | goto err_out; |
|---|
| 2099 | 2097 | } |
|---|
| .. | .. |
|---|
| 2206 | 2204 | struct cirrusfb_info *cinfo; |
|---|
| 2207 | 2205 | |
|---|
| 2208 | 2206 | info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev); |
|---|
| 2209 | | - if (!info) { |
|---|
| 2210 | | - printk(KERN_ERR "cirrusfb: could not allocate memory\n"); |
|---|
| 2207 | + if (!info) |
|---|
| 2211 | 2208 | return -ENOMEM; |
|---|
| 2212 | | - } |
|---|
| 2213 | 2209 | |
|---|
| 2214 | 2210 | zcl = (const struct zorrocl *)ent->driver_data; |
|---|
| 2215 | 2211 | btype = zcl->type; |
|---|