Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63843
b: refs/heads/master
c: 9cd1c67
h: refs/heads/master
i:
  63841: ea9a005
  63839: 8137b6f
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Aug 11, 2007
1 parent 59cf39f commit 415b591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4769a9a53b39f3b6a7e4d0b3c5e6b9598560818d
refs/heads/master: 9cd1c67434544b1d9a4fb4a4cdec15608167a233
12 changes: 7 additions & 5 deletions trunk/drivers/video/pvr2fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ static struct pvr2fb_par {
unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */

unsigned long mmio_base; /* MMIO base */
u32 palette[16];
} *currentpar;

static struct fb_info *fb_info;
Expand Down Expand Up @@ -790,7 +791,7 @@ static int __devinit pvr2fb_common_init(void)
fb_info->fbops = &pvr2fb_ops;
fb_info->fix = pvr2_fix;
fb_info->par = currentpar;
fb_info->pseudo_palette = (void *)(fb_info->par + 1);
fb_info->pseudo_palette = currentpar->palette;
fb_info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;

if (video_output == VO_VGA)
Expand Down Expand Up @@ -1082,14 +1083,15 @@ static int __init pvr2fb_init(void)
#endif
size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32);

fb_info = kzalloc(size, GFP_KERNEL);
fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);

if (!fb_info) {
printk(KERN_ERR "Failed to allocate memory for fb_info\n");
return -ENOMEM;
}


currentpar = (struct pvr2fb_par *)(fb_info + 1);
currentpar = fb_info->par;

for (i = 0; i < ARRAY_SIZE(board_driver); i++) {
struct pvr2_board *pvr_board = board_driver + i;
Expand All @@ -1102,7 +1104,7 @@ static int __init pvr2fb_init(void)
if (ret != 0) {
printk(KERN_ERR "pvr2fb: Failed init of %s device\n",
pvr_board->name);
kfree(fb_info);
framebuffer_release(fb_info);
break;
}
}
Expand All @@ -1126,7 +1128,7 @@ static void __exit pvr2fb_exit(void)
#endif

unregister_framebuffer(fb_info);
kfree(fb_info);
framebuffer_release(fb_info);
}

module_init(pvr2fb_init);
Expand Down

0 comments on commit 415b591

Please sign in to comment.