Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29568
b: refs/heads/master
c: a2bd4fd
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 24, 2006
1 parent b0e3981 commit a179600
Show file tree
Hide file tree
Showing 11 changed files with 586 additions and 158 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8cd24ed4f8031636fb5dacb04adee9e02556ecd5
refs/heads/master: a2bd4fd17926d715a470fbe0ebe05128ba410984
2 changes: 1 addition & 1 deletion trunk/arch/sparc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ obj-y := process.o setup.o cpu.o idprom.o \
irq.o ptrace.o time.o sys_sparc.o signal.o \
unaligned.o central.o pci.o starfire.o semaphore.o \
power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
visemul.o prom.o
visemul.o prom.o of_device.o

obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o pci_iommu.o \
pci_psycho.o pci_sabre.o pci_schizo.o \
Expand Down
21 changes: 21 additions & 0 deletions trunk/arch/sparc64/kernel/ebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
}
}

dev->ofdev.node = dp;
dev->ofdev.dev.parent = &dev->bus->ofdev.dev;
dev->ofdev.dev.bus = &ebus_bus_type;
strcpy(dev->ofdev.dev.bus_id, dp->path_component_name);

/* Register with core */
if (of_device_register(&dev->ofdev) != 0)
printk(KERN_DEBUG "ebus: device registration error for %s!\n",
dev->ofdev.dev.bus_id);

dp = dp->child;
if (dp) {
printk(" ->");
Expand Down Expand Up @@ -570,6 +580,17 @@ void __init ebus_init(void)
ebus->self = pdev;
ebus->parent = pbm = cookie->pbm;

ebus->ofdev.node = dp;
ebus->ofdev.dev.parent = &pdev->dev;
ebus->ofdev.dev.bus = &ebus_bus_type;
strcpy(ebus->ofdev.dev.bus_id, dp->path_component_name);

/* Register with core */
if (of_device_register(&ebus->ofdev) != 0)
printk(KERN_DEBUG "ebus: device registration error for %s!\n",
ebus->ofdev.dev.bus_id);


child = dp->child;
if (!child)
goto next_ebus;
Expand Down
37 changes: 33 additions & 4 deletions trunk/arch/sparc64/kernel/isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,25 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)

isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
if (!isa_dev) {
fatal_err("cannot allocate isa_dev");
prom_halt();
printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
return;
}

memset(isa_dev, 0, sizeof(*isa_dev));

isa_dev->ofdev.node = dp;
isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
isa_dev->ofdev.dev.bus = &isa_bus_type;
strcpy(isa_dev->ofdev.dev.bus_id, dp->path_component_name);

/* Register with core */
if (of_device_register(&isa_dev->ofdev) != 0) {
printk(KERN_DEBUG "isa: device registration error for %s!\n",
isa_dev->ofdev.dev.bus_id);
kfree(isa_dev);
goto next_sibling;
}

/* Link it in. */
isa_dev->next = NULL;
if (isa_br->devices == NULL) {
Expand All @@ -226,6 +239,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)

printk("]");

next_sibling:
dp = dp->sibling;
}
}
Expand All @@ -244,6 +258,7 @@ void __init isa_init(void)
struct pcidev_cookie *pdev_cookie;
struct pci_pbm_info *pbm;
struct sparc_isa_bridge *isa_br;
struct device_node *dp;

pdev_cookie = pdev->sysdata;
if (!pdev_cookie) {
Expand All @@ -252,15 +267,29 @@ void __init isa_init(void)
continue;
}
pbm = pdev_cookie->pbm;
dp = pdev_cookie->prom_node;

isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL);
if (!isa_br) {
fatal_err("cannot allocate sparc_isa_bridge");
prom_halt();
printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
return;
}

memset(isa_br, 0, sizeof(*isa_br));

isa_br->ofdev.node = dp;
isa_br->ofdev.dev.parent = &pdev->dev;
isa_br->ofdev.dev.bus = &isa_bus_type;
strcpy(isa_br->ofdev.dev.bus_id, dp->path_component_name);

/* Register with core */
if (of_device_register(&isa_br->ofdev) != 0) {
printk(KERN_DEBUG "isa: device registration error for %s!\n",
isa_br->ofdev.dev.bus_id);
kfree(isa_br);
return;
}

/* Link it in. */
isa_br->next = isa_chain;
isa_chain = isa_br;
Expand Down
Loading

0 comments on commit a179600

Please sign in to comment.