Commit 3d6e4702 authored by David S. Miller's avatar David S. Miller

[SPARC]: Make sure dev_archdata is filled in for all devices.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e865f3e6
...@@ -148,6 +148,7 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d ...@@ -148,6 +148,7 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
{ {
const struct linux_prom_registers *regs; const struct linux_prom_registers *regs;
struct linux_ebus_child *child; struct linux_ebus_child *child;
struct dev_archdata *sd;
const int *irqs; const int *irqs;
int i, n, len; int i, n, len;
unsigned long baseaddr; unsigned long baseaddr;
...@@ -234,6 +235,10 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d ...@@ -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.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev; dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
dev->ofdev.dev.bus = &ebus_bus_type; dev->ofdev.dev.bus = &ebus_bus_type;
......
...@@ -420,11 +420,16 @@ static struct of_device * __init scan_one_device(struct device_node *dp, ...@@ -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); struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const struct linux_prom_irqs *intr; const struct linux_prom_irqs *intr;
struct dev_archdata *sd;
int len, i; int len, i;
if (!op) if (!op)
return NULL; return NULL;
sd = &op->dev.archdata;
sd->prom_node = dp;
sd->op = op;
op->node = dp; op->node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency", op->clock_freq = of_getintprop_default(dp, "clock-frequency",
......
...@@ -362,6 +362,7 @@ static int __init child_regs_nonstandard(struct linux_ebus_device *dev) ...@@ -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) static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *dev)
{ {
struct linux_ebus_child *child; struct linux_ebus_child *child;
struct dev_archdata *sd;
struct of_device *op; struct of_device *op;
int i, len; int i, len;
...@@ -387,6 +388,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de ...@@ -387,6 +388,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de
dev->irqs[i] = op->irqs[i]; 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.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev; dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
dev->ofdev.dev.bus = &ebus_bus_type; dev->ofdev.dev.bus = &ebus_bus_type;
......
...@@ -79,6 +79,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) ...@@ -79,6 +79,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
while (dp) { while (dp) {
struct sparc_isa_device *isa_dev; struct sparc_isa_device *isa_dev;
struct dev_archdata *sd;
isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL); isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
if (!isa_dev) { if (!isa_dev) {
...@@ -86,6 +87,10 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br) ...@@ -86,6 +87,10 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
return; return;
} }
sd = &isa_dev->ofdev.dev.archdata;
sd->prom_node = dp;
sd->op = &isa_dev->ofdev;
isa_dev->ofdev.node = dp; isa_dev->ofdev.node = dp;
isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev; isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
isa_dev->ofdev.dev.bus = &isa_bus_type; isa_dev->ofdev.dev.bus = &isa_bus_type;
......
...@@ -752,11 +752,16 @@ static struct of_device * __init scan_one_device(struct device_node *dp, ...@@ -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); struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const unsigned int *irq; const unsigned int *irq;
struct dev_archdata *sd;
int len, i; int len, i;
if (!op) if (!op)
return NULL; return NULL;
sd = &op->dev.archdata;
sd->prom_node = dp;
sd->op = op;
op->node = dp; op->node = dp;
op->clock_freq = of_getintprop_default(dp, "clock-frequency", op->clock_freq = of_getintprop_default(dp, "clock-frequency",
......
...@@ -33,6 +33,7 @@ struct sbus_bus *sbus_root; ...@@ -33,6 +33,7 @@ struct sbus_bus *sbus_root;
static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev) static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sdev)
{ {
struct dev_archdata *sd;
unsigned long base; unsigned long base;
const void *pval; const void *pval;
int len, err; int len, err;
...@@ -67,6 +68,10 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde ...@@ -67,6 +68,10 @@ static void __init fill_sbus_device(struct device_node *dp, struct sbus_dev *sde
sbus_fill_device_irq(sdev); sbus_fill_device_irq(sdev);
sd = &sdev->ofdev.dev.archdata;
sd->prom_node = dp;
sd->op = &sdev->ofdev;
sdev->ofdev.node = dp; sdev->ofdev.node = dp;
if (sdev->parent) if (sdev->parent)
sdev->ofdev.dev.parent = &sdev->parent->ofdev.dev; sdev->ofdev.dev.parent = &sdev->parent->ofdev.dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment