if (dev->slot >= TPCI200_NB_SLOT) {
dev_info(&dev->dev,
"Slot [%d:%d] doesn't exist! Last tpci200 slot is %d.\n",
- dev->bus_nr, dev->slot, TPCI200_NB_SLOT-1);
+ dev->bus->bus_nr, dev->slot, TPCI200_NB_SLOT-1);
return NULL;
}
if (tpci200->slots[dev->slot].irq != NULL) {
dev_err(&dev->dev,
- "Slot [%d:%d] IRQ already registered !\n", dev->bus_nr,
+ "Slot [%d:%d] IRQ already registered !\n", dev->bus->bus_nr,
dev->slot);
res = -EINVAL;
goto out_unlock;
if (slot_irq == NULL) {
dev_err(&dev->dev,
"Slot [%d:%d] unable to allocate memory for IRQ !\n",
- dev->bus_nr, dev->slot);
+ dev->bus->bus_nr, dev->slot);
res = -ENOMEM;
goto out_unlock;
}
if (dev->io_space.address == NULL) {
dev_info(&dev->dev,
"Slot [%d:%d] IO space not mapped !\n",
- dev->bus_nr, dev->slot);
+ dev->bus->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->io_space;
if (dev->id_space.address == NULL) {
dev_info(&dev->dev,
"Slot [%d:%d] ID space not mapped !\n",
- dev->bus_nr, dev->slot);
+ dev->bus->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->id_space;
if (dev->int_space.address == NULL) {
dev_info(&dev->dev,
"Slot [%d:%d] INT space not mapped !\n",
- dev->bus_nr, dev->slot);
+ dev->bus->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->int_space;
if (dev->mem_space.address == NULL) {
dev_info(&dev->dev,
"Slot [%d:%d] MEM space not mapped !\n",
- dev->bus_nr, dev->slot);
+ dev->bus->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->mem_space;
default:
dev_err(&dev->dev,
"Slot [%d:%d] space number %d doesn't exist !\n",
- dev->bus_nr, dev->slot, space);
+ dev->bus->bus_nr, dev->slot, space);
mutex_unlock(&tpci200->mutex);
return -EINVAL;
}
if (memory_size > tpci200->slots[dev->slot].mem_phys.size) {
dev_err(&dev->dev,
"Slot [%d:%d] request is 0x%X memory, only 0x%X available !\n",
- dev->bus_nr, dev->slot, memory_size,
+ dev->bus->bus_nr, dev->slot, memory_size,
tpci200->slots[dev->slot].mem_phys.size);
res = -EINVAL;
goto out_unlock;
struct ipack_device *idev = to_ipack_dev(dev);
struct ipack_bus_device *bus = data;
- if (idev->bus_nr == bus->bus_nr)
+ if (idev->bus == bus)
ipack_device_unregister(idev);
return 1;
dev->dev.release = ipack_device_release;
dev->dev.parent = bus->parent;
dev->slot = slot;
- dev->bus_nr = bus->bus_nr;
dev->bus = bus;
dev_set_name(&dev->dev,
- "ipack-dev.%u.%u", dev->bus_nr, dev->slot);
+ "ipack-dev.%u.%u", dev->bus->bus_nr, dev->slot);
if (bus->ops->set_clockrate(dev, 8))
dev_warn(&dev->dev, "failed to switch to 8 MHz operation for reading of device ID.\n");