]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[SPARC]: Make sure dev_archdata is filled in for all devices.
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 19 Jul 2007 05:03:25 +0000 (22:03 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 21 Jul 2007 00:13:42 +0000 (17:13 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/ebus.c
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/isa.c
arch/sparc64/kernel/of_device.c
drivers/sbus/sbus.c

index 7bb86b9cdaa338be5c3ab6a54f8ab53bc5ed7938..ac352eb6dff3beb4753cefc885078c87284c053e 100644 (file)
@@ -148,6 +148,7 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
 {
        const struct linux_prom_registers *regs;
        struct linux_ebus_child *child;
+       struct dev_archdata *sd;
        const int *irqs;
        int i, n, len;
        unsigned long baseaddr;
@@ -234,6 +235,10 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
                }
        }
 
+       sd = &dev->ofdev.dev.archdata;
+       sd->prom_node = dp;
+       sd->op = &dev->ofdev;
+
        dev->ofdev.node = dp;
        dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
        dev->ofdev.dev.bus = &ebus_bus_type;
index 7176040caba0f03b497bf11dd8aeb913d3f33f11..36383f73d6855a425a92e60884c20f10e4c9f6be 100644 (file)
@@ -420,11 +420,16 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
 {
        struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
        const struct linux_prom_irqs *intr;
+       struct dev_archdata *sd;
        int len, i;
 
        if (!op)
                return NULL;
 
+       sd = &op->dev.archdata;
+       sd->prom_node = dp;
+       sd->op = op;
+
        op->node = dp;
 
        op->clock_freq = of_getintprop_default(dp, "clock-frequency",
index ad55a9bb50ddedfe6febf63c54e7836b43c18b16..6d2956179cde796006f767d6529cc80ab0694e73 100644 (file)
@@ -362,6 +362,7 @@ static int __init child_regs_nonstandard(struct linux_ebus_device *dev)
 static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *dev)
 {
        struct linux_ebus_child *child;
+       struct dev_archdata *sd;
        struct of_device *op;
        int i, len;
 
@@ -387,6 +388,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
                        dev->irqs[i] = op->irqs[i];
        }
 
+       sd = &dev->ofdev.dev.archdata;
+       sd->prom_node = dp;
+       sd->op = &dev->ofdev;
+
        dev->ofdev.node = dp;
        dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
        dev->ofdev.dev.bus = &ebus_bus_type;
index 6a6882e57ff22ff3c5f1aee779b761d20b493ab6..1a1043fcf97dda26866182a97acd2739e94df3ee 100644 (file)
@@ -79,6 +79,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
 
        while (dp) {
                struct sparc_isa_device *isa_dev;
+               struct dev_archdata *sd;
 
                isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
                if (!isa_dev) {
@@ -86,6 +87,10 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
                        return;
                }
 
+               sd = &isa_dev->ofdev.dev.archdata;
+               sd->prom_node = dp;
+               sd->op = &isa_dev->ofdev;
+
                isa_dev->ofdev.node = dp;
                isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
                isa_dev->ofdev.dev.bus = &isa_bus_type;
index 7b0dce9604ee1f7fa7c94ab02024e1c2fe508796..4cc77485f53602ba54714e88b42d61e1bb062047 100644 (file)
@@ -752,11 +752,16 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
 {
        struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
        const unsigned int *irq;
+       struct dev_archdata *sd;
        int len, i;
 
        if (!op)
                return NULL;
 
+       sd = &op->dev.archdata;
+       sd->prom_node = dp;
+       sd->op = op;
+
        op->node = dp;
 
        op->clock_freq = of_getintprop_default(dp, "clock-frequency",
index 002643392d424accdbeb33a79f546bbe5c5d8543..2553629ec15db76dc364ec7cee2373783cdfe6e4 100644 (file)
@@ -33,6 +33,7 @@ struct sbus_bus *sbus_root;
 
 static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
 {
+       struct dev_archdata *sd;
        unsigned long base;
        const void *pval;
        int len, err;
@@ -67,6 +68,10 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
 
        sbus_fill_device_irq(sdev);
 
+       sd = &sdev->ofdev.dev.archdata;
+       sd->prom_node = dp;
+       sd->op = &sdev->ofdev;
+
        sdev->ofdev.node = dp;
        if (sdev->parent)
                sdev->ofdev.dev.parent = &sdev->parent->ofdev.dev;