linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ths@linux-mips.org
Date: Fri, 04 Mar 2005 19:40:51 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ths@ftp.linux-mips.org  05/03/04 19:40:45

Modified files:
        drivers/video  : gbefb.c 

Log message:
        It helps to not use a _mem_ function for requesting I/O space.

diff -urN linux/drivers/video/gbefb.c linux/drivers/video/gbefb.c
--- linux/drivers/video/gbefb.c 2004/11/21 17:13:11     1.13
+++ linux/drivers/video/gbefb.c 2005/03/04 19:40:45     1.14
@@ -1126,7 +1126,7 @@
        gbefb_setup(options);
 #endif
 
-       if (!request_mem_region(GBE_BASE, sizeof(struct sgi_gbe), "GBE")) {
+       if (!request_region(GBE_BASE, sizeof(struct sgi_gbe), "GBE")) {
                printk(KERN_ERR "gbefb: couldn't reserve mmio region\n");
                ret = -EBUSY;
                goto out_release_framebuffer;
@@ -1152,12 +1152,24 @@
        if (gbe_mem_phys) {
                /* memory was allocated at boot time */
                gbe_mem = ioremap_nocache(gbe_mem_phys, gbe_mem_size);
+               if (!gbe_mem) {
+                       printk(KERN_ERR "gbefb: couldn't map framebuffer\n");
+                       ret = -ENOMEM;
+                       goto out_tiles_free;
+               }
+
                gbe_dma_addr = 0;
        } else {
                /* try to allocate memory with the classical allocator
                 * this has high chance to fail on low memory machines */
                gbe_mem = dma_alloc_coherent(NULL, gbe_mem_size, &gbe_dma_addr,
                                             GFP_KERNEL);
+               if (!gbe_mem) {
+                       printk(KERN_ERR "gbefb: couldn't allocate framebuffer 
memory\n");
+                       ret = -ENOMEM;
+                       goto out_tiles_free;
+               }
+
                gbe_mem_phys = (unsigned long) gbe_dma_addr;
        }
 
@@ -1165,12 +1177,6 @@
        mtrr_add(gbe_mem_phys, gbe_mem_size, MTRR_TYPE_WRCOMB, 1);
 #endif
 
-       if (!gbe_mem) {
-               printk(KERN_ERR "gbefb: couldn't map framebuffer\n");
-               ret = -ENXIO;
-               goto out_tiles_free;
-       }
-
        /* map framebuffer memory into tiles table */
        for (i = 0; i < (gbe_mem_size >> TILE_SHIFT); i++)
                gbe_tiles.cpu[i] = (gbe_mem_phys >> TILE_SHIFT) + i;

<Prev in Thread] Current Thread [Next in Thread>