Commit 9f64c00f authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

cardbus.c:

  Set up CardBus cards correctly: initialize them fully
  before calling device_register(), and make sure to tell
  the world that it's a PCI-like bus.
parent ef8e826c
......@@ -274,6 +274,9 @@ int cb_alloc(socket_info_t * s)
dev->bus = bus;
dev->sysdata = bus->sysdata;
dev->dev.parent = bus->dev;
dev->dev.bus = &pci_bus_type;
dev->devfn = i;
dev->vendor = vend;
pci_readw(dev, PCI_DEVICE_ID, &dev->device);
......@@ -281,10 +284,8 @@ int cb_alloc(socket_info_t * s)
pci_setup_device(dev);
dev->dev.parent = bus->dev;
strcpy(dev->dev.name, dev->name);
strcpy(dev->dev.bus_id, dev->slot_name);
device_register(&dev->dev);
/* FIXME: Do we need to enable the expansion ROM? */
for (r = 0; r < 7; r++) {
......@@ -301,6 +302,7 @@ int cb_alloc(socket_info_t * s)
}
pci_enable_device(dev); /* XXX check return */
device_register(&dev->dev);
pci_insert_device(dev, bus);
}
......
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