drm/radeon/kms/evergreen: fix LUT setup
[safe/jmp/linux-2.6] / drivers / video / sstfb.c
index 62fa550..79840f1 100644 (file)
@@ -88,7 +88,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <asm/io.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <video/sstfb.h>
 
 
@@ -1006,7 +1006,7 @@ static int sst_set_pll_att_ti(struct fb_info *info,
                break;
        default:
                dprintk("%s: wrong clock code '%d'\n",
-                       __FUNCTION__, clock);
+                       __func__, clock);
                return 0;
                }
        udelay(300);
@@ -1048,7 +1048,7 @@ static int sst_set_pll_ics(struct fb_info *info,
                break;
        default:
                dprintk("%s: wrong clock code '%d'\n",
-                       __FUNCTION__, clock);
+                       __func__, clock);
                return 0;
                }
        udelay(300);
@@ -1079,7 +1079,7 @@ static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp)
                sst_dac_write(DACREG_RMR, (cr0 & 0x0f) | DACREG_CR0_16BPP);
                break;
        default:
-               dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp);
+               dprintk("%s: bad depth '%u'\n", __func__, bpp);
                break;
        }
 }
@@ -1093,7 +1093,7 @@ static void sst_set_vidmod_ics(struct fb_info *info, const int bpp)
                sst_dac_write(DACREG_ICS_CMD, DACREG_ICS_CMD_16BPP);
                break;
        default:
-               dprintk("%s: bad depth '%u'\n", __FUNCTION__, bpp);
+               dprintk("%s: bad depth '%u'\n", __func__, bpp);
                break;
        }
 }
@@ -1102,7 +1102,7 @@ static void sst_set_vidmod_ics(struct fb_info *info, const int bpp)
  * detect dac type
  * prerequisite : write to FbiInitx enabled, video and fbi and pci fifo reset,
  * dram refresh disabled, FbiInit remaped.
- * TODO: mmh.. maybe i shoud put the "prerequisite" in the func ...
+ * TODO: mmh.. maybe i should put the "prerequisite" in the func ...
  */
 
 
@@ -1133,7 +1133,7 @@ static int __devinit sst_detect_dactype(struct fb_info *info, struct sstfb_par *
        }
        if (!ret)
                return 0;
-       f_dprintk("%s found %s\n", __FUNCTION__, dacs[i].name);
+       f_dprintk("%s found %s\n", __func__, dacs[i].name);
        par->dac_sw = dacs[i];
        return 1;
 }
@@ -1348,7 +1348,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
        f_ddprintk("found device : %s\n", spec->name);
 
        par->dev = pdev;
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &par->revision);
+       par->revision = pdev->revision;
 
        fix->mmio_start = pci_resource_start(pdev,0);
        fix->mmio_len   = 0x400000;
@@ -1421,13 +1421,16 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
                goto fail;
        }
        
-       fb_alloc_cmap(&info->cmap, 256, 0);
+       if (fb_alloc_cmap(&info->cmap, 256, 0)) {
+               printk(KERN_ERR "sstfb: can't alloc cmap memory.\n");
+               goto fail;
+       }
 
        /* register fb */
        info->device = &pdev->dev;
        if (register_framebuffer(info) < 0) {
                printk(KERN_ERR "sstfb: can't register framebuffer.\n");
-               goto fail;
+               goto fail_register;
        }
 
        sstfb_clear_screen(info);
@@ -1441,8 +1444,9 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
 
        return 0;
 
-fail:
+fail_register:
        fb_dealloc_cmap(&info->cmap);
+fail:
        iounmap(info->screen_base);
 fail_fb_remap:
        iounmap(par->mmio_vbase);