]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/spu_base.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
[linux-2.6] / arch / powerpc / platforms / cell / spu_base.c
index 5d2313a6c82bfafd89c22c6b0ea653aa5442919d..f78680346e5fe0dc72fbe4ba70dd2c4152332da1 100644 (file)
@@ -488,10 +488,10 @@ int spu_irq_class_1_bottom(struct spu *spu)
 
 static int __init find_spu_node_id(struct device_node *spe)
 {
-       unsigned int *id;
+       const unsigned int *id;
        struct device_node *cpu;
        cpu = spe->parent->parent;
-       id = (unsigned int *)get_property(cpu, "node-id", NULL);
+       id = get_property(cpu, "node-id", NULL);
        return id ? *id : 0;
 }
 
@@ -500,7 +500,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
 {
        static DEFINE_MUTEX(add_spumem_mutex);
 
-       struct address_prop {
+       const struct address_prop {
                unsigned long address;
                unsigned int len;
        } __attribute__((packed)) *p;
@@ -511,7 +511,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
        struct zone *zone;
        int ret;
 
-       p = (void*)get_property(spe, prop, &proplen);
+       p = get_property(spe, prop, &proplen);
        WARN_ON(proplen != sizeof (*p));
 
        start_pfn = p->address >> PAGE_SHIFT;
@@ -531,14 +531,14 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
 static void __iomem * __init map_spe_prop(struct spu *spu,
                struct device_node *n, const char *name)
 {
-       struct address_prop {
+       const struct address_prop {
                unsigned long address;
                unsigned int len;
        } __attribute__((packed)) *prop;
 
-       void *p;
+       const void *p;
        int proplen;
-       voidret = NULL;
+       void __iomem *ret = NULL;
        int err = 0;
 
        p = get_property(n, name, &proplen);
@@ -562,30 +562,29 @@ static void spu_unmap(struct spu *spu)
        iounmap(spu->priv2);
        iounmap(spu->priv1);
        iounmap(spu->problem);
-       iounmap((u8 __iomem *)spu->local_store);
+       iounmap((__force u8 __iomem *)spu->local_store);
 }
 
 /* This function shall be abstracted for HV platforms */
 static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
 {
-       struct irq_host *host;
        unsigned int isrc;
-       u32 *tmp;
+       const u32 *tmp;
 
-       host = iic_get_irq_host(spu->node);
-       if (host == NULL)
-               return -ENODEV;
-
-       /* Get the interrupt source from the device-tree */
-       tmp = (u32 *)get_property(np, "isrc", NULL);
+       /* Get the interrupt source unit from the device-tree */
+       tmp = get_property(np, "isrc", NULL);
        if (!tmp)
                return -ENODEV;
-       spu->isrc = isrc = tmp[0];
+       isrc = tmp[0];
+
+       /* Add the node number */
+       isrc |= spu->node << IIC_IRQ_NODE_SHIFT;
+       spu->isrc = isrc;
 
        /* Now map interrupts of all 3 classes */
-       spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0);
-       spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0);
-       spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0);
+       spu->irqs[0] = irq_create_mapping(NULL, IIC_IRQ_CLASS_0 | isrc);
+       spu->irqs[1] = irq_create_mapping(NULL, IIC_IRQ_CLASS_1 | isrc);
+       spu->irqs[2] = irq_create_mapping(NULL, IIC_IRQ_CLASS_2 | isrc);
 
        /* Right now, we only fail if class 2 failed */
        return spu->irqs[2] == NO_IRQ ? -EINVAL : 0;
@@ -593,7 +592,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
 
 static int __init spu_map_device(struct spu *spu, struct device_node *node)
 {
-       char *prop;
+       const char *prop;
        int ret;
 
        ret = -ENODEV;