[PATCH] atyfb: Fix __init and __devinit annotations
[powerpc.git] / drivers / video / aty / atyfb_base.c
index d1e5007..7636f10 100644 (file)
@@ -249,7 +249,7 @@ static int atyfb_sync(struct fb_info *info);
      *  Internal routines
      */
 
-static int aty_init(struct fb_info *info, const char *name);
+static int aty_init(struct fb_info *info);
 #ifdef CONFIG_ATARI
 static int store_video_par(char *videopar, unsigned char m64_num);
 #endif
@@ -2344,17 +2344,13 @@ static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
 }
 #endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */
 
-static int __devinit aty_init(struct fb_info *info, const char *name)
+static int __devinit aty_init(struct fb_info *info)
 {
        struct atyfb_par *par = (struct atyfb_par *) info->par;
        const char *ramname = NULL, *xtal;
        int gtb_memsize, has_var = 0;
        struct fb_var_screeninfo var;
-       u8 pll_ref_div;
        u32 i;
-#if defined(CONFIG_PPC)
-       int sense;
-#endif
 
        init_waitqueue_head(&par->vblank.wait);
        spin_lock_init(&par->int_lock);
@@ -2464,18 +2460,21 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
                        par->pll_limits.mclk = 63;
        }
 
-       if (M64_HAS(GTB_DSP)
-           && (pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par))) {
-               int diff1, diff2;
-               diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max;
-               diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max;
-               if (diff1 < 0)
-                       diff1 = -diff1;
-               if (diff2 < 0)
-                       diff2 = -diff2;
-               if (diff2 < diff1) {
-                       par->ref_clk_per = 1000000000000ULL / 29498928;
-                       xtal = "29.498928";
+       if (M64_HAS(GTB_DSP)) {
+               u8 pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
+
+               if (pll_ref_div) {
+                       int diff1, diff2;
+                       diff1 = 510 * 14 / pll_ref_div - par->pll_limits.pll_max;
+                       diff2 = 510 * 29 / pll_ref_div - par->pll_limits.pll_max;
+                       if (diff1 < 0)
+                               diff1 = -diff1;
+                       if (diff2 < 0)
+                               diff2 = -diff2;
+                       if (diff2 < diff1) {
+                               par->ref_clk_per = 1000000000000ULL / 29498928;
+                               xtal = "29.498928";
+                       }
                }
        }
 #endif /* CONFIG_FB_ATY_CT */
@@ -2668,6 +2667,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
                                has_var = 1;
                } else {
                        if (default_vmode == VMODE_CHOOSE) {
+                               int sense;
                                if (M64_HAS(G3_PB_1024x768))
                                        /* G3 PowerBook with 1024x768 LCD */
                                        default_vmode = VMODE_1024_768_60;
@@ -2748,7 +2748,7 @@ static int __devinit aty_init(struct fb_info *info, const char *name)
        fb_list = info;
 
        PRINTKI("fb%d: %s frame buffer device on %s\n",
-              info->node, info->fix.id, name);
+               info->node, info->fix.id, par->bus_type == ISA ? "ISA" : "PCI");
        return 0;
 
 aty_init_exit:
@@ -2825,9 +2825,9 @@ static int atyfb_blank(int blank, struct fb_info *info)
 #endif
 
        gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par);
+       gen_cntl &= ~0x400004c;
        switch (blank) {
-               case FB_BLANK_UNBLANK:
-                       gen_cntl &= ~0x400004c;
+               case FB_BLANK_UNBLANK:
                        break;
                case FB_BLANK_NORMAL:
                        gen_cntl |= 0x4000040;
@@ -3181,7 +3181,7 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev,
 
 #ifdef __i386__
 #ifdef CONFIG_FB_ATY_GENERIC_LCD
-static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
+static void __devinit aty_init_lcd(struct atyfb_par *par, u32 bios_base)
 {
        u32 driv_inf_tab, sig;
        u16 lcd_ofs;
@@ -3597,7 +3597,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi
        pci_set_drvdata(pdev, info);
 
        /* Init chip & register framebuffer */
-       if (aty_init(info, "PCI"))
+       if (aty_init(info))
                goto err_release_io;
 
 #ifdef __sparc__
@@ -3644,7 +3644,7 @@ err_release_mem:
 
 #ifdef CONFIG_ATARI
 
-static int __devinit atyfb_atari_probe(void)
+static int __init atyfb_atari_probe(void)
 {
        struct atyfb_par *par;
        struct fb_info *info;
@@ -3697,7 +3697,7 @@ static int __devinit atyfb_atari_probe(void)
                        break;
                }
 
-               if (aty_init(info, "ISA bus")) {
+               if (aty_init(info)) {
                        if (info->screen_base)
                                iounmap(info->screen_base);
                        if (par->ati_regbase)
@@ -3711,6 +3711,8 @@ static int __devinit atyfb_atari_probe(void)
 
 #endif /* CONFIG_ATARI */
 
+#ifdef CONFIG_PCI
+
 static void __devexit atyfb_remove(struct fb_info *info)
 {
        struct atyfb_par *par = (struct atyfb_par *) info->par;
@@ -3758,7 +3760,6 @@ static void __devexit atyfb_remove(struct fb_info *info)
        framebuffer_release(info);
 }
 
-#ifdef CONFIG_PCI
 
 static void __devexit atyfb_pci_remove(struct pci_dev *pdev)
 {
@@ -3793,7 +3794,7 @@ static struct pci_driver atyfb_driver = {
 #endif /* CONFIG_PCI */
 
 #ifndef MODULE
-static int __devinit atyfb_setup(char *options)
+static int __init atyfb_setup(char *options)
 {
        char *this_opt;
 
@@ -3865,7 +3866,7 @@ static int __devinit atyfb_setup(char *options)
 }
 #endif  /*  MODULE  */
 
-static int __devinit atyfb_init(void)
+static int __init atyfb_init(void)
 {
     int err1 = 1, err2 = 1;
 #ifndef MODULE