[PATCH] au1100fb: info->var.rotate fix
[powerpc.git] / drivers / video / au1100fb.c
index d63c3f4..26086bf 100644 (file)
@@ -40,7 +40,6 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -165,10 +164,11 @@ int au1100fb_setmode(struct au1100fb_device *fbdev)
        }
 
        info->screen_size = info->fix.line_length * info->var.yres_virtual;
+       info->var.rotate = ((fbdev->panel->control_base&LCD_CONTROL_SM_MASK) \
+                               >> LCD_CONTROL_SM_BIT) * 90;
 
        /* Determine BPP mode and format */
-       fbdev->regs->lcd_control = fbdev->panel->control_base |
-                           ((info->var.rotate/90) << LCD_CONTROL_SM_BIT);
+       fbdev->regs->lcd_control = fbdev->panel->control_base;
 
        fbdev->regs->lcd_intenable = 0;
        fbdev->regs->lcd_intstatus = 0;
@@ -743,8 +743,7 @@ void __exit au1100fb_cleanup(void)
 {
        driver_unregister(&au1100fb_driver);
 
-       if (drv_info.opt_mode)
-               kfree(drv_info.opt_mode);
+       kfree(drv_info.opt_mode);
 }
 
 module_init(au1100fb_init);