linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/17] Staging: ipack: get rid of ipack_device->bus_nr.
@ 2012-09-27 10:37 Samuel Iglesias Gonsalvez
  2012-09-27 10:37 ` [PATCH 02/17] Staging: ipack: Make ipack_device_register() analogous to device_register() Samuel Iglesias Gonsalvez
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Samuel Iglesias Gonsalvez @ 2012-09-27 10:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, linux-kernel, industrypack-devel, Jens Taprogge,
	Samuel Iglesias Gonsalvez

From: Jens Taprogge <jens.taprogge@taprogge.org>

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>
---
 drivers/staging/ipack/bridges/tpci200.c |   18 +++++++++---------
 drivers/staging/ipack/devices/ipoctal.c |    2 +-
 drivers/staging/ipack/ipack.c           |    5 ++---
 drivers/staging/ipack/ipack.h           |    2 --
 4 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c
index bb8aa70..2f48dd5 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -46,7 +46,7 @@ static struct tpci200_board *check_slot(struct ipack_device *dev)
 	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;
 	}
 
@@ -206,7 +206,7 @@ static int tpci200_request_irq(struct ipack_device *dev,
 
 	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;
@@ -216,7 +216,7 @@ static int tpci200_request_irq(struct ipack_device *dev,
 	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;
 	}
@@ -379,7 +379,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
 		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;
@@ -388,7 +388,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int 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;
@@ -397,7 +397,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int 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;
@@ -406,7 +406,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *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;
@@ -414,7 +414,7 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int 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;
 	}
@@ -497,7 +497,7 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
 		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;
diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c
index 2cdbf28..14a0aed 100644
--- a/drivers/staging/ipack/devices/ipoctal.c
+++ b/drivers/staging/ipack/devices/ipoctal.c
@@ -719,7 +719,7 @@ static int ipoctal_probe(struct ipack_device *dev)
 		return -ENOMEM;
 
 	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)
 		goto out_uninst;
 
diff --git a/drivers/staging/ipack/ipack.c b/drivers/staging/ipack/ipack.c
index d1e0651..ca8cb327 100644
--- a/drivers/staging/ipack/ipack.c
+++ b/drivers/staging/ipack/ipack.c
@@ -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_bus_device *bus = data;
 
-	if (idev->bus_nr == bus->bus_nr)
+	if (idev->bus == bus)
 		ipack_device_unregister(idev);
 
 	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.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");
diff --git a/drivers/staging/ipack/ipack.h b/drivers/staging/ipack/ipack.h
index d8e3bb6..33fdea5 100644
--- a/drivers/staging/ipack/ipack.h
+++ b/drivers/staging/ipack/ipack.h
@@ -52,7 +52,6 @@ struct ipack_addr_space {
 /**
  *	struct ipack_device
  *
- *	@bus_nr: IP bus number where the device is plugged
  *	@slot: Slot where the device is plugged in the carrier board
  *	@bus: ipack_bus_device where the device is plugged to.
  *	@id_space: Virtual address to ID space.
@@ -65,7 +64,6 @@ struct ipack_addr_space {
  * by the carrier board throught bus->ops.
  */
 struct ipack_device {
-	unsigned int bus_nr;
 	unsigned int slot;
 	struct ipack_bus_device *bus;
 	struct ipack_addr_space id_space;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-09-27 10:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-27 10:37 [PATCH 01/17] Staging: ipack: get rid of ipack_device->bus_nr Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 02/17] Staging: ipack: Make ipack_device_register() analogous to device_register() Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 03/17] Staging: ipack/bridges/tpci200: Don't map memory spaces that are not used later on Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 04/17] Staging: ipack/bridges/tpci200: change tpci200_slot->*_phys type Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 05/17] Staging: ipack/bridges/tpci200: Store beginning of module memory regions in struct tpci200 Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 06/17] Staging: ipack/bridges/tpci200: Cleanups Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 07/17] Staging: ipack: Provide physical memory regions to IPack devices Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 08/17] staging: ipack/devices/ipoctal: fix ipoctal_inst_slot error path Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 09/17] staging: ipack/devices/ipoctal: obtain model from dev->id_device Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 10/17] staging: ipack: swich to regular ioremap and friends Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 11/17] Staging: ipack: remove memory mapping callbacks Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 12/17] staging: ipack: Rename IPACK_MEM_SPACE to IPACK_MEM8_SPACE Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 13/17] staging: ipack: Add support for IPACK_MEM16_SPACE Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 14/17] Staging: ipack: remove blank line at EOF warning in Kconfig files Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 15/17] staging: ipack: Rename bridges to carriers Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 16/17] staging: ipack: Documentation cleanups Samuel Iglesias Gonsalvez
2012-09-27 10:37 ` [PATCH 17/17] Staging: ipack: fix wrong return value Samuel Iglesias Gonsalvez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).