X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fvideo%2Ffm2fb.c;h=6c91c61cdb63824f1482e08407b8390ee8e59414;hb=d4c9b736080056ae3ba81dcf2ac418193c57dbb1;hp=70ff55b1459675db71c6025e588129446434cbf4;hpb=678f2b7df24c34f90fee264fa3a8069bca9c99ad;p=linux-2.6-omap-h63xx.git diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c index 70ff55b1459..6c91c61cdb6 100644 --- a/drivers/video/fm2fb.c +++ b/drivers/video/fm2fb.c @@ -195,13 +195,15 @@ static int fm2fb_blank(int blank, struct fb_info *info) static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - if (regno > info->cmap.len) - return 1; - red >>= 8; - green >>= 8; - blue >>= 8; + if (regno < 16) { + red >>= 8; + green >>= 8; + blue >>= 8; + + ((u32*)(info->pseudo_palette))[regno] = (red << 16) | + (green << 8) | blue; + } - ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | blue; return 0; } @@ -237,7 +239,7 @@ static int __devinit fm2fb_probe(struct zorro_dev *z, if (!zorro_request_device(z,"fm2fb")) return -ENXIO; - info = framebuffer_alloc(256 * sizeof(u32), &z->dev); + info = framebuffer_alloc(16 * sizeof(u32), &z->dev); if (!info) { zorro_release_device(z); return -ENOMEM;