Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[safe/jmp/linux-2.6] / drivers / video / uvesafb.c
index a14ef89..6c2d37f 100644 (file)
@@ -44,7 +44,7 @@ static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {
 
 static int mtrr                __devinitdata = 3; /* enable mtrr by default */
 static int blank       = 1;               /* enable blanking by default */
-static int ypan                __devinitdata = 1; /* 0: scroll, 1: ypan, 2: ywrap */
+static int ypan                = 1;             /* 0: scroll, 1: ypan, 2: ywrap */
 static int pmi_setpal  __devinitdata = 1; /* use PMI for palette changes */
 static int nocrtc      __devinitdata; /* ignore CRTC settings */
 static int noedid      __devinitdata; /* don't try DDC transfers */
@@ -181,7 +181,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
        /* If all slots are taken -- bail out. */
        if (uvfb_tasks[seq]) {
                mutex_unlock(&uvfb_lock);
-               return -EBUSY;
+               err = -EBUSY;
+               goto out;
        }
 
        /* Save a pointer to the kernel part of the task struct. */
@@ -205,7 +206,6 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
                        err = cn_netlink_send(m, 0, gfp_any());
                }
        }
-       kfree(m);
 
        if (!err && !(task->t.flags & TF_EXIT))
                err = !wait_for_completion_timeout(task->done,
@@ -218,7 +218,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
        seq++;
        if (seq >= UVESAFB_TASKS_MAX)
                seq = 0;
-
+out:
+       kfree(m);
        return err;
 }
 
@@ -515,10 +516,12 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
 
                err = uvesafb_exec(task);
                if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
-                       printk(KERN_ERR "uvesafb: Getting mode info block "
+                       printk(KERN_WARNING "uvesafb: Getting mode info block "
                                "for mode 0x%x failed (eax=0x%x, err=%d)\n",
                                *mode, (u32)task->t.regs.eax, err);
-                       return -EINVAL;
+                       mode++;
+                       par->vbe_modes_cnt--;
+                       continue;
                }
 
                mib = task->buf;
@@ -547,7 +550,10 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
                        mib->depth = mib->bits_per_pixel;
        }
 
-       return 0;
+       if (par->vbe_modes_cnt > 0)
+               return 0;
+       else
+               return -EINVAL;
 }
 
 /*
@@ -885,7 +891,7 @@ static int __devinit uvesafb_vbe_init_mode(struct fb_info *info)
        }
 
        /* fb_find_mode() failed */
-       if (i == 0 || i >= 3) {
+       if (i == 0) {
                info->var.xres = 640;
                info->var.yres = 480;
                mode = (struct fb_videomode *)
@@ -2003,12 +2009,12 @@ static void __devexit uvesafb_exit(void)
 
 module_exit(uvesafb_exit);
 
-static inline int param_get_scroll(char *buffer, struct kernel_param *kp)
+static int param_get_scroll(char *buffer, struct kernel_param *kp)
 {
        return 0;
 }
 
-static inline int param_set_scroll(const char *val, struct kernel_param *kp)
+static int param_set_scroll(const char *val, struct kernel_param *kp)
 {
        ypan = 0;
 
@@ -2022,11 +2028,11 @@ static inline int param_set_scroll(const char *val, struct kernel_param *kp)
        return 0;
 }
 
-#define param_check_scroll(name, p) __param_check(name, p, void);
+#define param_check_scroll(name, p) __param_check(name, p, void)
 
 module_param_named(scroll, ypan, scroll, 0);
 MODULE_PARM_DESC(scroll,
-       "Scrolling mode, set to 'redraw', ''ypan' or 'ywrap'");
+       "Scrolling mode, set to 'redraw', 'ypan', or 'ywrap'");
 module_param_named(vgapal, pmi_setpal, invbool, 0);
 MODULE_PARM_DESC(vgapal, "Set palette using VGA registers");
 module_param_named(pmipal, pmi_setpal, bool, 0);
@@ -2053,8 +2059,8 @@ MODULE_PARM_DESC(maxhf,
 module_param(maxvf, ushort, 0);
 MODULE_PARM_DESC(maxvf,
        "Maximum vertical frequency [Hz], overrides EDID data");
-module_param_named(mode, mode_option, charp, 0);
-MODULE_PARM_DESC(mode,
+module_param(mode_option, charp, 0);
+MODULE_PARM_DESC(mode_option,
        "Specify initial video mode as \"<xres>x<yres>[-<bpp>][@<refresh>]\"");
 module_param(vbemode, ushort, 0);
 MODULE_PARM_DESC(vbemode,