hwmon: (f71882fg) Cleanup sysfs attr creation 1/2
[safe/jmp/linux-2.6] / drivers / video / atafb.c
index 497ff8a..b7687c5 100644 (file)
@@ -329,12 +329,6 @@ extern unsigned char fontdata_8x16[];
  *
  *     * perform fb specific mmap *
  *     int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);
- *
- *     * save current hardware state *
- *     void (*fb_save_state)(struct fb_info *info);
- *
- *     * restore saved state *
- *     void (*fb_restore_state)(struct fb_info *info);
  * } ;
  */
 
@@ -2248,6 +2242,9 @@ static int ext_setcolreg(unsigned int regno, unsigned int red,
        if (!external_vgaiobase)
                return 1;
 
+       if (regno > 255)
+               return 1;
+
        switch (external_card_type) {
        case IS_VGA:
                OUTB(0x3c8, regno);
@@ -2405,6 +2402,9 @@ static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive)
        return 0;
 }
 
+/* fbhw->encode_fix() must be called with fb_info->mm_lock held
+ * if it is called after the register_framebuffer() - not a case here
+ */
 static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
 {
        struct atafb_par par;
@@ -2414,9 +2414,7 @@ static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
        if (err)
                return err;
        memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-       mutex_lock(&info->mm_lock);
        err = fbhw->encode_fix(fix, &par);
-       mutex_unlock(&info->mm_lock);
        return err;
 }