Staging: ipack: get rid of ipack_device->bus_nr.

It is replicating information contained in ipack_device->bus->bus_nr.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jens Taprogge 2012-09-27 12:37:25 +02:00 committed by Greg Kroah-Hartman
parent ddffeb8c4d
commit f9e314d2bf
4 changed files with 12 additions and 15 deletions

View File

@ -46,7 +46,7 @@ static struct tpci200_board *check_slot(struct ipack_device *dev)
if (dev->slot >= TPCI200_NB_SLOT) { if (dev->slot >= TPCI200_NB_SLOT) {
dev_info(&dev->dev, dev_info(&dev->dev,
"Slot [%d:%d] doesn't exist! Last tpci200 slot is %d.\n", "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; return NULL;
} }
@ -206,7 +206,7 @@ static int tpci200_request_irq(struct ipack_device *dev,
if (tpci200->slots[dev->slot].irq != NULL) { if (tpci200->slots[dev->slot].irq != NULL) {
dev_err(&dev->dev, 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); dev->slot);
res = -EINVAL; res = -EINVAL;
goto out_unlock; goto out_unlock;
@ -216,7 +216,7 @@ static int tpci200_request_irq(struct ipack_device *dev,
if (slot_irq == NULL) { if (slot_irq == NULL) {
dev_err(&dev->dev, dev_err(&dev->dev,
"Slot [%d:%d] unable to allocate memory for IRQ !\n", "Slot [%d:%d] unable to allocate memory for IRQ !\n",
dev->bus_nr, dev->slot); dev->bus->bus_nr, dev->slot);
res = -ENOMEM; res = -ENOMEM;
goto out_unlock; goto out_unlock;
} }
@ -379,7 +379,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
if (dev->io_space.address == NULL) { if (dev->io_space.address == NULL) {
dev_info(&dev->dev, dev_info(&dev->dev,
"Slot [%d:%d] IO space not mapped !\n", "Slot [%d:%d] IO space not mapped !\n",
dev->bus_nr, dev->slot); dev->bus->bus_nr, dev->slot);
goto out_unlock; goto out_unlock;
} }
virt_addr_space = &dev->io_space; virt_addr_space = &dev->io_space;
@ -388,7 +388,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
if (dev->id_space.address == NULL) { if (dev->id_space.address == NULL) {
dev_info(&dev->dev, dev_info(&dev->dev,
"Slot [%d:%d] ID space not mapped !\n", "Slot [%d:%d] ID space not mapped !\n",
dev->bus_nr, dev->slot); dev->bus->bus_nr, dev->slot);
goto out_unlock; goto out_unlock;
} }
virt_addr_space = &dev->id_space; virt_addr_space = &dev->id_space;
@ -397,7 +397,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
if (dev->int_space.address == NULL) { if (dev->int_space.address == NULL) {
dev_info(&dev->dev, dev_info(&dev->dev,
"Slot [%d:%d] INT space not mapped !\n", "Slot [%d:%d] INT space not mapped !\n",
dev->bus_nr, dev->slot); dev->bus->bus_nr, dev->slot);
goto out_unlock; goto out_unlock;
} }
virt_addr_space = &dev->int_space; virt_addr_space = &dev->int_space;
@ -406,7 +406,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
if (dev->mem_space.address == NULL) { if (dev->mem_space.address == NULL) {
dev_info(&dev->dev, dev_info(&dev->dev,
"Slot [%d:%d] MEM space not mapped !\n", "Slot [%d:%d] MEM space not mapped !\n",
dev->bus_nr, dev->slot); dev->bus->bus_nr, dev->slot);
goto out_unlock; goto out_unlock;
} }
virt_addr_space = &dev->mem_space; virt_addr_space = &dev->mem_space;
@ -414,7 +414,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
default: default:
dev_err(&dev->dev, dev_err(&dev->dev,
"Slot [%d:%d] space number %d doesn't exist !\n", "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); mutex_unlock(&tpci200->mutex);
return -EINVAL; return -EINVAL;
} }
@ -497,7 +497,7 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
if (memory_size > tpci200->slots[dev->slot].mem_phys.size) { if (memory_size > tpci200->slots[dev->slot].mem_phys.size) {
dev_err(&dev->dev, dev_err(&dev->dev,
"Slot [%d:%d] request is 0x%X memory, only 0x%X available !\n", "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); tpci200->slots[dev->slot].mem_phys.size);
res = -EINVAL; res = -EINVAL;
goto out_unlock; goto out_unlock;

View File

@ -719,7 +719,7 @@ static int ipoctal_probe(struct ipack_device *dev)
return -ENOMEM; return -ENOMEM;
ipoctal->dev = dev; ipoctal->dev = dev;
res = ipoctal_inst_slot(ipoctal, dev->bus_nr, dev->slot); res = ipoctal_inst_slot(ipoctal, dev->bus->bus_nr, dev->slot);
if (res) if (res)
goto out_uninst; goto out_uninst;

View File

@ -234,7 +234,7 @@ static int ipack_unregister_bus_member(struct device *dev, void *data)
struct ipack_device *idev = to_ipack_dev(dev); struct ipack_device *idev = to_ipack_dev(dev);
struct ipack_bus_device *bus = data; struct ipack_bus_device *bus = data;
if (idev->bus_nr == bus->bus_nr) if (idev->bus == bus)
ipack_device_unregister(idev); ipack_device_unregister(idev);
return 1; return 1;
@ -440,10 +440,9 @@ struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
dev->dev.release = ipack_device_release; dev->dev.release = ipack_device_release;
dev->dev.parent = bus->parent; dev->dev.parent = bus->parent;
dev->slot = slot; dev->slot = slot;
dev->bus_nr = bus->bus_nr;
dev->bus = bus; dev->bus = bus;
dev_set_name(&dev->dev, 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)) if (bus->ops->set_clockrate(dev, 8))
dev_warn(&dev->dev, "failed to switch to 8 MHz operation for reading of device ID.\n"); dev_warn(&dev->dev, "failed to switch to 8 MHz operation for reading of device ID.\n");

View File

@ -52,7 +52,6 @@ struct ipack_addr_space {
/** /**
* struct ipack_device * struct ipack_device
* *
* @bus_nr: IP bus number where the device is plugged
* @slot: Slot where the device is plugged in the carrier board * @slot: Slot where the device is plugged in the carrier board
* @bus: ipack_bus_device where the device is plugged to. * @bus: ipack_bus_device where the device is plugged to.
* @id_space: Virtual address to ID space. * @id_space: Virtual address to ID space.
@ -65,7 +64,6 @@ struct ipack_addr_space {
* by the carrier board throught bus->ops. * by the carrier board throught bus->ops.
*/ */
struct ipack_device { struct ipack_device {
unsigned int bus_nr;
unsigned int slot; unsigned int slot;
struct ipack_bus_device *bus; struct ipack_bus_device *bus;
struct ipack_addr_space id_space; struct ipack_addr_space id_space;