patch-2.3.14 linux/drivers/video/sgivwfb.c

Next file: linux/drivers/video/skeletonfb.c
Previous file: linux/drivers/video/sbusfb.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/drivers/video/sgivwfb.c linux/drivers/video/sgivwfb.c
@@ -89,7 +89,7 @@
 /*
  *  Interface used by the world
  */
-void sgivwfb_setup(char *options, int *ints);
+int sgivwfb_setup(char*);
 
 static int sgivwfb_open(struct fb_info *info, int user);
 static int sgivwfb_release(struct fb_info *info, int user);
@@ -126,7 +126,7 @@
 /*
  *  Interface to the low level console driver
  */
-void sgivwfb_init(void);
+int sgivwfb_init(void);
 static int sgivwfbcon_switch(int con, struct fb_info *info);
 static int sgivwfbcon_updatevar(int con, struct fb_info *info);
 static void sgivwfbcon_blank(int blank, struct fb_info *info);
@@ -165,7 +165,7 @@
     length = 4;
     break;
   default:
-    printk("sgivwfb: unsupported bpp=%d\n", bpp);
+    printk(KERN_INFO "sgivwfb: unsupported bpp=%d\n", bpp);
     length = 0;
     break;
   }
@@ -271,7 +271,7 @@
   if (wholeTilesX*maxPixelsPerTileX < xpmax)
     wholeTilesX++;
 
-  printk("sgivwfb: pixPerTile=%d wholeTilesX=%d\n",
+  printk(KERN_DEBUG "sgivwfb: pixPerTile=%d wholeTilesX=%d\n",
 	 maxPixelsPerTileX, wholeTilesX);
 
   /* dbe_InitGammaMap(); */
@@ -465,7 +465,7 @@
     }
 
   if (i==100000)
-    printk("sgivwfb: timeout waiting for frame DMA enable.\n");
+    printk(KERN_INFO "sgivwfb: timeout waiting for frame DMA enable.\n");
 
   outputVal = 0;
   htmp = currentTiming->hblank_end - 19;
@@ -688,7 +688,7 @@
   /* XXX FIXME - should try to pick best refresh rate */
   /* for now, pick closest dot-clock within 3MHz*/
   req_dot = (int)((1.0e3/1.0e6) / (1.0e-12 * (float)var->pixclock));
-  printk("sgivwfb: requested pixclock=%d ps (%d KHz)\n", var->pixclock,
+  printk(KERN_INFO "sgivwfb: requested pixclock=%d ps (%d KHz)\n", var->pixclock,
 	 req_dot);
   test_mode=min_mode;
   while (dbeVTimings[min_mode].width == dbeVTimings[test_mode].width) {
@@ -700,7 +700,7 @@
     test_mode--;
   min_mode = test_mode;
   timing = &dbeVTimings[min_mode];
-  printk("sgivwfb: granted dot-clock=%d KHz\n", timing->cfreq);
+  printk(KERN_INFO "sgivwfb: granted dot-clock=%d KHz\n", timing->cfreq);
 
   /* Adjust virtual resolution, if necessary */
   if (var->xres > var->xres_virtual || (!ywrap && !ypan))
@@ -775,9 +775,9 @@
 	oldvxres != var->xres_virtual || oldvyres != var->yres_virtual ||
 	oldbpp != var->bits_per_pixel || !par_current.valid) {
       struct fb_fix_screeninfo fix;
-      printk("sgivwfb: new video mode xres=%d yres=%d bpp=%d\n",
+      printk(KERN_INFO "sgivwfb: new video mode xres=%d yres=%d bpp=%d\n",
 	     var->xres, var->yres, var->bits_per_pixel);
-      printk("         vxres=%d vyres=%d\n",
+      printk(KERN_INFO "         vxres=%d vyres=%d\n",
 	     var->xres_virtual, var->yres_virtual);
       activate_par(&par_current);
       sgivwfb_encode_fix(&fix, var);
@@ -915,37 +915,38 @@
   if (remap_page_range(vma->vm_start, offset, size, vma->vm_page_prot))
     return -EAGAIN;
   vma->vm_file = file;
-  printk("sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n", offset, vma->vm_start);
+  printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n", offset, vma->vm_start);
   return 0;
 }
 
-void __init sgivwfb_setup(char *options, int *ints)
+int __init sgivwfb_setup(char *options)
 {
   char *this_opt;
 
   fb_info.fontname[0] = '\0';
 
   if (!options || !*options)
-    return;
+    return 0;
 
   for (this_opt = strtok(options, ","); this_opt;
        this_opt = strtok(NULL, ",")) {
     if (!strncmp(this_opt, "font:", 5))
       strcpy(fb_info.fontname, this_opt+5);
   }
+  return 0;
 }
 
 /*
  *  Initialisation
  */
-void __init sgivwfb_init(void)
+int __init sgivwfb_init(void)
 {
-  printk("sgivwfb: framebuffer at 0x%lx, size %ldk\n",
+  printk(KERN_INFO "sgivwfb: framebuffer at 0x%lx, size %ldk\n",
 	 sgivwfb_mem_phys, sgivwfb_mem_size/1024);
 
   regs = (asregs*)ioremap_nocache(DBE_REG_PHYS, DBE_REG_SIZE);
   if (!regs) {
-    printk("sgivwfb: couldn't ioremap registers\n");
+    printk(KERN_ERR "sgivwfb: couldn't ioremap registers\n");
     goto fail_ioremap_regs;
   }
 
@@ -965,7 +966,7 @@
 
   fbmem = ioremap_nocache((unsigned long)sgivwfb_mem_phys, sgivwfb_mem_size);
   if (!fbmem) {
-    printk("sgivwfb: couldn't ioremap fbmem\n");
+    printk(KERN_ERR "sgivwfb: couldn't ioremap fbmem\n");
     goto fail_ioremap_fbmem;
   }
 
@@ -973,21 +974,21 @@
   sgivwfb_set_var(&par_current.var, -1, &fb_info);
 
   if (register_framebuffer(&fb_info) < 0) {
-    printk("sgivwfb: couldn't register framebuffer\n");
+    printk(KERN_ERR "sgivwfb: couldn't register framebuffer\n");
     goto fail_register_framebuffer;
   }
 
-  printk("fb%d: Virtual frame buffer device, using %ldK of video memory\n",
+  printk(KERN_INFO "fb%d: Virtual frame buffer device, using %ldK of video memory\n",
 	 GET_FB_IDX(fb_info.node), sgivwfb_mem_size>>10);
 
-  return;
+  return 0;
 
  fail_register_framebuffer:
   iounmap((char*)fbmem);
  fail_ioremap_fbmem:
   iounmap(regs);
  fail_ioremap_regs:
-  return;
+  return -ENXIO;
 }
 
 static int sgivwfbcon_switch(int con, struct fb_info *info)
@@ -1022,8 +1023,7 @@
 #ifdef MODULE
 int init_module(void)
 {
-  sgivwfb_init();
-  return 0;
+  return sgivwfb_init();
 }
 
 void cleanup_module(void)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)