.. | .. |
---|
70 | 70 | * Frame buffer operations |
---|
71 | 71 | */ |
---|
72 | 72 | |
---|
73 | | -static struct fb_ops tgafb_ops = { |
---|
| 73 | +static const struct fb_ops tgafb_ops = { |
---|
74 | 74 | .owner = THIS_MODULE, |
---|
75 | 75 | .fb_check_var = tgafb_check_var, |
---|
76 | 76 | .fb_set_par = tgafb_set_par, |
---|
.. | .. |
---|
989 | 989 | /* We can fill 2k pixels per operation. Notice blocks that fit |
---|
990 | 990 | the width of the screen so that we can take advantage of this |
---|
991 | 991 | and fill more than one line per write. */ |
---|
992 | | - if (width == line_length) |
---|
993 | | - width *= height, height = 1; |
---|
| 992 | + if (width == line_length) { |
---|
| 993 | + width *= height; |
---|
| 994 | + height = 1; |
---|
| 995 | + } |
---|
994 | 996 | |
---|
995 | 997 | /* The write into the frame buffer must be aligned to 4 bytes, |
---|
996 | 998 | but we are allowed to encode the offset within the word in |
---|
.. | .. |
---|
1171 | 1173 | More than anything else, these control how we do copies. */ |
---|
1172 | 1174 | depos = dy * line_length + dx; |
---|
1173 | 1175 | sepos = sy * line_length + sx; |
---|
1174 | | - if (backward) |
---|
1175 | | - depos += width, sepos += width; |
---|
| 1176 | + if (backward) { |
---|
| 1177 | + depos += width; |
---|
| 1178 | + sepos += width; |
---|
| 1179 | + } |
---|
1176 | 1180 | |
---|
1177 | 1181 | /* Next copy full words at a time. */ |
---|
1178 | 1182 | n32 = width / 32; |
---|
.. | .. |
---|
1416 | 1420 | |
---|
1417 | 1421 | /* Allocate the fb and par structures. */ |
---|
1418 | 1422 | info = framebuffer_alloc(sizeof(struct tga_par), dev); |
---|
1419 | | - if (!info) { |
---|
1420 | | - printk(KERN_ERR "tgafb: Cannot allocate memory\n"); |
---|
| 1423 | + if (!info) |
---|
1421 | 1424 | return -ENOMEM; |
---|
1422 | | - } |
---|
1423 | 1425 | |
---|
1424 | 1426 | par = info->par; |
---|
1425 | 1427 | dev_set_drvdata(dev, info); |
---|
.. | .. |
---|
1440 | 1442 | } |
---|
1441 | 1443 | |
---|
1442 | 1444 | /* Map the framebuffer. */ |
---|
1443 | | - mem_base = ioremap_nocache(bar0_start, bar0_len); |
---|
| 1445 | + mem_base = ioremap(bar0_start, bar0_len); |
---|
1444 | 1446 | if (!mem_base) { |
---|
1445 | 1447 | printk(KERN_ERR "tgafb: Cannot map MMIO\n"); |
---|
1446 | 1448 | goto err1; |
---|