fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / pnp / resource.c
index 80a6979..a685fbe 100644 (file)
@@ -6,7 +6,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/pnp.h>
 #include "base.h"
 
-int pnp_skip_pci_scan;                         /* skip PCI resource scanning */
-int pnp_reserve_irq[16] = { [0 ... 15] = -1 }; /* reserve (don't use) some IRQ */
-int pnp_reserve_dma[8] = { [0 ... 7] = -1 };   /* reserve (don't use) some DMA */
-int pnp_reserve_io[16] = { [0 ... 15] = -1 };  /* reserve (don't use) some I/O region */
-int pnp_reserve_mem[16] = { [0 ... 15] = -1 }; /* reserve (don't use) some memory region */
+static int pnp_reserve_irq[16] = { [0 ... 15] = -1 };  /* reserve (don't use) some IRQ */
+static int pnp_reserve_dma[8] = { [0 ... 7] = -1 };    /* reserve (don't use) some DMA */
+static int pnp_reserve_io[16] = { [0 ... 15] = -1 };   /* reserve (don't use) some I/O region */
+static int pnp_reserve_mem[16] = { [0 ... 15] = -1 };  /* reserve (don't use) some memory region */
 
 
 /*
@@ -103,7 +101,7 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
 
                for (i = 0; i < 16; i++)
                        if (test_bit(i, data->map))
-                               pcibios_penalize_isa_irq(i);
+                               pcibios_penalize_isa_irq(i, 0);
        }
 #endif
        return 0;
@@ -242,7 +240,7 @@ int pnp_check_port(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long *port, *end, *tport, *tend;
+       resource_size_t *port, *end, *tport, *tend;
        port = &dev->res.port_resource[idx].start;
        end = &dev->res.port_resource[idx].end;
 
@@ -298,7 +296,7 @@ int pnp_check_mem(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long *addr, *end, *taddr, *tend;
+       resource_size_t *addr, *end, *taddr, *tend;
        addr = &dev->res.mem_resource[idx].start;
        end = &dev->res.mem_resource[idx].end;
 
@@ -350,7 +348,7 @@ int pnp_check_mem(struct pnp_dev * dev, int idx)
        return 1;
 }
 
-static irqreturn_t pnp_test_handler(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pnp_test_handler(int irq, void *dev_id)
 {
        return IRQ_HANDLED;
 }
@@ -359,7 +357,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long * irq = &dev->res.irq_resource[idx].start;
+       resource_size_t * irq = &dev->res.irq_resource[idx].start;
 
        /* if the resource doesn't exist, don't complain about it */
        if (cannot_compare(dev->res.irq_resource[idx].flags))
@@ -385,9 +383,9 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
 
 #ifdef CONFIG_PCI
        /* check if the resource is being used by a pci device */
-       if (!pnp_skip_pci_scan) {
-               struct pci_dev * pci = NULL;
-               while ((pci = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pci)) != NULL) {
+       {
+               struct pci_dev *pci = NULL;
+               for_each_pci_dev(pci) {
                        if (pci->irq == *irq)
                                return 0;
                }
@@ -397,7 +395,8 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
        /* check if the resource is already in use, skip if the
         * device is active because it itself may be in use */
        if(!dev->active) {
-               if (request_irq(*irq, pnp_test_handler, SA_INTERRUPT, "pnp", NULL))
+               if (request_irq(*irq, pnp_test_handler,
+                               IRQF_DISABLED|IRQF_PROBE_SHARED, "pnp", NULL))
                        return 0;
                free_irq(*irq, NULL);
        }
@@ -424,7 +423,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
 #ifndef CONFIG_IA64
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long * dma = &dev->res.dma_resource[idx].start;
+       resource_size_t * dma = &dev->res.dma_resource[idx].start;
 
        /* if the resource doesn't exist, don't complain about it */
        if (cannot_compare(dev->res.dma_resource[idx].flags))
@@ -478,12 +477,14 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
 }
 
 
+#if 0
 EXPORT_SYMBOL(pnp_register_dependent_option);
 EXPORT_SYMBOL(pnp_register_independent_option);
 EXPORT_SYMBOL(pnp_register_irq_resource);
 EXPORT_SYMBOL(pnp_register_dma_resource);
 EXPORT_SYMBOL(pnp_register_port_resource);
 EXPORT_SYMBOL(pnp_register_mem_resource);
+#endif  /*  0  */
 
 
 /* format is: pnp_reserve_irq=irq1[,irq2] .... */