]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/of_device.c
Merge branch 'audit.b51' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / of_device.c
index fc5c0cc793b8f3a403307c9366b3be0a4fdc84da..d569f60c24b87fd4fc23d6e749fc37d083bb22a3 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/irq.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 
@@ -411,12 +412,6 @@ static int __init build_one_resource(struct device_node *parent,
 
 static int __init use_1to1_mapping(struct device_node *pp)
 {
-       /* If this is on the PMU bus, don't try to translate it even
-        * if a ranges property exists.
-        */
-       if (!strcmp(pp->name, "pmu"))
-               return 1;
-
        /* If we have a ranges property in the parent, use it.  */
        if (of_find_property(pp, "ranges", NULL) != NULL)
                return 0;
@@ -660,6 +655,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
        struct device_node *dp = op->node;
        struct device_node *pp, *ip;
        unsigned int orig_irq = irq;
+       int nid;
 
        if (irq == 0xffffffff)
                return irq;
@@ -672,7 +668,7 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
                        printk("%s: direct translate %x --> %x\n",
                               dp->full_name, orig_irq, irq);
 
-               return irq;
+               goto out;
        }
 
        /* Something more complicated.  Walk up to the root, applying
@@ -744,6 +740,14 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
                printk("%s: Apply IRQ trans [%s] %x --> %x\n",
                       op->node->full_name, ip->full_name, orig_irq, irq);
 
+out:
+       nid = of_node_to_nid(dp);
+       if (nid != -1) {
+               cpumask_t numa_mask = node_to_cpumask(nid);
+
+               irq_set_affinity(irq, numa_mask);
+       }
+
        return irq;
 }
 
@@ -868,29 +872,3 @@ static int __init of_debug(char *str)
 }
 
 __setup("of_debug=", of_debug);
-
-struct of_device* of_platform_device_create(struct device_node *np,
-                                           const char *bus_id,
-                                           struct device *parent,
-                                           struct bus_type *bus)
-{
-       struct of_device *dev;
-
-       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
-       if (!dev)
-               return NULL;
-
-       dev->dev.parent = parent;
-       dev->dev.bus = bus;
-       dev->dev.release = of_release_dev;
-
-       strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
-
-       if (of_device_register(dev) != 0) {
-               kfree(dev);
-               return NULL;
-       }
-
-       return dev;
-}
-EXPORT_SYMBOL(of_platform_device_create);