fbdev: move FBIO_WAITFORVSYNC to linux/fb.h
[safe/jmp/linux-2.6] / drivers / video / fm2fb.c
index a076328..1b0feb8 100644 (file)
@@ -172,7 +172,6 @@ static struct fb_ops fm2fb_ops = {
        .fb_fillrect    = cfb_fillrect,
        .fb_copyarea    = cfb_copyarea,
        .fb_imageblit   = cfb_imageblit,
-       .fb_cursor      = soft_cursor,
 };
 
     /*
@@ -196,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;
 }
 
@@ -218,6 +219,7 @@ static struct zorro_device_id fm2fb_devices[] __devinitdata = {
        { ZORRO_PROD_HELFRICH_RAINBOW_II },
        { 0 }
 };
+MODULE_DEVICE_TABLE(zorro, fm2fb_devices);
 
 static struct zorro_driver fm2fb_driver = {
        .name           = "fm2fb",
@@ -238,7 +240,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;
@@ -284,6 +286,7 @@ static int __devinit fm2fb_probe(struct zorro_dev *z,
 
        if (register_framebuffer(info) < 0) {
                fb_dealloc_cmap(&info->cmap);
+               iounmap(info->screen_base);
                framebuffer_release(info);
                zorro_release_device(z);
                return -EINVAL;