]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/aty/aty128fb.c
driver core: remove DEVICE_NAME_SIZE define
[linux-2.6-omap-h63xx.git] / drivers / video / aty / aty128fb.c
index e86d7e0c98254eaa3af3370e52d789b437a765c8..07b6addbb3c1a2631990db635e238703a891a82c 100644 (file)
@@ -56,7 +56,7 @@
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -91,7 +91,7 @@
 #undef DEBUG
 
 #ifdef DEBUG
-#define DBG(fmt, args...)              printk(KERN_DEBUG "aty128fb: %s " fmt, __FUNCTION__, ##args);
+#define DBG(fmt, args...)              printk(KERN_DEBUG "aty128fb: %s " fmt, __func__, ##args);
 #else
 #define DBG(fmt, args...)
 #endif
@@ -1733,7 +1733,7 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par,
 
 static int aty128_bl_update_status(struct backlight_device *bd)
 {
-       struct aty128fb_par *par = class_get_devdata(&bd->class_dev);
+       struct aty128fb_par *par = bl_get_data(bd);
        unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL);
        int level;
 
@@ -1872,7 +1872,7 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
        struct fb_info *info = pci_get_drvdata(pdev);
        struct aty128fb_par *par = info->par;
        struct fb_var_screeninfo var;
-       char video_card[DEVICE_NAME_SIZE];
+       char video_card[50];
        u8 chip_rev;
        u32 dac;
 
@@ -1885,7 +1885,7 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
 
        /* range check to make sure */
        if (ent->driver_data < ARRAY_SIZE(r128_family))
-           strncat(video_card, r128_family[ent->driver_data], sizeof(video_card));
+           strlcat(video_card, r128_family[ent->driver_data], sizeof(video_card));
 
        printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);
 
@@ -2165,18 +2165,29 @@ static void __devexit aty128_remove(struct pci_dev *pdev)
 static int aty128fb_blank(int blank, struct fb_info *fb)
 {
        struct aty128fb_par *par = fb->par;
-       u8 state = 0;
+       u8 state;
 
        if (par->lock_blank || par->asleep)
                return 0;
 
-       if (blank & FB_BLANK_VSYNC_SUSPEND)
-               state |= 2;
-       if (blank & FB_BLANK_HSYNC_SUSPEND)
-               state |= 1;
-       if (blank & FB_BLANK_POWERDOWN)
-               state |= 4;
-
+       switch (blank) {
+       case FB_BLANK_NORMAL:
+               state = 4;
+               break;
+       case FB_BLANK_VSYNC_SUSPEND:
+               state = 6;
+               break;
+       case FB_BLANK_HSYNC_SUSPEND:
+               state = 5;
+               break;
+       case FB_BLANK_POWERDOWN:
+               state = 7;
+               break;
+       case FB_BLANK_UNBLANK:
+       default:
+               state = 0;
+               break;
+       }
        aty_st_8(CRTC_EXT_CNTL+1, state);
 
        if (par->chip_gen == rage_M3) {
@@ -2430,7 +2441,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state)
        wait_for_idle(par);
 
        /* Blank display and LCD */
-       aty128fb_blank(VESA_POWERDOWN, info);
+       aty128fb_blank(FB_BLANK_POWERDOWN, info);
 
        /* Sleep */
        par->asleep = 1;