[parisc-linux-cvs] Move non-pci things from /dev/ioports to /dev/mem

Richard Hirst rhirst@linuxcare.com
Tue, 3 Apr 2001 12:38:46 +0100


This changes ASP, LEDs, and parport to register under /dev/iomem,
rather than /dev/ioports.  ioports should be used just for PCI and
EISA busses.  These registrations were previously failing because
the addresses were outside the io port range anyway.

Richard


Index: arch/parisc/kernel/led.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/led.c,v
retrieving revision 1.15
diff -u -r1.15 led.c
--- led.c       2001/02/24 02:39:18     1.15
+++ led.c       2001/04/03 11:18:44
@@ -427,12 +427,12 @@
 {
        switch (lcd_info.model) {
        case DISPLAY_MODEL_LCD:
-               request_region((unsigned long)LCD_CMD_REG,  1, "lcd_cmd");
-               request_region((unsigned long)LCD_DATA_REG, 1, "lcd_data");
+               request_mem_region((unsigned long)LCD_CMD_REG,  1, "lcd_cmd");
+               request_mem_region((unsigned long)LCD_DATA_REG, 1, "lcd_data");
                break;
        case DISPLAY_MODEL_LASI:
        case DISPLAY_MODEL_OLD_ASP:
-               request_region((unsigned long)LED_DATA_REG, 1, "led_data");
+               request_mem_region((unsigned long)LED_DATA_REG, 1, "led_data");
                break;
        }
 }
Index: drivers/gsc/busdevice.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/busdevice.c,v
retrieving revision 1.18
diff -u -r1.18 busdevice.c
--- busdevice.c 2001/02/28 01:09:47     1.18
+++ busdevice.c 2001/04/03 11:18:44
@@ -220,10 +220,10 @@
            res->name = busdev->name;
            res->start = (unsigned long) busdev->hpa;
            res->end = res->start + 0x100000 - 1;
-           res->flags = IORESOURCE_IO;         /* do not mark it busy ! */
+           res->flags = IORESOURCE_MEM;        /* do not mark it busy ! */
            res->child = NULL;
-           request_resource(&ioport_resource, res);
-           request_region(res->start, OFFSET_IAR + sizeof(int), "reserved");
+           request_resource(&iomem_resource, res);
+           request_mem_region(res->start, OFFSET_IAR + sizeof(int), "reserved");
        }
 
 #if 0
Index: drivers/parport/parport_gsc.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/parport/parport_gsc.c,v
retrieving revision 1.9
diff -u -r1.9 parport_gsc.c
--- parport_gsc.c       2001/02/28 01:16:00     1.9
+++ parport_gsc.c       2001/04/03 11:18:45
@@ -347,13 +347,9 @@
        struct parport tmp;
        struct parport *p = &tmp;
 
-#if 1
-#warning Take this out when region handling works again, <deller@gmx,de>
-#else
-       if (check_region(base, 3)) 
+       if (check_mem_region(base, 3)) 
            return NULL;
-#endif
-           
+
        priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
        if (!priv) {
                printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
@@ -430,11 +426,11 @@
        printk("]\n");
        parport_proc_register(p);
 
-       request_region (p->base, 3, p->name);
+       request_mem_region (p->base, 3, p->name);
        if (p->size > 3)
-               request_region (p->base + 3, p->size - 3, p->name);
+               request_mem_region (p->base + 3, p->size - 3, p->name);
        if (p->modes & PARPORT_MODE_ECP)
-               request_region (p->base_hi, 3, p->name);
+               request_mem_region (p->base_hi, 3, p->name);
 
        if (p->irq != PARPORT_IRQ_NONE) {
                if (request_irq (p->irq, parport_gsc_interrupt,
@@ -532,11 +528,11 @@
                                free_dma(p->dma);
                        if (p->irq != PARPORT_IRQ_NONE)
                                free_irq(p->irq, p);
-                       release_region(p->base, 3);
+                       release_mem_region(p->base, 3);
                        if (p->size > 3)
-                               release_region(p->base + 3, p->size - 3);
+                               release_mem_region(p->base + 3, p->size - 3);
                        if (p->modes & PARPORT_MODE_ECP)
-                               release_region(p->base_hi, 3);
+                               release_mem_region(p->base_hi, 3);
                        parport_proc_unregister(p);
                        if (priv->dma_buf)
                                pci_free_consistent(priv->dev, PAGE_SIZE,