]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC64]: Kill ebus/isa range and interrupt mapping struct members.
authorDavid S. Miller <davem@sunset.davemloft.net>
Fri, 23 Jun 2006 02:31:11 +0000 (19:31 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 24 Jun 2006 06:15:30 +0000 (23:15 -0700)
Unused outside of initial bus probe scan.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/isa.c
include/asm-sparc64/ebus.h
include/asm-sparc64/isa.h

index 919a91d9e5de802f9e29fa09de70e40d64f70731..33d79e10c653ff0215ee8a37052ffe8b557bca73 100644 (file)
@@ -283,60 +283,32 @@ static inline void *ebus_alloc(size_t size)
        return mem;
 }
 
-static void __init ebus_ranges_init(struct linux_ebus *ebus)
-{
-       struct linux_prom_ebus_ranges *rngs;
-       int len;
-
-       ebus->num_ebus_ranges = 0;
-       rngs = of_get_property(ebus->prom_node, "ranges", &len);
-       if (rngs) {
-               memcpy(ebus->ebus_ranges, rngs, len);
-               ebus->num_ebus_ranges =
-                       (len / sizeof(struct linux_prom_ebus_ranges));
-       }
-}
-
-static void __init ebus_intmap_init(struct linux_ebus *ebus)
+int __init ebus_intmap_match(struct linux_ebus *ebus,
+                            struct linux_prom_registers *reg,
+                            int *interrupt)
 {
        struct linux_prom_ebus_intmap *imap;
        struct linux_prom_ebus_intmask *imask;
-       int len;
+       unsigned int hi, lo, irq;
+       int i, len, n_imap;
 
-       ebus->num_ebus_intmap = 0;
        imap = of_get_property(ebus->prom_node, "interrupt-map", &len);
        if (!imap)
-               return;
-
-       memcpy(ebus->ebus_intmap, imap, len);
-       ebus->num_ebus_intmap = (len / sizeof(struct linux_prom_ebus_intmap));
-
-       imask = of_get_property(ebus->prom_node, "interrupt-map-mask", &len);
-       if (!imask) {
-               prom_printf("EBUS: can't get interrupt-map-mask\n");
-               prom_halt();
-       }
-       memcpy(&ebus->ebus_intmask, imask, sizeof(ebus->ebus_intmask));
-}
-
-int __init ebus_intmap_match(struct linux_ebus *ebus,
-                            struct linux_prom_registers *reg,
-                            int *interrupt)
-{
-       unsigned int hi, lo, irq;
-       int i;
+               return 0;
+       n_imap = len / sizeof(imap[0]);
 
-       if (!ebus->num_ebus_intmap)
+       imask = of_get_property(ebus->prom_node, "interrupt-map-mask", NULL);
+       if (!imask)
                return 0;
 
-       hi = reg->which_io & ebus->ebus_intmask.phys_hi;
-       lo = reg->phys_addr & ebus->ebus_intmask.phys_lo;
-       irq = *interrupt & ebus->ebus_intmask.interrupt;
-       for (i = 0; i < ebus->num_ebus_intmap; i++) {
-               if ((ebus->ebus_intmap[i].phys_hi == hi) &&
-                   (ebus->ebus_intmap[i].phys_lo == lo) &&
-                   (ebus->ebus_intmap[i].interrupt == irq)) {
-                       *interrupt = ebus->ebus_intmap[i].cinterrupt;
+       hi = reg->which_io & imask->phys_hi;
+       lo = reg->phys_addr & imask->phys_lo;
+       irq = *interrupt & imask->interrupt;
+       for (i = 0; i < n_imap; i++) {
+               if ((imap[i].phys_hi == hi) &&
+                   (imap[i].phys_lo == lo) &&
+                   (imap[i].interrupt == irq)) {
+                       *interrupt = imap[i].cinterrupt;
                        return 0;
                }
        }
@@ -598,9 +570,6 @@ void __init ebus_init(void)
                ebus->self = pdev;
                ebus->parent = pbm = cookie->pbm;
 
-               ebus_ranges_init(ebus);
-               ebus_intmap_init(ebus);
-
                child = dp->child;
                if (!child)
                        goto next_ebus;
index 8c8c5a491ad6dbde47e81cc7e0ed16d63b838b5e..2693f2de549c00d22f42dd6f27cdf836a6e76863 100644 (file)
@@ -72,19 +72,30 @@ static struct {
 static int __init isa_dev_get_irq_using_imap(struct sparc_isa_device *isa_dev,
                                             struct sparc_isa_bridge *isa_br,
                                             int *interrupt,
-                                            struct linux_prom_registers *pregs)
+                                            struct linux_prom_registers *reg)
 {
+       struct linux_prom_ebus_intmap *imap;
+       struct linux_prom_ebus_intmap *imask;
        unsigned int hi, lo, irq;
-       int i;
-
-       hi = pregs->which_io & isa_br->isa_intmask.phys_hi;
-       lo = pregs->phys_addr & isa_br->isa_intmask.phys_lo;
-       irq = *interrupt & isa_br->isa_intmask.interrupt;
-       for (i = 0; i < isa_br->num_isa_intmap; i++) {
-               if ((isa_br->isa_intmap[i].phys_hi == hi) &&
-                   (isa_br->isa_intmap[i].phys_lo == lo) &&
-                   (isa_br->isa_intmap[i].interrupt == irq)) {
-                       *interrupt = isa_br->isa_intmap[i].cinterrupt;
+       int i, len, n_imap;
+
+       imap = of_get_property(isa_br->prom_node, "interrupt-map", &len);
+       if (!imap)
+               return 0;
+       n_imap = len / sizeof(imap[0]);
+
+       imask = of_get_property(isa_br->prom_node, "interrupt-map-mask", NULL);
+       if (!imask)
+               return 0;
+
+       hi = reg->which_io & imask->phys_hi;
+       lo = reg->phys_addr & imask->phys_lo;
+       irq = *interrupt & imask->interrupt;
+       for (i = 0; i < n_imap; i++) {
+               if ((imap[i].phys_hi == hi) &&
+                   (imap[i].phys_lo == lo) &&
+                   (imap[i].interrupt == irq)) {
+                       *interrupt = imap[i].cinterrupt;
                        return 0;
                }
        }
@@ -105,7 +116,8 @@ static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev,
                struct pci_pbm_info *pbm;
                int i;
 
-               if (isa_dev->bus->num_isa_intmap) {
+               if (of_find_property(isa_dev->bus->prom_node,
+                                    "interrupt-map", NULL)) {
                        if (!isa_dev_get_irq_using_imap(isa_dev,
                                                        isa_dev->bus,
                                                        &irq_prop,
@@ -218,36 +230,6 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
        }
 }
 
-static void __init get_bridge_props(struct sparc_isa_bridge *isa_br)
-{
-       struct device_node *dp = isa_br->prom_node;
-       void *pval;
-       int len;
-
-       pval = of_get_property(dp, "ranges", &len);
-       if (pval) {
-               memcpy(isa_br->isa_ranges, pval, len);
-               isa_br->num_isa_ranges =
-                       len / sizeof(struct linux_prom_isa_ranges);
-       } else {
-               isa_br->num_isa_ranges = 0;
-       }
-
-       pval = of_get_property(dp, "interrupt-map", &len);
-       if (pval) {
-               memcpy(isa_br->isa_intmap, pval, len);
-               isa_br->num_isa_intmap =
-                       (len / sizeof(struct linux_prom_isa_intmap));
-       } else {
-               isa_br->num_isa_intmap = 0;
-       }
-
-       pval = of_get_property(dp, "interrupt-map-mask", &len);
-       if (pval)
-               memcpy(&isa_br->isa_intmask, pval,
-                      sizeof(isa_br->isa_intmask));
-}
-
 void __init isa_init(void)
 {
        struct pci_dev *pdev;
@@ -288,8 +270,6 @@ void __init isa_init(void)
                isa_br->index = index++;
                isa_br->prom_node = pdev_cookie->prom_node;
 
-               get_bridge_props(isa_br);
-
                printk("isa%d:", isa_br->index);
 
                isa_fill_devices(isa_br);
index 876912f4d83b292aa24b8fb9c7ab60fa2c9267d6..545882bd35636b6111a6ecae5829742d7c5f094e 100644 (file)
@@ -42,11 +42,6 @@ struct linux_ebus {
        int                              index;
        int                              is_rio;
        struct device_node              *prom_node;
-       struct linux_prom_ebus_ranges    ebus_ranges[PROMREG_MAX];
-       int                              num_ebus_ranges;
-       struct linux_prom_ebus_intmap    ebus_intmap[PROMREG_MAX];
-       int                              num_ebus_intmap;
-       struct linux_prom_ebus_intmask   ebus_intmask;
 };
 
 struct ebus_dma_info {
index e110435b14ef8bf3f3b657101d638c0b832201d0..2e7fb18ec1beb185b8f1c79925af4f4e243cf4ea 100644 (file)
@@ -29,14 +29,6 @@ struct sparc_isa_bridge {
        struct pci_dev          *self;
        int                     index;
        struct device_node      *prom_node;
-#define linux_prom_isa_ranges linux_prom_ebus_ranges
-       struct linux_prom_isa_ranges    isa_ranges[PROMREG_MAX];
-       int                     num_isa_ranges;
-#define linux_prom_isa_intmap  linux_prom_ebus_intmap
-       struct linux_prom_isa_intmap    isa_intmap[PROMREG_MAX];
-       int                     num_isa_intmap;
-#define linux_prom_isa_intmask linux_prom_ebus_intmask
-       struct linux_prom_isa_intmap    isa_intmask;
 };
 
 extern struct sparc_isa_bridge *isa_chain;