linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [re-send][-next] staging/vme: various fixes + new driver model for VME
@ 2010-10-26  1:10 Emilio G. Cota
  2010-10-26  1:10 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
                   ` (30 more replies)
  0 siblings, 31 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

This is a re-send of http://lkml.org/lkml/2010/10/22/77 now with
all the appropriate Cc's. The discussion should continue here.

To LKML readers: sorry for the noise, will be more careful next time.

                Emilio


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

* [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo'
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:17   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails Emilio G. Cota
                   ` (29 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

done with
find . -name '*.c' | xargs perl -p -i -e 's/&\(([^()]+)\)/&$1/g'

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |  181 ++++++++++++------------
 drivers/staging/vme/bridges/vme_tsi148.c   |  204 ++++++++++++++--------------
 drivers/staging/vme/devices/vme_user.c     |   16 +-
 drivers/staging/vme/vme.c                  |  114 ++++++++--------
 4 files changed, 258 insertions(+), 257 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 4d74562..1f2089f 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -58,7 +58,7 @@ static struct pci_driver ca91cx42_driver = {
 
 static u32 ca91cx42_DMA_irqhandler(struct ca91cx42_driver *bridge)
 {
-	wake_up(&(bridge->dma_queue));
+	wake_up(&bridge->dma_queue);
 
 	return CA91CX42_LINT_DMA;
 }
@@ -82,14 +82,14 @@ static u32 ca91cx42_LM_irqhandler(struct ca91cx42_driver *bridge, u32 stat)
 /* XXX This needs to be split into 4 queues */
 static u32 ca91cx42_MB_irqhandler(struct ca91cx42_driver *bridge, int mbox_mask)
 {
-	wake_up(&(bridge->mbox_queue));
+	wake_up(&bridge->mbox_queue);
 
 	return CA91CX42_LINT_MBOX;
 }
 
 static u32 ca91cx42_IACK_irqhandler(struct ca91cx42_driver *bridge)
 {
-	wake_up(&(bridge->iack_queue));
+	wake_up(&bridge->iack_queue);
 
 	return CA91CX42_LINT_SW_IACK;
 }
@@ -207,9 +207,9 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
 	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
 
 	/* Initialise list for VME bus errors */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->vme_errors));
+	INIT_LIST_HEAD(&ca91cx42_bridge->vme_errors);
 
-	mutex_init(&(ca91cx42_bridge->irq_mtx));
+	mutex_init(&ca91cx42_bridge->irq_mtx);
 
 	/* Disable interrupts from PCI to VME */
 	iowrite32(0, bridge->base + VINT_EN);
@@ -299,7 +299,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	if (statid & 1)
 		return -EINVAL;
 
-	mutex_lock(&(bridge->vme_int));
+	mutex_lock(&bridge->vme_int);
 
 	tmp = ioread32(bridge->base + VINT_EN);
 
@@ -318,7 +318,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	tmp = tmp & ~(1 << (level + 24));
 	iowrite32(tmp, bridge->base + VINT_EN);
 
-	mutex_unlock(&(bridge->vme_int));
+	mutex_unlock(&bridge->vme_int);
 
 	return 0;
 }
@@ -518,8 +518,8 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 		image->kern_base = NULL;
 		if (image->bus_resource.name != NULL)
 			kfree(image->bus_resource.name);
-		release_resource(&(image->bus_resource));
-		memset(&(image->bus_resource), 0, sizeof(struct resource));
+		release_resource(&image->bus_resource);
+		memset(&image->bus_resource, 0, sizeof(struct resource));
 	}
 
 	if (image->bus_resource.name == NULL) {
@@ -540,7 +540,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 	image->bus_resource.flags = IORESOURCE_MEM;
 
 	retval = pci_bus_alloc_resource(pdev->bus,
-		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
+		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
 		0, NULL, NULL);
 	if (retval) {
 		dev_err(ca91cx42_bridge->parent, "Failed to allocate mem "
@@ -563,10 +563,10 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
 err_remap:
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 err_resource:
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 err_name:
 	return retval;
 }
@@ -578,9 +578,9 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
 {
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 }
 
 
@@ -620,7 +620,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 		goto err_window;
 	}
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/*
 	 * Let's allocate the resource here rather than further up the stack as
@@ -628,7 +628,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	 */
 	retval = ca91cx42_alloc_resource(image, size);
 	if (retval) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Unable to allocate memory "
 			"for resource name\n");
 		retval = -ENOMEM;
@@ -672,7 +672,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= CA91CX42_LSI_CTL_VDW_D64;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Invalid data width\n");
 		retval = -EINVAL;
 		goto err_dwidth;
@@ -704,7 +704,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	case VME_USER3:
 	case VME_USER4:
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Invalid address space\n");
 		retval = -EINVAL;
 		goto err_aspace;
@@ -730,7 +730,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 
 	iowrite32(temp_ctl, bridge->base + CA91CX42_LSI_CTL[i]);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 	return 0;
 
 err_aspace:
@@ -834,12 +834,12 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 {
 	int retval;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace,
 		cycle, dwidth);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -855,7 +855,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
 	if (count == 0)
 		return 0;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* The following code handles VME address alignment problem
 	 * in order to assure the maximal data width cycle.
@@ -899,7 +899,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
 	}
 out:
 	retval = count;
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -915,7 +915,7 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
 	if (count == 0)
 		return 0;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* Here we apply for the same strategy we do in master_read
 	 * function in order to assure D16 cycle when required.
@@ -954,7 +954,8 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
 out:
 	retval = count;
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
+
 	return retval;
 }
 
@@ -974,10 +975,10 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	i = image->number;
 
 	/* Locking as we can only do one of these at a time */
-	mutex_lock(&(bridge->vme_rmw));
+	mutex_lock(&bridge->vme_rmw);
 
 	/* Lock image */
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	pci_addr = (u32)image->kern_base + offset;
 
@@ -1007,9 +1008,9 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	iowrite32(0, bridge->base + SCYC_CTL);
 
 out:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
-	mutex_unlock(&(bridge->vme_rmw));
+	mutex_unlock(&bridge->vme_rmw);
 
 	return result;
 }
@@ -1036,14 +1037,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	}
 
 	/* Test descriptor alignment */
-	if ((unsigned long)&(entry->descriptor) & CA91CX42_DCPP_M) {
+	if ((unsigned long)&entry->descriptor & CA91CX42_DCPP_M) {
 		dev_err(dev, "Descriptor not aligned to 16 byte boundary as "
-			"required: %p\n", &(entry->descriptor));
+			"required: %p\n", &entry->descriptor);
 		retval = -EINVAL;
 		goto err_align;
 	}
 
-	memset(&(entry->descriptor), 0, sizeof(struct ca91cx42_dma_descriptor));
+	memset(&entry->descriptor, 0, sizeof(struct ca91cx42_dma_descriptor));
 
 	if (dest->type == VME_DMA_VME) {
 		entry->descriptor.dctl |= CA91CX42_DCTL_L2V;
@@ -1138,14 +1139,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	entry->descriptor.dcpp = CA91CX42_DCPP_NULL;
 
 	/* Add to list */
-	list_add_tail(&(entry->list), &(list->entries));
+	list_add_tail(&entry->list, &list->entries);
 
 	/* Fill out previous descriptors "Next Address" */
-	if (entry->list.prev != &(list->entries)) {
+	if (entry->list.prev != &list->entries) {
 		prev = list_entry(entry->list.prev, struct ca91cx42_dma_entry,
 			list);
 		/* We need the bus address for the pointer */
-		desc_ptr = virt_to_bus(&(entry->descriptor));
+		desc_ptr = virt_to_bus(&entry->descriptor);
 		prev->descriptor.dcpp = desc_ptr & ~CA91CX42_DCPP_M;
 	}
 
@@ -1190,28 +1191,28 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 	bridge = ctrlr->parent->driver_priv;
 	dev = ctrlr->parent->parent;
 
-	mutex_lock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
 
-	if (!(list_empty(&(ctrlr->running)))) {
+	if (!(list_empty(&ctrlr->running))) {
 		/*
 		 * XXX We have an active DMA transfer and currently haven't
 		 *     sorted out the mechanism for "pending" DMA transfers.
 		 *     Return busy.
 		 */
 		/* Need to add to pending here */
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	} else {
-		list_add(&(list->list), &(ctrlr->running));
+		list_add(&list->list, &ctrlr->running);
 	}
 
 	/* Get first bus address and write into registers */
-	entry = list_first_entry(&(list->entries), struct ca91cx42_dma_entry,
+	entry = list_first_entry(&list->entries, struct ca91cx42_dma_entry,
 		list);
 
-	bus_addr = virt_to_bus(&(entry->descriptor));
+	bus_addr = virt_to_bus(&entry->descriptor);
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	iowrite32(0, bridge->base + DTBC);
 	iowrite32(bus_addr & ~CA91CX42_DCPP_M, bridge->base + DCPP);
@@ -1249,9 +1250,9 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 	}
 
 	/* Remove list from running list */
-	mutex_lock(&(ctrlr->mtx));
-	list_del(&(list->list));
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
+	list_del(&list->list);
+	mutex_unlock(&ctrlr->mtx);
 
 	return retval;
 
@@ -1263,7 +1264,7 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
 	struct ca91cx42_dma_entry *entry;
 
 	/* detach and free each entry */
-	list_for_each_safe(pos, temp, &(list->entries)) {
+	list_for_each_safe(pos, temp, &list->entries) {
 		list_del(pos);
 		entry = list_entry(pos, struct ca91cx42_dma_entry, list);
 		kfree(entry);
@@ -1298,12 +1299,12 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		return -EINVAL;
 	}
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* If we already have a callback attached, we can't move it! */
 	for (i = 0; i < lm->monitors; i++) {
 		if (bridge->lm_callback[i] != NULL) {
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			dev_err(dev, "Location monitor callback attached, "
 				"can't reset\n");
 			return -EBUSY;
@@ -1321,7 +1322,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		lm_ctl |= CA91CX42_LM_CTL_AS_A32;
 		break;
 	default:
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Invalid address space\n");
 		return -EINVAL;
 		break;
@@ -1339,7 +1340,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	iowrite32(lm_base, bridge->base + LM_BS);
 	iowrite32(lm_ctl, bridge->base + LM_CTL);
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1355,7 +1356,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	*lm_base = (unsigned long long)ioread32(bridge->base + LM_BS);
 	lm_ctl = ioread32(bridge->base + LM_CTL);
@@ -1380,7 +1381,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	if (lm_ctl & CA91CX42_LM_CTL_DATA)
 		*cycle |= VME_DATA;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return enabled;
 }
@@ -1400,19 +1401,19 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 	bridge = lm->parent->driver_priv;
 	dev = lm->parent->parent;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Ensure that the location monitor is configured - need PGM or DATA */
 	lm_ctl = ioread32(bridge->base + LM_CTL);
 	if ((lm_ctl & (CA91CX42_LM_CTL_PGM | CA91CX42_LM_CTL_DATA)) == 0) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Location monitor not properly configured\n");
 		return -EINVAL;
 	}
 
 	/* Check that a callback isn't already attached */
 	if (bridge->lm_callback[monitor] != NULL) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Existing callback attached\n");
 		return -EBUSY;
 	}
@@ -1431,7 +1432,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 		iowrite32(lm_ctl, bridge->base + LM_CTL);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1446,7 +1447,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Disable Location Monitor and ensure previous interrupts are clear */
 	tmp = ioread32(bridge->base + LINT_EN);
@@ -1467,7 +1468,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 		iowrite32(tmp, bridge->base + LM_CTL);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1526,7 +1527,7 @@ static int ca91cx42_crcsr_init(struct vme_bridge *ca91cx42_bridge,
 
 	/* Allocate mem for CR/CSR image */
 	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-		&(bridge->crcsr_bus));
+		&bridge->crcsr_bus);
 	if (bridge->crcsr_kernel == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for CR/CSR "
 			"image\n");
@@ -1632,12 +1633,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Initialize wait queues & mutual exclusion flags */
-	init_waitqueue_head(&(ca91cx42_device->dma_queue));
-	init_waitqueue_head(&(ca91cx42_device->iack_queue));
-	mutex_init(&(ca91cx42_device->vme_int));
-	mutex_init(&(ca91cx42_device->vme_rmw));
+	init_waitqueue_head(&ca91cx42_device->dma_queue);
+	init_waitqueue_head(&ca91cx42_device->iack_queue);
+	mutex_init(&ca91cx42_device->vme_int);
+	mutex_init(&ca91cx42_device->vme_rmw);
 
-	ca91cx42_bridge->parent = &(pdev->dev);
+	ca91cx42_bridge->parent = &pdev->dev;
 	strcpy(ca91cx42_bridge->name, driver_name);
 
 	/* Setup IRQ */
@@ -1648,7 +1649,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Add master windows to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->master_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->master_resources);
 	for (i = 0; i < CA91C142_MAX_MASTER; i++) {
 		master_image = kmalloc(sizeof(struct vme_master_resource),
 			GFP_KERNEL);
@@ -1659,7 +1660,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		master_image->parent = ca91cx42_bridge;
-		spin_lock_init(&(master_image->lock));
+		spin_lock_init(&master_image->lock);
 		master_image->locked = 0;
 		master_image->number = i;
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -1667,15 +1668,15 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
 			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D8 | VME_D16 | VME_D32 | VME_D64;
-		memset(&(master_image->bus_resource), 0,
+		memset(&master_image->bus_resource, 0,
 			sizeof(struct resource));
 		master_image->kern_base  = NULL;
-		list_add_tail(&(master_image->list),
-			&(ca91cx42_bridge->master_resources));
+		list_add_tail(&master_image->list,
+			&ca91cx42_bridge->master_resources);
 	}
 
 	/* Add slave windows to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->slave_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->slave_resources);
 	for (i = 0; i < CA91C142_MAX_SLAVE; i++) {
 		slave_image = kmalloc(sizeof(struct vme_slave_resource),
 			GFP_KERNEL);
@@ -1686,7 +1687,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_slave;
 		}
 		slave_image->parent = ca91cx42_bridge;
-		mutex_init(&(slave_image->mtx));
+		mutex_init(&slave_image->mtx);
 		slave_image->locked = 0;
 		slave_image->number = i;
 		slave_image->address_attr = VME_A24 | VME_A32 | VME_USER1 |
@@ -1698,12 +1699,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
 			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
-		list_add_tail(&(slave_image->list),
-			&(ca91cx42_bridge->slave_resources));
+		list_add_tail(&slave_image->list,
+			&ca91cx42_bridge->slave_resources);
 	}
 
 	/* Add dma engines to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->dma_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->dma_resources);
 	for (i = 0; i < CA91C142_MAX_DMA; i++) {
 		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
 			GFP_KERNEL);
@@ -1714,19 +1715,19 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_dma;
 		}
 		dma_ctrlr->parent = ca91cx42_bridge;
-		mutex_init(&(dma_ctrlr->mtx));
+		mutex_init(&dma_ctrlr->mtx);
 		dma_ctrlr->locked = 0;
 		dma_ctrlr->number = i;
 		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
 			VME_DMA_MEM_TO_VME;
-		INIT_LIST_HEAD(&(dma_ctrlr->pending));
-		INIT_LIST_HEAD(&(dma_ctrlr->running));
-		list_add_tail(&(dma_ctrlr->list),
-			&(ca91cx42_bridge->dma_resources));
+		INIT_LIST_HEAD(&dma_ctrlr->pending);
+		INIT_LIST_HEAD(&dma_ctrlr->running);
+		list_add_tail(&dma_ctrlr->list,
+			&ca91cx42_bridge->dma_resources);
 	}
 
 	/* Add location monitor to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->lm_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->lm_resources);
 	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
 	if (lm == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for "
@@ -1735,11 +1736,11 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_lm;
 	}
 	lm->parent = ca91cx42_bridge;
-	mutex_init(&(lm->mtx));
+	mutex_init(&lm->mtx);
 	lm->locked = 0;
 	lm->number = 1;
 	lm->monitors = 4;
-	list_add_tail(&(lm->list), &(ca91cx42_bridge->lm_resources));
+	list_add_tail(&lm->list, &ca91cx42_bridge->lm_resources);
 
 	ca91cx42_bridge->slave_get = ca91cx42_slave_get;
 	ca91cx42_bridge->slave_set = ca91cx42_slave_set;
@@ -1786,28 +1787,28 @@ err_reg:
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 err_lm:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 err_dma:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 err_slave:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 err_master:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
@@ -1870,28 +1871,28 @@ void ca91cx42_remove(struct pci_dev *pdev)
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 492ddb2..1cba1fa 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -81,11 +81,11 @@ static u32 tsi148_DMA_irqhandler(struct tsi148_driver *bridge,
 	u32 serviced = 0;
 
 	if (channel_mask & TSI148_LCSR_INTS_DMA0S) {
-		wake_up(&(bridge->dma_queue[0]));
+		wake_up(&bridge->dma_queue[0]);
 		serviced |= TSI148_LCSR_INTC_DMA0C;
 	}
 	if (channel_mask & TSI148_LCSR_INTS_DMA1S) {
-		wake_up(&(bridge->dma_queue[1]));
+		wake_up(&bridge->dma_queue[1]);
 		serviced |= TSI148_LCSR_INTC_DMA1C;
 	}
 
@@ -191,7 +191,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
 	if (error) {
 		error->address = error_addr;
 		error->attributes = error_attrib;
-		list_add_tail(&(error->list), &(tsi148_bridge->vme_errors));
+		list_add_tail(&error->list, &tsi148_bridge->vme_errors);
 	} else {
 		dev_err(tsi148_bridge->parent, "Unable to alloc memory for "
 			"VMEbus Error reporting\n");
@@ -210,7 +210,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
  */
 static u32 tsi148_IACK_irqhandler(struct tsi148_driver *bridge)
 {
-	wake_up(&(bridge->iack_queue));
+	wake_up(&bridge->iack_queue);
 
 	return TSI148_LCSR_INTC_IACKC;
 }
@@ -320,9 +320,9 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
 	bridge = tsi148_bridge->driver_priv;
 
 	/* Initialise list for VME bus errors */
-	INIT_LIST_HEAD(&(tsi148_bridge->vme_errors));
+	INIT_LIST_HEAD(&tsi148_bridge->vme_errors);
 
-	mutex_init(&(tsi148_bridge->irq_mtx));
+	mutex_init(&tsi148_bridge->irq_mtx);
 
 	result = request_irq(pdev->irq,
 			     tsi148_irqhandler,
@@ -452,7 +452,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(bridge->vme_int));
+	mutex_lock(&bridge->vme_int);
 
 	/* Read VICR register */
 	tmp = ioread32be(bridge->base + TSI148_LCSR_VICR);
@@ -470,7 +470,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
 	wait_event_interruptible(bridge->iack_queue,
 		tsi148_iack_received(bridge));
 
-	mutex_unlock(&(bridge->vme_int));
+	mutex_unlock(&bridge->vme_int);
 
 	return 0;
 }
@@ -496,7 +496,7 @@ static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge,
 	 */
 	err_pos = NULL;
 	/* Iterate through errors */
-	list_for_each(err_pos, &(tsi148_bridge->vme_errors)) {
+	list_for_each(err_pos, &tsi148_bridge->vme_errors) {
 		vme_err = list_entry(err_pos, struct vme_bus_error, list);
 		if ((vme_err->address >= address) &&
 			(vme_err->address < bound)) {
@@ -530,7 +530,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
 	 */
 	err_pos = NULL;
 	/* Iterate through errors */
-	list_for_each_safe(err_pos, temp, &(tsi148_bridge->vme_errors)) {
+	list_for_each_safe(err_pos, temp, &tsi148_bridge->vme_errors) {
 		vme_err = list_entry(err_pos, struct vme_bus_error, list);
 
 		if ((vme_err->address >= address) &&
@@ -819,8 +819,8 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 		image->kern_base = NULL;
 		if (image->bus_resource.name != NULL)
 			kfree(image->bus_resource.name);
-		release_resource(&(image->bus_resource));
-		memset(&(image->bus_resource), 0, sizeof(struct resource));
+		release_resource(&image->bus_resource);
+		memset(&image->bus_resource, 0, sizeof(struct resource));
 	}
 
 	/* Exit here if size is zero */
@@ -845,7 +845,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 	image->bus_resource.flags = IORESOURCE_MEM;
 
 	retval = pci_bus_alloc_resource(pdev->bus,
-		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
+		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
 		0, NULL, NULL);
 	if (retval) {
 		dev_err(tsi148_bridge->parent, "Failed to allocate mem "
@@ -868,10 +868,10 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
 err_remap:
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 err_resource:
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 err_name:
 	return retval;
 }
@@ -883,9 +883,9 @@ static void tsi148_free_resource(struct vme_master_resource *image)
 {
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 }
 
 /*
@@ -924,7 +924,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		goto err_window;
 	}
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* Let's allocate the resource here rather than further up the stack as
 	 * it avoids pushing loads of bus dependant stuff up the stack. If size
@@ -932,7 +932,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	 */
 	retval = tsi148_alloc_resource(image, size);
 	if (retval) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Unable to allocate memory for "
 			"resource\n");
 		goto err_res;
@@ -959,19 +959,19 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	reg_split(vme_offset, &vme_offset_high, &vme_offset_low);
 
 	if (pci_base_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid PCI base alignment\n");
 		retval = -EINVAL;
 		goto err_gran;
 	}
 	if (pci_bound_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid PCI bound alignment\n");
 		retval = -EINVAL;
 		goto err_gran;
 	}
 	if (vme_offset_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid VME Offset "
 			"alignment\n");
 		retval = -EINVAL;
@@ -1035,7 +1035,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_OTAT_DBW_32;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid data width\n");
 		retval = -EINVAL;
 		goto err_dwidth;
@@ -1072,7 +1072,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_OTAT_AMODE_USER4;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid address space\n");
 		retval = -EINVAL;
 		goto err_aspace;
@@ -1109,7 +1109,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] +
 		TSI148_LCSR_OFFSET_OTAT);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 	return 0;
 
 err_aspace:
@@ -1243,12 +1243,12 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 {
 	int retval;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	retval = __tsi148_master_get(image, enabled, vme_base, size, aspace,
 		cycle, dwidth);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1266,7 +1266,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 
 	tsi148_bridge = image->parent;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	memcpy_fromio(buf, image->kern_base + offset, (unsigned int)count);
 	retval = count;
@@ -1289,7 +1289,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 	}
 
 skip_chk:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1312,7 +1312,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	memcpy_toio(image->kern_base + offset, buf, (unsigned int)count);
 	retval = count;
@@ -1352,7 +1352,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 	}
 
 skip_chk:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1378,10 +1378,10 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	i = image->number;
 
 	/* Locking as we can only do one of these at a time */
-	mutex_lock(&(bridge->vme_rmw));
+	mutex_lock(&bridge->vme_rmw);
 
 	/* Lock image */
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	pci_addr_high = ioread32be(bridge->base + TSI148_LCSR_OT[i] +
 		TSI148_LCSR_OFFSET_OTSAU);
@@ -1411,9 +1411,9 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	tmp &= ~TSI148_LCSR_VMCTRL_RMWEN;
 	iowrite32be(tmp, bridge->base + TSI148_LCSR_VMCTRL);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
-	mutex_unlock(&(bridge->vme_rmw));
+	mutex_unlock(&bridge->vme_rmw);
 
 	return result;
 }
@@ -1633,10 +1633,10 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	}
 
 	/* Test descriptor alignment */
-	if ((unsigned long)&(entry->descriptor) & 0x7) {
+	if ((unsigned long)&entry->descriptor & 0x7) {
 		dev_err(tsi148_bridge->parent, "Descriptor not aligned to 8 "
 			"byte boundary as required: %p\n",
-			&(entry->descriptor));
+			&entry->descriptor);
 		retval = -EINVAL;
 		goto err_align;
 	}
@@ -1644,7 +1644,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	/* Given we are going to fill out the structure, we probably don't
 	 * need to zero it, but better safe than sorry for now.
 	 */
-	memset(&(entry->descriptor), 0, sizeof(struct tsi148_dma_descriptor));
+	memset(&entry->descriptor, 0, sizeof(struct tsi148_dma_descriptor));
 
 	/* Fill out source part */
 	switch (src->type) {
@@ -1681,7 +1681,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		entry->descriptor.dsat = TSI148_LCSR_DSAT_TYP_VME;
 
 		retval = tsi148_dma_set_vme_src_attributes(
-			tsi148_bridge->parent, &(entry->descriptor.dsat),
+			tsi148_bridge->parent, &entry->descriptor.dsat,
 			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
 		if (retval < 0)
 			goto err_source;
@@ -1719,7 +1719,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		entry->descriptor.ddat = TSI148_LCSR_DDAT_TYP_VME;
 
 		retval = tsi148_dma_set_vme_dest_attributes(
-			tsi148_bridge->parent, &(entry->descriptor.ddat),
+			tsi148_bridge->parent, &entry->descriptor.ddat,
 			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
 		if (retval < 0)
 			goto err_dest;
@@ -1735,16 +1735,16 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	entry->descriptor.dcnt = (u32)count;
 
 	/* Add to list */
-	list_add_tail(&(entry->list), &(list->entries));
+	list_add_tail(&entry->list, &list->entries);
 
 	/* Fill out previous descriptors "Next Address" */
-	if (entry->list.prev != &(list->entries)) {
+	if (entry->list.prev != &list->entries) {
 		prev = list_entry(entry->list.prev, struct tsi148_dma_entry,
 			list);
 		/* We need the bus address for the pointer */
-		desc_ptr = virt_to_bus(&(entry->descriptor));
-		reg_split(desc_ptr, &(prev->descriptor.dnlau),
-			&(prev->descriptor.dnlal));
+		desc_ptr = virt_to_bus(&entry->descriptor);
+		reg_split(desc_ptr, &prev->descriptor.dnlau,
+			&prev->descriptor.dnlal);
 	}
 
 	return 0;
@@ -1799,30 +1799,30 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
 
 	channel = ctrlr->number;
 
-	if (!list_empty(&(ctrlr->running))) {
+	if (!list_empty(&ctrlr->running)) {
 		/*
 		 * XXX We have an active DMA transfer and currently haven't
 		 *     sorted out the mechanism for "pending" DMA transfers.
 		 *     Return busy.
 		 */
 		/* Need to add to pending here */
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	} else {
-		list_add(&(list->list), &(ctrlr->running));
+		list_add(&list->list, &ctrlr->running);
 	}
 
 	/* Get first bus address and write into registers */
-	entry = list_first_entry(&(list->entries), struct tsi148_dma_entry,
+	entry = list_first_entry(&list->entries, struct tsi148_dma_entry,
 		list);
 
-	bus_addr = virt_to_bus(&(entry->descriptor));
+	bus_addr = virt_to_bus(&entry->descriptor);
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	reg_split(bus_addr, &bus_addr_high, &bus_addr_low);
 
@@ -1850,9 +1850,9 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
 	}
 
 	/* Remove list from running list */
-	mutex_lock(&(ctrlr->mtx));
-	list_del(&(list->list));
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
+	list_del(&list->list);
+	mutex_unlock(&ctrlr->mtx);
 
 	return retval;
 }
@@ -1868,7 +1868,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
 	struct tsi148_dma_entry *entry;
 
 	/* detach and free each entry */
-	list_for_each_safe(pos, temp, &(list->entries)) {
+	list_for_each_safe(pos, temp, &list->entries) {
 		list_del(pos);
 		entry = list_entry(pos, struct tsi148_dma_entry, list);
 		kfree(entry);
@@ -1896,12 +1896,12 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* If we already have a callback attached, we can't move it! */
 	for (i = 0; i < lm->monitors; i++) {
 		if (bridge->lm_callback[i] != NULL) {
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			dev_err(tsi148_bridge->parent, "Location monitor "
 				"callback attached, can't reset\n");
 			return -EBUSY;
@@ -1922,7 +1922,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		lm_ctl |= TSI148_LCSR_LMAT_AS_A64;
 		break;
 	default:
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Invalid address space\n");
 		return -EINVAL;
 		break;
@@ -1943,7 +1943,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	iowrite32be(lm_base_low, bridge->base + TSI148_LCSR_LMBAL);
 	iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1959,7 +1959,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	lm_base_high = ioread32be(bridge->base + TSI148_LCSR_LMBAU);
 	lm_base_low = ioread32be(bridge->base + TSI148_LCSR_LMBAL);
@@ -1992,7 +1992,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	if (lm_ctl & TSI148_LCSR_LMAT_DATA)
 		*cycle |= VME_DATA;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return enabled;
 }
@@ -2013,12 +2013,12 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Ensure that the location monitor is configured - need PGM or DATA */
 	lm_ctl = ioread32be(bridge->base + TSI148_LCSR_LMAT);
 	if ((lm_ctl & (TSI148_LCSR_LMAT_PGM | TSI148_LCSR_LMAT_DATA)) == 0) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Location monitor not properly "
 			"configured\n");
 		return -EINVAL;
@@ -2026,7 +2026,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 
 	/* Check that a callback isn't already attached */
 	if (bridge->lm_callback[monitor] != NULL) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Existing callback attached\n");
 		return -EBUSY;
 	}
@@ -2049,7 +2049,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 		iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -2064,7 +2064,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Disable Location Monitor and ensure previous interrupts are clear */
 	lm_en = ioread32be(bridge->base + TSI148_LCSR_INTEN);
@@ -2089,7 +2089,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 		iowrite32be(tmp, bridge->base + TSI148_LCSR_LMAT);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -2142,7 +2142,7 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
 
 	/* Allocate mem for CR/CSR image */
 	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-		&(bridge->crcsr_bus));
+		&bridge->crcsr_bus);
 	if (bridge->crcsr_kernel == NULL) {
 		dev_err(tsi148_bridge->parent, "Failed to allocate memory for "
 			"CR/CSR image\n");
@@ -2280,13 +2280,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Initialize wait queues & mutual exclusion flags */
-	init_waitqueue_head(&(tsi148_device->dma_queue[0]));
-	init_waitqueue_head(&(tsi148_device->dma_queue[1]));
-	init_waitqueue_head(&(tsi148_device->iack_queue));
-	mutex_init(&(tsi148_device->vme_int));
-	mutex_init(&(tsi148_device->vme_rmw));
+	init_waitqueue_head(&tsi148_device->dma_queue[0]);
+	init_waitqueue_head(&tsi148_device->dma_queue[1]);
+	init_waitqueue_head(&tsi148_device->iack_queue);
+	mutex_init(&tsi148_device->vme_int);
+	mutex_init(&tsi148_device->vme_rmw);
 
-	tsi148_bridge->parent = &(pdev->dev);
+	tsi148_bridge->parent = &pdev->dev;
 	strcpy(tsi148_bridge->name, driver_name);
 
 	/* Setup IRQ */
@@ -2314,7 +2314,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		tsi148_device->flush_image->parent = tsi148_bridge;
-		spin_lock_init(&(tsi148_device->flush_image->lock));
+		spin_lock_init(&tsi148_device->flush_image->lock);
 		tsi148_device->flush_image->locked = 1;
 		tsi148_device->flush_image->number = master_num;
 		tsi148_device->flush_image->address_attr = VME_A16 | VME_A24 |
@@ -2324,13 +2324,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eSST160 | VME_2eSST267 | VME_2eSST320 | VME_SUPER |
 			VME_USER | VME_PROG | VME_DATA;
 		tsi148_device->flush_image->width_attr = VME_D16 | VME_D32;
-		memset(&(tsi148_device->flush_image->bus_resource), 0,
+		memset(&tsi148_device->flush_image->bus_resource, 0,
 			sizeof(struct resource));
 		tsi148_device->flush_image->kern_base  = NULL;
 	}
 
 	/* Add master windows to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->master_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->master_resources);
 	for (i = 0; i < master_num; i++) {
 		master_image = kmalloc(sizeof(struct vme_master_resource),
 			GFP_KERNEL);
@@ -2341,7 +2341,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		master_image->parent = tsi148_bridge;
-		spin_lock_init(&(master_image->lock));
+		spin_lock_init(&master_image->lock);
 		master_image->locked = 0;
 		master_image->number = i;
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -2351,15 +2351,15 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
-		memset(&(master_image->bus_resource), 0,
+		memset(&master_image->bus_resource, 0,
 			sizeof(struct resource));
 		master_image->kern_base  = NULL;
-		list_add_tail(&(master_image->list),
-			&(tsi148_bridge->master_resources));
+		list_add_tail(&master_image->list,
+			&tsi148_bridge->master_resources);
 	}
 
 	/* Add slave windows to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->slave_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->slave_resources);
 	for (i = 0; i < TSI148_MAX_SLAVE; i++) {
 		slave_image = kmalloc(sizeof(struct vme_slave_resource),
 			GFP_KERNEL);
@@ -2370,7 +2370,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_slave;
 		}
 		slave_image->parent = tsi148_bridge;
-		mutex_init(&(slave_image->mtx));
+		mutex_init(&slave_image->mtx);
 		slave_image->locked = 0;
 		slave_image->number = i;
 		slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -2380,12 +2380,12 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
 			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
-		list_add_tail(&(slave_image->list),
-			&(tsi148_bridge->slave_resources));
+		list_add_tail(&slave_image->list,
+			&tsi148_bridge->slave_resources);
 	}
 
 	/* Add dma engines to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->dma_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->dma_resources);
 	for (i = 0; i < TSI148_MAX_DMA; i++) {
 		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
 			GFP_KERNEL);
@@ -2396,21 +2396,21 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_dma;
 		}
 		dma_ctrlr->parent = tsi148_bridge;
-		mutex_init(&(dma_ctrlr->mtx));
+		mutex_init(&dma_ctrlr->mtx);
 		dma_ctrlr->locked = 0;
 		dma_ctrlr->number = i;
 		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
 			VME_DMA_MEM_TO_VME | VME_DMA_VME_TO_VME |
 			VME_DMA_MEM_TO_MEM | VME_DMA_PATTERN_TO_VME |
 			VME_DMA_PATTERN_TO_MEM;
-		INIT_LIST_HEAD(&(dma_ctrlr->pending));
-		INIT_LIST_HEAD(&(dma_ctrlr->running));
-		list_add_tail(&(dma_ctrlr->list),
-			&(tsi148_bridge->dma_resources));
+		INIT_LIST_HEAD(&dma_ctrlr->pending);
+		INIT_LIST_HEAD(&dma_ctrlr->running);
+		list_add_tail(&dma_ctrlr->list,
+			&tsi148_bridge->dma_resources);
 	}
 
 	/* Add location monitor to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->lm_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->lm_resources);
 	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
 	if (lm == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for "
@@ -2419,11 +2419,11 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_lm;
 	}
 	lm->parent = tsi148_bridge;
-	mutex_init(&(lm->mtx));
+	mutex_init(&lm->mtx);
 	lm->locked = 0;
 	lm->number = 1;
 	lm->monitors = 4;
-	list_add_tail(&(lm->list), &(tsi148_bridge->lm_resources));
+	list_add_tail(&lm->list, &tsi148_bridge->lm_resources);
 
 	tsi148_bridge->slave_get = tsi148_slave_get;
 	tsi148_bridge->slave_set = tsi148_slave_set;
@@ -2483,28 +2483,28 @@ err_reg:
 err_crcsr:
 err_lm:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->lm_resources)) {
+	list_for_each(pos, &tsi148_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 err_dma:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
+	list_for_each(pos, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 err_slave:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
+	list_for_each(pos, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 err_master:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->master_resources)) {
+	list_for_each(pos, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
@@ -2589,21 +2589,21 @@ static void tsi148_remove(struct pci_dev *pdev)
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
+	list_for_each(pos, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
+	list_for_each(pos, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->master_resources)) {
+	list_for_each(pos, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 71bbc52..cbe2e11 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -470,9 +470,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			 *	to userspace as they are
 			 */
 			retval = vme_master_get(image[minor].resource,
-				&(master.enable), &(master.vme_addr),
-				&(master.size), &(master.aspace),
-				&(master.cycle), &(master.dwidth));
+				&master.enable, &master.vme_addr,
+				&master.size, &master.aspace,
+				&master.cycle, &master.dwidth);
 
 			copied = copy_to_user((char *)arg, &master,
 				sizeof(struct vme_master));
@@ -514,9 +514,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			 *	to userspace as they are
 			 */
 			retval = vme_slave_get(image[minor].resource,
-				&(slave.enable), &(slave.vme_addr),
-				&(slave.size), &pci_addr, &(slave.aspace),
-				&(slave.cycle));
+				&slave.enable, &slave.vme_addr,
+				&slave.size, &pci_addr, &slave.aspace,
+				&slave.cycle);
 
 			copied = copy_to_user((char *)arg, &slave,
 				sizeof(struct vme_slave));
@@ -683,7 +683,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
 	for (i = 0; i < VME_DEVS; i++) {
 		image[i].kern_buf = NULL;
 		image[i].pci_buf = 0;
-		sema_init(&(image[i].sem), 1);
+		sema_init(&image[i].sem, 1);
 		image[i].device = NULL;
 		image[i].resource = NULL;
 		image[i].users = 0;
@@ -727,7 +727,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
-			image[i].size_buf, &(image[i].pci_buf));
+			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
 			printk(KERN_WARNING "Unable to allocate memory for "
 				"buffer\n");
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 093fbff..47e9d5c 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -245,7 +245,7 @@ struct vme_resource *vme_slave_request(struct device *dev,
 	}
 
 	/* Loop through slave resources */
-	list_for_each(slave_pos, &(bridge->slave_resources)) {
+	list_for_each(slave_pos, &bridge->slave_resources) {
 		slave_image = list_entry(slave_pos,
 			struct vme_slave_resource, list);
 
@@ -255,17 +255,17 @@ struct vme_resource *vme_slave_request(struct device *dev,
 		}
 
 		/* Find an unlocked and compatible image */
-		mutex_lock(&(slave_image->mtx));
+		mutex_lock(&slave_image->mtx);
 		if (((slave_image->address_attr & address) == address) &&
 			((slave_image->cycle_attr & cycle) == cycle) &&
 			(slave_image->locked == 0)) {
 
 			slave_image->locked = 1;
-			mutex_unlock(&(slave_image->mtx));
+			mutex_unlock(&slave_image->mtx);
 			allocated_image = slave_image;
 			break;
 		}
-		mutex_unlock(&(slave_image->mtx));
+		mutex_unlock(&slave_image->mtx);
 	}
 
 	/* No free image */
@@ -278,15 +278,15 @@ struct vme_resource *vme_slave_request(struct device *dev,
 		goto err_alloc;
 	}
 	resource->type = VME_SLAVE;
-	resource->entry = &(allocated_image->list);
+	resource->entry = &allocated_image->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(slave_image->mtx));
+	mutex_lock(&slave_image->mtx);
 	slave_image->locked = 0;
-	mutex_unlock(&(slave_image->mtx));
+	mutex_unlock(&slave_image->mtx);
 err_image:
 err_bus:
 	return NULL;
@@ -369,12 +369,12 @@ void vme_slave_free(struct vme_resource *resource)
 	}
 
 	/* Unlock image */
-	mutex_lock(&(slave_image->mtx));
+	mutex_lock(&slave_image->mtx);
 	if (slave_image->locked == 0)
 		printk(KERN_ERR "Image is already free\n");
 
 	slave_image->locked = 0;
-	mutex_unlock(&(slave_image->mtx));
+	mutex_unlock(&slave_image->mtx);
 
 	/* Free up resource memory */
 	kfree(resource);
@@ -401,7 +401,7 @@ struct vme_resource *vme_master_request(struct device *dev,
 	}
 
 	/* Loop through master resources */
-	list_for_each(master_pos, &(bridge->master_resources)) {
+	list_for_each(master_pos, &bridge->master_resources) {
 		master_image = list_entry(master_pos,
 			struct vme_master_resource, list);
 
@@ -411,18 +411,18 @@ struct vme_resource *vme_master_request(struct device *dev,
 		}
 
 		/* Find an unlocked and compatible image */
-		spin_lock(&(master_image->lock));
+		spin_lock(&master_image->lock);
 		if (((master_image->address_attr & address) == address) &&
 			((master_image->cycle_attr & cycle) == cycle) &&
 			((master_image->width_attr & dwidth) == dwidth) &&
 			(master_image->locked == 0)) {
 
 			master_image->locked = 1;
-			spin_unlock(&(master_image->lock));
+			spin_unlock(&master_image->lock);
 			allocated_image = master_image;
 			break;
 		}
-		spin_unlock(&(master_image->lock));
+		spin_unlock(&master_image->lock);
 	}
 
 	/* Check to see if we found a resource */
@@ -437,16 +437,16 @@ struct vme_resource *vme_master_request(struct device *dev,
 		goto err_alloc;
 	}
 	resource->type = VME_MASTER;
-	resource->entry = &(allocated_image->list);
+	resource->entry = &allocated_image->list;
 
 	return resource;
 
 	kfree(resource);
 err_alloc:
 	/* Unlock image */
-	spin_lock(&(master_image->lock));
+	spin_lock(&master_image->lock);
 	master_image->locked = 0;
-	spin_unlock(&(master_image->lock));
+	spin_unlock(&master_image->lock);
 err_image:
 err_bus:
 	return NULL;
@@ -628,12 +628,12 @@ void vme_master_free(struct vme_resource *resource)
 	}
 
 	/* Unlock image */
-	spin_lock(&(master_image->lock));
+	spin_lock(&master_image->lock);
 	if (master_image->locked == 0)
 		printk(KERN_ERR "Image is already free\n");
 
 	master_image->locked = 0;
-	spin_unlock(&(master_image->lock));
+	spin_unlock(&master_image->lock);
 
 	/* Free up resource memory */
 	kfree(resource);
@@ -662,7 +662,7 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 	}
 
 	/* Loop through DMA resources */
-	list_for_each(dma_pos, &(bridge->dma_resources)) {
+	list_for_each(dma_pos, &bridge->dma_resources) {
 		dma_ctrlr = list_entry(dma_pos,
 			struct vme_dma_resource, list);
 
@@ -672,16 +672,16 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 		}
 
 		/* Find an unlocked and compatible controller */
-		mutex_lock(&(dma_ctrlr->mtx));
+		mutex_lock(&dma_ctrlr->mtx);
 		if (((dma_ctrlr->route_attr & route) == route) &&
 			(dma_ctrlr->locked == 0)) {
 
 			dma_ctrlr->locked = 1;
-			mutex_unlock(&(dma_ctrlr->mtx));
+			mutex_unlock(&dma_ctrlr->mtx);
 			allocated_ctrlr = dma_ctrlr;
 			break;
 		}
-		mutex_unlock(&(dma_ctrlr->mtx));
+		mutex_unlock(&dma_ctrlr->mtx);
 	}
 
 	/* Check to see if we found a resource */
@@ -694,15 +694,15 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 		goto err_alloc;
 	}
 	resource->type = VME_DMA;
-	resource->entry = &(allocated_ctrlr->list);
+	resource->entry = &allocated_ctrlr->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(dma_ctrlr->mtx));
+	mutex_lock(&dma_ctrlr->mtx);
 	dma_ctrlr->locked = 0;
-	mutex_unlock(&(dma_ctrlr->mtx));
+	mutex_unlock(&dma_ctrlr->mtx);
 err_ctrlr:
 err_bus:
 	return NULL;
@@ -729,9 +729,9 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource)
 		printk(KERN_ERR "Unable to allocate memory for new dma list\n");
 		return NULL;
 	}
-	INIT_LIST_HEAD(&(dma_list->entries));
+	INIT_LIST_HEAD(&dma_list->entries);
 	dma_list->parent = ctrlr;
-	mutex_init(&(dma_list->mtx));
+	mutex_init(&dma_list->mtx);
 
 	return dma_list;
 }
@@ -880,14 +880,14 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		return -EINVAL;
 	}
 
-	if (!mutex_trylock(&(list->mtx))) {
+	if (!mutex_trylock(&list->mtx)) {
 		printk(KERN_ERR "Link List already submitted\n");
 		return -EINVAL;
 	}
 
 	retval = bridge->dma_list_add(list, src, dest, count);
 
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 
 	return retval;
 }
@@ -903,11 +903,11 @@ int vme_dma_list_exec(struct vme_dma_list *list)
 		return -EINVAL;
 	}
 
-	mutex_lock(&(list->mtx));
+	mutex_lock(&list->mtx);
 
 	retval = bridge->dma_list_exec(list);
 
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 
 	return retval;
 }
@@ -923,7 +923,7 @@ int vme_dma_list_free(struct vme_dma_list *list)
 		return -EINVAL;
 	}
 
-	if (!mutex_trylock(&(list->mtx))) {
+	if (!mutex_trylock(&list->mtx)) {
 		printk(KERN_ERR "Link List in use\n");
 		return -EINVAL;
 	}
@@ -935,10 +935,10 @@ int vme_dma_list_free(struct vme_dma_list *list)
 	retval = bridge->dma_list_empty(list);
 	if (retval) {
 		printk(KERN_ERR "Unable to empty link-list entries\n");
-		mutex_unlock(&(list->mtx));
+		mutex_unlock(&list->mtx);
 		return retval;
 	}
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 	kfree(list);
 
 	return retval;
@@ -956,20 +956,20 @@ int vme_dma_free(struct vme_resource *resource)
 
 	ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
 
-	if (!mutex_trylock(&(ctrlr->mtx))) {
+	if (!mutex_trylock(&ctrlr->mtx)) {
 		printk(KERN_ERR "Resource busy, can't free\n");
 		return -EBUSY;
 	}
 
-	if (!(list_empty(&(ctrlr->pending)) && list_empty(&(ctrlr->running)))) {
+	if (!(list_empty(&ctrlr->pending) && list_empty(&ctrlr->running))) {
 		printk(KERN_WARNING "Resource still processing transfers\n");
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	}
 
 	ctrlr->locked = 0;
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	return 0;
 }
@@ -1013,10 +1013,10 @@ int vme_irq_request(struct device *dev, int level, int statid,
 		return -EINVAL;
 	}
 
-	mutex_lock(&(bridge->irq_mtx));
+	mutex_lock(&bridge->irq_mtx);
 
 	if (bridge->irq[level - 1].callback[statid].func) {
-		mutex_unlock(&(bridge->irq_mtx));
+		mutex_unlock(&bridge->irq_mtx);
 		printk(KERN_WARNING "VME Interrupt already taken\n");
 		return -EBUSY;
 	}
@@ -1028,7 +1028,7 @@ int vme_irq_request(struct device *dev, int level, int statid,
 	/* Enable IRQ level */
 	bridge->irq_set(bridge, level, 1, 1);
 
-	mutex_unlock(&(bridge->irq_mtx));
+	mutex_unlock(&bridge->irq_mtx);
 
 	return 0;
 }
@@ -1054,7 +1054,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
 		return;
 	}
 
-	mutex_lock(&(bridge->irq_mtx));
+	mutex_lock(&bridge->irq_mtx);
 
 	bridge->irq[level - 1].count--;
 
@@ -1065,7 +1065,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
 	bridge->irq[level - 1].callback[statid].func = NULL;
 	bridge->irq[level - 1].callback[statid].priv_data = NULL;
 
-	mutex_unlock(&(bridge->irq_mtx));
+	mutex_unlock(&bridge->irq_mtx);
 }
 EXPORT_SYMBOL(vme_irq_free);
 
@@ -1111,7 +1111,7 @@ struct vme_resource *vme_lm_request(struct device *dev)
 	}
 
 	/* Loop through DMA resources */
-	list_for_each(lm_pos, &(bridge->lm_resources)) {
+	list_for_each(lm_pos, &bridge->lm_resources) {
 		lm = list_entry(lm_pos,
 			struct vme_lm_resource, list);
 
@@ -1122,14 +1122,14 @@ struct vme_resource *vme_lm_request(struct device *dev)
 		}
 
 		/* Find an unlocked controller */
-		mutex_lock(&(lm->mtx));
+		mutex_lock(&lm->mtx);
 		if (lm->locked == 0) {
 			lm->locked = 1;
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			allocated_lm = lm;
 			break;
 		}
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 	}
 
 	/* Check to see if we found a resource */
@@ -1142,15 +1142,15 @@ struct vme_resource *vme_lm_request(struct device *dev)
 		goto err_alloc;
 	}
 	resource->type = VME_LM;
-	resource->entry = &(allocated_lm->list);
+	resource->entry = &allocated_lm->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 	lm->locked = 0;
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 err_lm:
 err_bus:
 	return NULL;
@@ -1270,7 +1270,7 @@ void vme_lm_free(struct vme_resource *resource)
 
 	lm = list_entry(resource->entry, struct vme_lm_resource, list);
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* XXX
 	 * Check to see that there aren't any callbacks still attached, if
@@ -1279,7 +1279,7 @@ void vme_lm_free(struct vme_resource *resource)
 
 	lm->locked = 0;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	kfree(resource);
 }
@@ -1343,11 +1343,11 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	 * specification.
 	 */
 	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		memset(dev, 0, sizeof(struct device));
 
 		dev->parent = bridge->parent;
-		dev->bus = &(vme_bus_type);
+		dev->bus = &vme_bus_type;
 		/*
 		 * We save a pointer to the bridge in platform_data so that we
 		 * can get to it later. We keep driver_data for use by the
@@ -1366,7 +1366,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	i = VME_SLOTS_MAX;
 err_reg:
 	while (i > -1) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
 	vme_free_bus_num(bridge->num);
@@ -1381,7 +1381,7 @@ void vme_unregister_bridge(struct vme_bridge *bridge)
 
 
 	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
 	vme_free_bus_num(bridge->num);
@@ -1418,7 +1418,7 @@ static int vme_calc_slot(struct device *dev)
 	/* Determine slot number */
 	num = 0;
 	while (num < VME_SLOTS_MAX) {
-		if (&(bridge->dev[num]) == dev)
+		if (&bridge->dev[num] == dev)
 			break;
 
 		num++;
-- 
1.7.1


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

* [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
  2010-10-26  1:10 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:25   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 03/30] staging/vme_user: remove unreachable line Emilio G. Cota
                   ` (28 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

When init_module fails, 0 is returned anyway; the module is then installed
and oopses when we try to remove it:

[ 3236.368009] WARNING: at drivers/base/driver.c:262 driver_unregister+0x36/0x6f()
[ 3236.368012] Hardware name:
[ 3236.368014] Unexpected driver unregister!
[ 3236.368016] Modules linked in: vme_user(-) vme_tsi148 vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: vme]
[ 3236.368027] Pid: 16162, comm: rmmod Not tainted 2.6.35 #2
[ 3236.368029] Call Trace:
[ 3236.368037]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
[ 3236.368044]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368049]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
[ 3236.368054]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368059]  [<ffffffff811e8f78>] driver_unregister+0x36/0x6f
[ 3236.368066]  [<ffffffffa004aa44>] vme_unregister_driver+0xd/0xf [vme]
[ 3236.368072]  [<ffffffffa00616c8>] vme_user_exit+0x10/0x1e [vme_user]
[ 3236.368076]  [<ffffffff810612c1>] sys_delete_module+0x1ba/0x226
[ 3236.368082]  [<ffffffff812d6e14>] ? do_page_fault+0x25d/0x28a
[ 3236.368088]  [<ffffffff8100202b>] system_call_fastpath+0x16/0x1b
[ 3236.368092] ---[ end trace cab6d88ebc44c1de ]---

The appended fixes it by returning the appropriate error code in module_init
whenever something goes wrong, thus cancelling the insertion of the module.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index cbe2e11..a6f6116 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -611,6 +611,7 @@ static int __init vme_user_init(void)
 	if (bus_num == 0) {
 		printk(KERN_ERR "%s: No cards, skipping registration\n",
 			driver_name);
+		retval = -ENODEV;
 		goto err_nocard;
 	}
 
@@ -629,6 +630,7 @@ static int __init vme_user_init(void)
 	if (ids == NULL) {
 		printk(KERN_ERR "%s: Unable to allocate ID table\n",
 			driver_name);
+		retval = -ENOMEM;
 		goto err_id;
 	}
 
-- 
1.7.1


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

* [PATCH 03/30] staging/vme_user: remove unreachable line
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
  2010-10-26  1:10 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
  2010-10-26  1:10 ` [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:39   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers Emilio G. Cota
                   ` (27 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index a6f6116..bdc4e1e 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -654,7 +654,6 @@ static int __init vme_user_init(void)
 
 	return retval;
 
-	vme_unregister_driver(&vme_user_driver);
 err_reg:
 	kfree(ids);
 err_id:
-- 
1.7.1


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

* [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (2 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 03/30] staging/vme_user: remove unreachable line Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:41   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Emilio G. Cota
                   ` (26 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

In a configuration with several bridges, each bridge is
assigned a certain bus number depending on the order in which
vme_register_bridge is called. This can complicate multi-bridge
installations because the eventual bus numbers will depend
on the order the bridges were loaded.

The appended allows bridges to register with a bus number of
their choice, while keeping the previous 'first come, first
served' behaviour as the default.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |    1 +
 drivers/staging/vme/bridges/vme_tsi148.c   |    1 +
 drivers/staging/vme/vme.c                  |   46 +++++++++++++++++++++-------
 drivers/staging/vme/vme.h                  |    1 +
 4 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 1f2089f..14e10a6 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -1600,6 +1600,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	ca91cx42_bridge->driver_priv = ca91cx42_device;
+	ca91cx42_bridge->num = -1;
 
 	/* Enable the device */
 	retval = pci_enable_device(pdev);
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 1cba1fa..e341122 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2247,6 +2247,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	tsi148_bridge->driver_priv = tsi148_device;
+	tsi148_bridge->num = -1;
 
 	/* Enable the device */
 	retval = pci_enable_device(pdev);
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 47e9d5c..9fa0609 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1307,20 +1307,42 @@ EXPORT_SYMBOL(vme_slot_get);
 
 /* - Bridge Registration --------------------------------------------------- */
 
-static int vme_alloc_bus_num(void)
+/* call with vme_bus_num_mtx held */
+static int __vme_alloc_bus_num(int *bus)
 {
-	int i;
-
-	mutex_lock(&vme_bus_num_mtx);
-	for (i = 0; i < sizeof(vme_bus_numbers) * 8; i++) {
-		if (((vme_bus_numbers >> i) & 0x1) == 0) {
-			vme_bus_numbers |= (0x1 << i);
-			break;
+	int index;
+
+	if (*bus == -1) {
+		/* try to find a free bus number */
+		for (index = 0; index < VME_MAX_BRIDGES; index++) {
+			if (~vme_bus_numbers & 1 << index) {
+				*bus = index;
+				break;
+			}
+		}
+		if (index == VME_MAX_BRIDGES) {
+			pr_warn("vme: No bus numbers left\n");
+			return -ENODEV;
+		}
+	} else {
+		/* check if the given bus number is already in use */
+		if (vme_bus_numbers & (1 << *bus)) {
+			pr_warn("vme: bus number %d already in use\n", *bus);
+			return -EBUSY;
 		}
 	}
-	mutex_unlock(&vme_bus_num_mtx);
+	vme_bus_numbers |= 1 << *bus;
+	return 0;
+}
+
+static int vme_alloc_bus_num(int *bus)
+{
+	int ret;
 
-	return i;
+	mutex_lock(&vme_bus_num_mtx);
+	ret = __vme_alloc_bus_num(bus);
+	mutex_unlock(&vme_bus_num_mtx);
+	return ret;
 }
 
 static void vme_free_bus_num(int bus)
@@ -1336,7 +1358,9 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	int retval;
 	int i;
 
-	bridge->num = vme_alloc_bus_num();
+	retval = vme_alloc_bus_num(&bridge->num);
+	if (retval)
+		return retval;
 
 	/* This creates 32 vme "slot" devices. This equates to a slot for each
 	 * ID available in a system conforming to the ANSI/VITA 1-1994
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index 48768ca..5cdfa52 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -88,6 +88,7 @@ struct vme_resource {
 
 extern struct bus_type vme_bus_type;
 
+#define VME_MAX_BRIDGES		32
 #define VME_SLOT_CURRENT	-1
 #define VME_SLOT_ALL		-2
 
-- 
1.7.1


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

* [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (3 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:49   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Emilio G. Cota
                   ` (25 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 9fa0609..afd2dbd 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1348,7 +1348,7 @@ static int vme_alloc_bus_num(int *bus)
 static void vme_free_bus_num(int bus)
 {
 	mutex_lock(&vme_bus_num_mtx);
-	vme_bus_numbers |= ~(0x1 << bus);
+	vme_bus_numbers &= ~(0x1 << bus);
 	mutex_unlock(&vme_bus_num_mtx);
 }
 
-- 
1.7.1


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

* [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (4 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27  9:51   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ " Emilio G. Cota
                   ` (24 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

This fixes an oops when removing the module.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index e341122..660968e 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2532,6 +2532,7 @@ err_struct:
 static void tsi148_remove(struct pci_dev *pdev)
 {
 	struct list_head *pos = NULL;
+	struct list_head *tmplist;
 	struct vme_master_resource *master_image;
 	struct vme_slave_resource *slave_image;
 	struct vme_dma_resource *dma_ctrlr;
@@ -2590,21 +2591,21 @@ static void tsi148_remove(struct pci_dev *pdev)
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->dma_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->slave_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->master_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
-- 
1.7.1


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

* [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ in .remove
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (5 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 10:01   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq Emilio G. Cota
                   ` (23 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

tsi148_irq_exit is called twice in .remove, which causes an oops.

Remove the second call, which apart from being redundant cannot
possibly work; the CR/CSR space has been already unmapped.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 660968e..acfbd59 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2612,8 +2612,6 @@ static void tsi148_remove(struct pci_dev *pdev)
 		kfree(master_image);
 	}
 
-	tsi148_irq_exit(bridge, pdev);
-
 	iounmap(bridge->base);
 
 	pci_release_regions(pdev);
-- 
1.7.1


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

* [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (6 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ " Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 10:23   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota
                   ` (22 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

The cookie passed to request_irq isn't the same as the one passed
to free_irq, which results in the following warning:

[   63.243533] WARNING: at kernel/irq/manage.c:899 __free_irq+0x9b/0x17d()
[   63.243533] Hardware name:
[   63.243533] Trying to free already-free IRQ 17
[   63.243533] Modules linked in: vme_tsi148(-) vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: scsi_wait_scan]
[   63.243533] Pid: 2013, comm: rmmod Not tainted 2.6.35 #2
[   63.243533] Call Trace:
[   63.243533]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
[   63.243533]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
[   63.243533]  [<ffffffff810678c4>] __free_irq+0x9b/0x17d
[   63.243533]  [<ffffffff810679d9>] free_irq+0x33/0x4e
[   63.243533]  [<ffffffffa004a897>] tsi148_irq_exit+0x6b/0x70 [vme_tsi148]
[...]
[   63.243533] ---[ end trace bbf92311d969efb4 ]---

Fix it by passing the same cookie to both functions.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.c   |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
 create mode 100644 drivers/staging/vme/bridges/Module.symvers

diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers
new file mode 100644
index 0000000..e69de29
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index acfbd59..5bb999f 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -374,8 +374,10 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
 	return 0;
 }
 
-static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
+static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge, struct pci_dev *pdev)
 {
+	struct tsi148_driver *bridge = tsi148_bridge->driver_priv;
+
 	/* Turn off interrupts */
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEO);
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEN);
@@ -384,7 +386,7 @@ static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
 	iowrite32be(0xFFFFFFFF, bridge->base + TSI148_LCSR_INTC);
 
 	/* Detach interrupt handler */
-	free_irq(pdev->irq, pdev);
+	free_irq(pdev->irq, tsi148_bridge);
 }
 
 /*
@@ -2512,7 +2514,7 @@ err_master:
 		kfree(master_image);
 	}
 
-	tsi148_irq_exit(tsi148_device, pdev);
+	tsi148_irq_exit(tsi148_bridge, pdev);
 err_irq:
 err_test:
 	iounmap(tsi148_device->base);
@@ -2584,7 +2586,7 @@ static void tsi148_remove(struct pci_dev *pdev)
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM1);
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM2);
 
-	tsi148_irq_exit(bridge, pdev);
+	tsi148_irq_exit(tsi148_bridge, pdev);
 
 	vme_unregister_bridge(tsi148_bridge);
 
-- 
1.7.1


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

* [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (7 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 10:54   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 10/30] staging/vme/tsi148: remove unreachable line Emilio G. Cota
                   ` (21 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Without it we get 32 warnings, one per device being released, when
removing a bridge module.

After applying this patch, bridge modules can at last be removed
without any apparent hiccup.

[Note: tested only on the tsi148, it's the only bridge I've got]

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index afd2dbd..59650dd 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1352,6 +1352,11 @@ static void vme_free_bus_num(int bus)
 	mutex_unlock(&vme_bus_num_mtx);
 }
 
+/* Note: device_release(dev) throws a warning if dev->release isn't filled in */
+static void vme_dev_release(struct device *dev)
+{
+}
+
 int vme_register_bridge(struct vme_bridge *bridge)
 {
 	struct device *dev;
@@ -1372,6 +1377,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
 
 		dev->parent = bridge->parent;
 		dev->bus = &vme_bus_type;
+		dev->release = vme_dev_release;
 		/*
 		 * We save a pointer to the bridge in platform_data so that we
 		 * can get to it later. We keep driver_data for use by the
-- 
1.7.1


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

* [PATCH 10/30] staging/vme/tsi148: remove unreachable line
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (8 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 11:06   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 11/30] staging/vme/tsi148: declare static functions as such Emilio G. Cota
                   ` (20 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 5bb999f..c08927e 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2480,7 +2480,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	return 0;
 
-	vme_unregister_bridge(tsi148_bridge);
 err_reg:
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 err_crcsr:
-- 
1.7.1


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

* [PATCH 11/30] staging/vme/tsi148: declare static functions as such
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (9 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 10/30] staging/vme/tsi148: remove unreachable line Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 11:23   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 12/30] staging/vme/ca91cx42: " Emilio G. Cota
                   ` (19 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.c |   38 +++++++++++++++---------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index c08927e..3ef5f48 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -392,7 +392,7 @@ static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge, struct pci_dev *pd
 /*
  * Check to see if an IACk has been received, return true (1) or false (0).
  */
-int tsi148_iack_received(struct tsi148_driver *bridge)
+static int tsi148_iack_received(struct tsi148_driver *bridge)
 {
 	u32 tmp;
 
@@ -407,7 +407,7 @@ int tsi148_iack_received(struct tsi148_driver *bridge)
 /*
  * Configure VME interrupt
  */
-void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
+static void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
 	int state, int sync)
 {
 	struct pci_dev *pdev;
@@ -447,7 +447,7 @@ void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
  * Generate a VME bus interrupt at the requested level & vector. Wait for
  * interrupt to be acked.
  */
-int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
+static int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
 {
 	u32 tmp;
 	struct tsi148_driver *bridge;
@@ -547,7 +547,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
 /*
  * Initialize a slave window with the requested attributes.
  */
-int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
+static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
 {
@@ -697,7 +697,7 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 /*
  * Get slave window configuration.
  */
-int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
+static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
@@ -893,7 +893,7 @@ static void tsi148_free_resource(struct vme_master_resource *image)
 /*
  * Set the attributes of an outbound window.
  */
-int tsi148_master_set(struct vme_master_resource *image, int enabled,
+static int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
 {
@@ -1129,7 +1129,7 @@ err_window:
  *
  * XXX Not parsing prefetch information.
  */
-int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
+static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -1239,7 +1239,7 @@ int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 }
 
 
-int tsi148_master_get(struct vme_master_resource *image, int *enabled,
+static int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -1255,7 +1255,7 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	return retval;
 }
 
-ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
+static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	int retval, enabled;
@@ -1297,7 +1297,7 @@ skip_chk:
 }
 
 
-ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
+static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	int retval = 0, enabled;
@@ -1364,7 +1364,7 @@ skip_chk:
  *
  * Requires a previously configured master window, returns final value.
  */
-unsigned int tsi148_master_rmw(struct vme_master_resource *image,
+static unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	unsigned int mask, unsigned int compare, unsigned int swap,
 	loff_t offset)
 {
@@ -1611,7 +1611,7 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, u32 *attr,
 /*
  * Add a link list descriptor to the list
  */
-int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
+static int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	struct vme_dma_attr *dest, size_t count)
 {
 	struct tsi148_dma_entry *entry, *prev;
@@ -1784,7 +1784,7 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
  *
  * XXX Need to provide control register configuration.
  */
-int tsi148_dma_list_exec(struct vme_dma_list *list)
+static int tsi148_dma_list_exec(struct vme_dma_list *list)
 {
 	struct vme_dma_resource *ctrlr;
 	int channel, retval = 0;
@@ -1864,7 +1864,7 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
  *
  * We have a separate function, don't assume that the chain can't be reused.
  */
-int tsi148_dma_list_empty(struct vme_dma_list *list)
+static int tsi148_dma_list_empty(struct vme_dma_list *list)
 {
 	struct list_head *pos, *temp;
 	struct tsi148_dma_entry *entry;
@@ -1886,7 +1886,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
  * This does not enable the LM monitor - that should be done when the first
  * callback is attached and disabled when the last callback is removed.
  */
-int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
+static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	vme_address_t aspace, vme_cycle_t cycle)
 {
 	u32 lm_base_high, lm_base_low, lm_ctl = 0;
@@ -1953,7 +1953,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 /* Get configuration of the callback monitor and return whether it is enabled
  * or disabled.
  */
-int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
+static int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	vme_address_t *aspace, vme_cycle_t *cycle)
 {
 	u32 lm_base_high, lm_base_low, lm_ctl, enabled = 0;
@@ -2004,7 +2004,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
  *
  * Callback will be passed the monitor triggered.
  */
-int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
+static int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 	void (*callback)(int))
 {
 	u32 lm_ctl, tmp;
@@ -2059,7 +2059,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 /*
  * Detach a callback function forn a specific location monitor.
  */
-int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
+static int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 {
 	u32 lm_en, tmp;
 	struct tsi148_driver *bridge;
@@ -2099,7 +2099,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 /*
  * Determine Geographical Addressing
  */
-int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
+static int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
 {
 	u32 slot = 0;
 	struct tsi148_driver *bridge;
-- 
1.7.1


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

* [PATCH 12/30] staging/vme/ca91cx42: declare static functions as such
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (10 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 11/30] staging/vme/tsi148: declare static functions as such Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 11:24   ` Martyn Welch
  2010-10-26  1:10 ` [PATCH 13/30] staging/vme_user: declare private variables as static Emilio G. Cota
                   ` (18 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |   38 ++++++++++++++--------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 14e10a6..6dd895f 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -259,7 +259,7 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
 /*
  * Set up an VME interrupt
  */
-void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
+static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
 	int sync)
 
 {
@@ -287,7 +287,7 @@ void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
 	}
 }
 
-int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
+static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	int statid)
 {
 	u32 tmp;
@@ -323,7 +323,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	return 0;
 }
 
-int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
+static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
 {
@@ -429,7 +429,7 @@ int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
 	return 0;
 }
 
-int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
+static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
@@ -584,7 +584,7 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
 }
 
 
-int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
+static int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
 {
@@ -741,7 +741,7 @@ err_window:
 	return retval;
 }
 
-int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
+static int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -828,7 +828,7 @@ int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	return 0;
 }
 
-int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
+static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -844,7 +844,7 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	return retval;
 }
 
-ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
+static ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	ssize_t retval;
@@ -904,7 +904,7 @@ out:
 	return retval;
 }
 
-ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
+static ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	ssize_t retval;
@@ -959,7 +959,7 @@ out:
 	return retval;
 }
 
-unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
+static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	unsigned int mask, unsigned int compare, unsigned int swap,
 	loff_t offset)
 {
@@ -1015,7 +1015,7 @@ out:
 	return result;
 }
 
-int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
+static int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	struct vme_dma_attr *dest, size_t count)
 {
 	struct ca91cx42_dma_entry *entry, *prev;
@@ -1176,7 +1176,7 @@ static int ca91cx42_dma_busy(struct vme_bridge *ca91cx42_bridge)
 		return 1;
 }
 
-int ca91cx42_dma_list_exec(struct vme_dma_list *list)
+static int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 {
 	struct vme_dma_resource *ctrlr;
 	struct ca91cx42_dma_entry *entry;
@@ -1258,7 +1258,7 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 
 }
 
-int ca91cx42_dma_list_empty(struct vme_dma_list *list)
+static int ca91cx42_dma_list_empty(struct vme_dma_list *list)
 {
 	struct list_head *pos, *temp;
 	struct ca91cx42_dma_entry *entry;
@@ -1280,7 +1280,7 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
  * This does not enable the LM monitor - that should be done when the first
  * callback is attached and disabled when the last callback is removed.
  */
-int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
+static int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	vme_address_t aspace, vme_cycle_t cycle)
 {
 	u32 temp_base, lm_ctl = 0;
@@ -1348,7 +1348,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 /* Get configuration of the callback monitor and return whether it is enabled
  * or disabled.
  */
-int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
+static int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	vme_address_t *aspace, vme_cycle_t *cycle)
 {
 	u32 lm_ctl, enabled = 0;
@@ -1391,7 +1391,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
  *
  * Callback will be passed the monitor triggered.
  */
-int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
+static int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 	void (*callback)(int))
 {
 	u32 lm_ctl, tmp;
@@ -1440,7 +1440,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 /*
  * Detach a callback function forn a specific location monitor.
  */
-int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
+static int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 {
 	u32 tmp;
 	struct ca91cx42_driver *bridge;
@@ -1473,7 +1473,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 	return 0;
 }
 
-int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
+static int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
 {
 	u32 slot = 0;
 	struct ca91cx42_driver *bridge;
@@ -1833,7 +1833,7 @@ err_struct:
 
 }
 
-void ca91cx42_remove(struct pci_dev *pdev)
+static void ca91cx42_remove(struct pci_dev *pdev)
 {
 	struct list_head *pos = NULL;
 	struct vme_master_resource *master_image;
-- 
1.7.1


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

* [PATCH 13/30] staging/vme_user: declare private variables as static
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (11 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 12/30] staging/vme/ca91cx42: " Emilio G. Cota
@ 2010-10-26  1:10 ` Emilio G. Cota
  2010-10-27 11:29   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams Emilio G. Cota
                   ` (17 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:10 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index bdc4e1e..31a74e2 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -114,9 +114,9 @@ typedef struct {
 } driver_stats_t;
 static driver_stats_t statistics;
 
-struct cdev *vme_user_cdev;		/* Character device */
-struct class *vme_user_sysfs_class;	/* Sysfs class */
-struct device *vme_user_bridge;		/* Pointer to the bridge device */
+static struct cdev *vme_user_cdev;		/* Character device */
+static struct class *vme_user_sysfs_class;	/* Sysfs class */
+static struct device *vme_user_bridge;		/* Pointer to the bridge device */
 
 
 static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,
-- 
1.7.1


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

* [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (12 preceding siblings ...)
  2010-10-26  1:10 ` [PATCH 13/30] staging/vme_user: declare private variables as static Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 11:29   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates Emilio G. Cota
                   ` (16 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

unsigned int is what struct kparam_array internally uses.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 31a74e2..e7669a4 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -44,7 +44,7 @@ static DEFINE_MUTEX(vme_user_mutex);
 static char driver_name[] = "vme_user";
 
 static int bus[USER_BUS_MAX];
-static int bus_num;
+static unsigned int bus_num;
 
 /* Currently Documentation/devices.txt defines the following for VME:
  *
-- 
1.7.1


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

* [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (13 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:20   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 16/30] staging/vme_user: mark user-space buffers with __user Emilio G. Cota
                   ` (15 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

kern_buf is not iomem; it comes from kmalloc and is directly
dereferenced.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index e7669a4..ead30d2 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -92,7 +92,7 @@ static unsigned int bus_num;
  * Structure to handle image related parameters.
  */
 typedef struct {
-	void __iomem *kern_buf;	/* Buffer address in kernel space */
+	void *kern_buf;	/* Buffer address in kernel space */
 	dma_addr_t pci_buf;	/* Buffer address in PCI address space */
 	unsigned long long size_buf;	/* Buffer size */
 	struct semaphore sem;	/* Semaphore for locking image */
@@ -277,7 +277,7 @@ static ssize_t resource_from_user(unsigned int minor, const char *buf,
 static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 	size_t count, loff_t *ppos)
 {
-	void __iomem *image_ptr;
+	void *image_ptr;
 	ssize_t retval;
 
 	image_ptr = image[minor].kern_buf + *ppos;
@@ -296,7 +296,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 static ssize_t buffer_from_user(unsigned int minor, const char *buf,
 	size_t count, loff_t *ppos)
 {
-	void __iomem *image_ptr;
+	void *image_ptr;
 	size_t retval;
 
 	image_ptr = image[minor].kern_buf + *ppos;
-- 
1.7.1


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

* [PATCH 16/30] staging/vme_user: mark user-space buffers with __user
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (14 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:20   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Emilio G. Cota
                   ` (14 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index ead30d2..a7b97be 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -129,8 +129,8 @@ static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,
 
 static int vme_user_open(struct inode *, struct file *);
 static int vme_user_release(struct inode *, struct file *);
-static ssize_t vme_user_read(struct file *, char *, size_t, loff_t *);
-static ssize_t vme_user_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t vme_user_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t vme_user_write(struct file *, const char __user *, size_t, loff_t *);
 static loff_t vme_user_llseek(struct file *, loff_t, int);
 static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 
@@ -246,7 +246,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count,
  * page) transfers will lock the user space buffer into memory and then
  * transfer the data directly from the user space buffers out to VME.
  */
-static ssize_t resource_from_user(unsigned int minor, const char *buf,
+static ssize_t resource_from_user(unsigned int minor, const char __user *buf,
 	size_t count, loff_t *ppos)
 {
 	ssize_t retval;
@@ -293,7 +293,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 	return retval;
 }
 
-static ssize_t buffer_from_user(unsigned int minor, const char *buf,
+static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
 	size_t count, loff_t *ppos)
 {
 	void *image_ptr;
@@ -312,7 +312,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char *buf,
 	return retval;
 }
 
-static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
+static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
 			loff_t *ppos)
 {
 	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
@@ -356,7 +356,7 @@ static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
 	return retval;
 }
 
-static ssize_t vme_user_write(struct file *file, const char *buf, size_t count,
+static ssize_t vme_user_write(struct file *file, const char __user *buf, size_t count,
 			 loff_t *ppos)
 {
 	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
@@ -455,6 +455,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	unsigned int minor = MINOR(inode->i_rdev);
 	int retval;
 	dma_addr_t pci_addr;
+	void __user *argp = (void __user *)arg;
 
 	statistics.ioctls++;
 
@@ -474,8 +475,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				&master.size, &master.aspace,
 				&master.cycle, &master.dwidth);
 
-			copied = copy_to_user((char *)arg, &master,
-				sizeof(struct vme_master));
+			copied = copy_to_user(argp, &master, sizeof(struct vme_master));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy to "
 					"userspace\n");
@@ -487,8 +487,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 		case VME_SET_MASTER:
 
-			copied = copy_from_user(&master, (char *)arg,
-				sizeof(master));
+			copied = copy_from_user(&master, argp, sizeof(master));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from "
 					"userspace\n");
@@ -518,8 +517,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				&slave.size, &pci_addr, &slave.aspace,
 				&slave.cycle);
 
-			copied = copy_to_user((char *)arg, &slave,
-				sizeof(struct vme_slave));
+			copied = copy_to_user(argp, &slave, sizeof(struct vme_slave));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy to "
 					"userspace\n");
@@ -531,8 +529,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 		case VME_SET_SLAVE:
 
-			copied = copy_from_user(&slave, (char *)arg,
-				sizeof(slave));
+			copied = copy_from_user(&slave, argp, sizeof(slave));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from "
 					"userspace\n");
-- 
1.7.1


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

* [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (15 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 16/30] staging/vme_user: mark user-space buffers with __user Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:20   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 18/30] staging/vme/tsi148: mark the registers' " Emilio G. Cota
                   ` (13 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme_bridge.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/vme_bridge.h b/drivers/staging/vme/vme_bridge.h
index b653ec0..4c6ec31 100644
--- a/drivers/staging/vme/vme_bridge.h
+++ b/drivers/staging/vme/vme_bridge.h
@@ -20,7 +20,7 @@ struct vme_master_resource {
 	vme_cycle_t cycle_attr;
 	vme_width_t width_attr;
 	struct resource bus_resource;
-	void *kern_base;
+	void __iomem *kern_base;
 };
 
 struct vme_slave_resource {
-- 
1.7.1


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

* [PATCH 18/30] staging/vme/tsi148: mark the registers' base address pointer as __iomem
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (16 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:20   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 19/30] staging/vme/ca91cx42: " Emilio G. Cota
                   ` (12 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_tsi148.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_tsi148.h b/drivers/staging/vme/bridges/vme_tsi148.h
index bda64ef..9f97fa8 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.h
+++ b/drivers/staging/vme/bridges/vme_tsi148.h
@@ -35,7 +35,7 @@
 
 /* Structure used to hold driver specific information */
 struct tsi148_driver {
-	void *base;	/* Base Address of device registers */
+	void __iomem *base;	/* Base Address of device registers */
 	wait_queue_head_t dma_queue[2];
 	wait_queue_head_t iack_queue;
 	void (*lm_callback[4])(int);	/* Called in interrupt handler */
-- 
1.7.1


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

* [PATCH 19/30] staging/vme/ca91cx42: mark the registers' base address pointer as __iomem
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (17 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 18/30] staging/vme/tsi148: mark the registers' " Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:20   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 20/30] staging/vme: trivial: rename vme_bus_num_mtx to vme_buses_lock Emilio G. Cota
                   ` (11 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.h b/drivers/staging/vme/bridges/vme_ca91cx42.h
index e72c65b..02a7c79 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.h
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.h
@@ -39,7 +39,7 @@
 
 /* Structure used to hold driver specific information */
 struct ca91cx42_driver {
-	void *base;	/* Base Address of device registers */
+	void __iomem *base;	/* Base Address of device registers */
 	wait_queue_head_t dma_queue;
 	wait_queue_head_t iack_queue;
 	wait_queue_head_t mbox_queue;
-- 
1.7.1


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

* [PATCH 20/30] staging/vme: trivial: rename vme_bus_num_mtx to vme_buses_lock
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (18 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 19/30] staging/vme/ca91cx42: " Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 21/30] staging/vme: keep a list of registered buses (bridges) Emilio G. Cota
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

This paves the way for upcoming changes.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 59650dd..357748e 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -36,7 +36,7 @@
 
 /* Bitmask and mutex to keep track of bridge numbers */
 static unsigned int vme_bus_numbers;
-static DEFINE_MUTEX(vme_bus_num_mtx);
+static DEFINE_MUTEX(vme_buses_lock);
 
 static void __exit vme_exit(void);
 static int __init vme_init(void);
@@ -1307,7 +1307,7 @@ EXPORT_SYMBOL(vme_slot_get);
 
 /* - Bridge Registration --------------------------------------------------- */
 
-/* call with vme_bus_num_mtx held */
+/* call with vme_buses_lock held */
 static int __vme_alloc_bus_num(int *bus)
 {
 	int index;
@@ -1339,17 +1339,17 @@ static int vme_alloc_bus_num(int *bus)
 {
 	int ret;
 
-	mutex_lock(&vme_bus_num_mtx);
+	mutex_lock(&vme_buses_lock);
 	ret = __vme_alloc_bus_num(bus);
-	mutex_unlock(&vme_bus_num_mtx);
+	mutex_unlock(&vme_buses_lock);
 	return ret;
 }
 
 static void vme_free_bus_num(int bus)
 {
-	mutex_lock(&vme_bus_num_mtx);
+	mutex_lock(&vme_buses_lock);
 	vme_bus_numbers &= ~(0x1 << bus);
-	mutex_unlock(&vme_bus_num_mtx);
+	mutex_unlock(&vme_buses_lock);
 }
 
 /* Note: device_release(dev) throws a warning if dev->release isn't filled in */
-- 
1.7.1


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

* [PATCH 21/30] staging/vme: keep a list of registered buses (bridges)
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (19 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 20/30] staging/vme: trivial: rename vme_bus_num_mtx to vme_buses_lock Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove Emilio G. Cota
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

This paves the way for upcoming changes.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c        |   25 ++++++++++++++++---------
 drivers/staging/vme/vme_bridge.h |    1 +
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 357748e..10a6435 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -34,8 +34,12 @@
 #include "vme.h"
 #include "vme_bridge.h"
 
-/* Bitmask and mutex to keep track of bridge numbers */
+/*
+ * List of registered buses (bridges) and available bus numbers, both protected
+ * by the same mutex.
+ */
 static unsigned int vme_bus_numbers;
+static LIST_HEAD(vme_buses_list);
 static DEFINE_MUTEX(vme_buses_lock);
 
 static void __exit vme_exit(void);
@@ -1308,8 +1312,9 @@ EXPORT_SYMBOL(vme_slot_get);
 /* - Bridge Registration --------------------------------------------------- */
 
 /* call with vme_buses_lock held */
-static int __vme_alloc_bus_num(int *bus)
+static int __vme_register_bus(struct vme_bridge *bridge)
 {
+	int *bus = &bridge->num;
 	int index;
 
 	if (*bus == -1) {
@@ -1331,24 +1336,26 @@ static int __vme_alloc_bus_num(int *bus)
 			return -EBUSY;
 		}
 	}
+	list_add_tail(&bridge->buses_list, &vme_buses_list);
 	vme_bus_numbers |= 1 << *bus;
 	return 0;
 }
 
-static int vme_alloc_bus_num(int *bus)
+static int vme_register_bus(struct vme_bridge *bridge)
 {
 	int ret;
 
 	mutex_lock(&vme_buses_lock);
-	ret = __vme_alloc_bus_num(bus);
+	ret = __vme_register_bus(bridge);
 	mutex_unlock(&vme_buses_lock);
 	return ret;
 }
 
-static void vme_free_bus_num(int bus)
+static void vme_unregister_bus(struct vme_bridge *bridge)
 {
 	mutex_lock(&vme_buses_lock);
-	vme_bus_numbers &= ~(0x1 << bus);
+	vme_bus_numbers &= ~(0x1 << bridge->num);
+	list_del(&bridge->buses_list);
 	mutex_unlock(&vme_buses_lock);
 }
 
@@ -1363,7 +1370,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	int retval;
 	int i;
 
-	retval = vme_alloc_bus_num(&bridge->num);
+	retval = vme_register_bus(bridge);
 	if (retval)
 		return retval;
 
@@ -1399,7 +1406,7 @@ err_reg:
 		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
-	vme_free_bus_num(bridge->num);
+	vme_unregister_bus(bridge);
 	return retval;
 }
 EXPORT_SYMBOL(vme_register_bridge);
@@ -1414,7 +1421,7 @@ void vme_unregister_bridge(struct vme_bridge *bridge)
 		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
-	vme_free_bus_num(bridge->num);
+	vme_unregister_bus(bridge);
 }
 EXPORT_SYMBOL(vme_unregister_bridge);
 
diff --git a/drivers/staging/vme/vme_bridge.h b/drivers/staging/vme/vme_bridge.h
index 4c6ec31..3bb1d7b 100644
--- a/drivers/staging/vme/vme_bridge.h
+++ b/drivers/staging/vme/vme_bridge.h
@@ -113,6 +113,7 @@ struct vme_bridge {
 
 	/* Bridge Info - XXX Move to private structure? */
 	struct device *parent;	/* Generic device struct (pdev->dev for PCI) */
+	struct list_head buses_list;
 	void *driver_priv;	/* Private pointer for the bridge driver */
 
 	struct device dev[VME_SLOTS_MAX];	/* Device registered with
-- 
1.7.1


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

* [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (20 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 21/30] staging/vme: keep a list of registered buses (bridges) Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-12-03 13:44   ` [PATCH] staging/vme/vme_user: use __dev{init, exit} " Martyn Welch
  2010-10-26  1:11 ` [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed Emilio G. Cota
                   ` (8 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index a7b97be..5def455 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -134,8 +134,8 @@ static ssize_t vme_user_write(struct file *, const char __user *, size_t, loff_t
 static loff_t vme_user_llseek(struct file *, loff_t, int);
 static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 
-static int __init vme_user_probe(struct device *, int, int);
-static int __exit vme_user_remove(struct device *, int, int);
+static int __devinit vme_user_probe(struct device *, int, int);
+static int __devexit vme_user_remove(struct device *, int, int);
 
 static struct file_operations vme_user_fops = {
 	.open = vme_user_open,
@@ -593,7 +593,7 @@ static void buf_unalloc(int num)
 static struct vme_driver vme_user_driver = {
 	.name = driver_name,
 	.probe = vme_user_probe,
-	.remove = vme_user_remove,
+	.remove = __devexit_p(vme_user_remove),
 };
 
 
@@ -663,7 +663,7 @@ err_nocard:
  * as practical. We will therefore reserve the buffers and request the images
  * here so that we don't have to do it later.
  */
-static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
+static int __devinit vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
 {
 	int i, err;
 	char name[12];
@@ -838,7 +838,7 @@ err_dev:
 	return err;
 }
 
-static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
+static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
 {
 	int i;
 
-- 
1.7.1


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

* [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (21 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-12-03  9:05   ` [PATCH] " Martyn Welch
  2010-10-26  1:11 ` [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set Emilio G. Cota
                   ` (7 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

buf_unalloc() frees the memory buffers allocated with vme_alloc_consistent.
The associated VME resource is needed in both vme_alloc_consistent and
vme_free_consistent; however the slave VME resources are being freed before
the calls to vme_free_consistent are made, which means the buffers
are never returned.

Fix this by freeing the VME resources only after the consistent buffers have
been returned.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 5def455..95c22ff 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -826,8 +826,8 @@ err_master:
 err_slave:
 	while (i > SLAVE_MINOR) {
 		i--;
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 err_class:
 	cdev_del(vme_user_cdev);
@@ -852,8 +852,8 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
 		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 
 	/* Unregister device driver */
-- 
1.7.1


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

* [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (22 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-27 12:24   ` Martyn Welch
  2010-10-26  1:11 ` [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove Emilio G. Cota
                   ` (6 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

The resource is about to be freed and therefore it is pointless to
set any of its parameters.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 95c22ff..a1cb85b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -851,7 +851,6 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
 		kfree(image[i].kern_buf);
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
-		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
 		buf_unalloc(i);
 		vme_slave_free(image[i].resource);
 	}
-- 
1.7.1


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

* [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (23 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-12-03 14:20   ` [PATCH] " Martyn Welch
  2010-10-26  1:11 ` [PATCH 26/30] staging/vme: move all contents of vme_bridge.h to vme.h Emilio G. Cota
                   ` (5 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/devices/vme_user.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index a1cb85b..75f6472 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -847,8 +847,10 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
 		device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i));
 	class_destroy(vme_user_sysfs_class);
 
-	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++)
+	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) {
 		kfree(image[i].kern_buf);
+		vme_master_free(image[i].resource);
+	}
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
 		buf_unalloc(i);
-- 
1.7.1


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

* [PATCH 26/30] staging/vme: move all contents of vme_bridge.h to vme.h
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (24 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 27/30] staging/vme: rework the bus model Emilio G. Cota
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Upcoming changes will need to have struct vme_bridge exposed
to VME drivers; do it now.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |    1 -
 drivers/staging/vme/bridges/vme_tsi148.c   |    1 -
 drivers/staging/vme/vme.c                  |    1 -
 drivers/staging/vme/vme.h                  |  173 +++++++++++++++++++++++++++
 drivers/staging/vme/vme_bridge.h           |  176 ----------------------------
 5 files changed, 173 insertions(+), 179 deletions(-)
 delete mode 100644 drivers/staging/vme/vme_bridge.h

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 6dd895f..b91c130 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -31,7 +31,6 @@
 #include <linux/uaccess.h>
 
 #include "../vme.h"
-#include "../vme_bridge.h"
 #include "vme_ca91cx42.h"
 
 static int __init ca91cx42_init(void);
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 3ef5f48..80a9829 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -31,7 +31,6 @@
 #include <linux/uaccess.h>
 
 #include "../vme.h"
-#include "../vme_bridge.h"
 #include "vme_tsi148.h"
 
 static int __init tsi148_init(void);
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 10a6435..96eb98e 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -32,7 +32,6 @@
 #include <linux/slab.h>
 
 #include "vme.h"
-#include "vme_bridge.h"
 
 /*
  * List of registered buses (bridges) and available bus numbers, both protected
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index 5cdfa52..1c9ab64 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -107,6 +107,174 @@ struct vme_driver {
 	struct device_driver    driver;
 };
 
+#define VME_CRCSR_BUF_SIZE (508*1024)
+#define VME_SLOTS_MAX 32
+/*
+ * Resource structures
+ */
+struct vme_master_resource {
+	struct list_head list;
+	struct vme_bridge *parent;
+	/*
+	 * We are likely to need to access the VME bus in interrupt context, so
+	 * protect master routines with a spinlock rather than a mutex.
+	 */
+	spinlock_t lock;
+	int locked;
+	int number;
+	vme_address_t address_attr;
+	vme_cycle_t cycle_attr;
+	vme_width_t width_attr;
+	struct resource bus_resource;
+	void __iomem *kern_base;
+};
+
+struct vme_slave_resource {
+	struct list_head list;
+	struct vme_bridge *parent;
+	struct mutex mtx;
+	int locked;
+	int number;
+	vme_address_t address_attr;
+	vme_cycle_t cycle_attr;
+};
+
+struct vme_dma_pattern {
+	u32 pattern;
+	vme_pattern_t type;
+};
+
+struct vme_dma_pci {
+	dma_addr_t address;
+};
+
+struct vme_dma_vme {
+	unsigned long long address;
+	vme_address_t aspace;
+	vme_cycle_t cycle;
+	vme_width_t dwidth;
+};
+
+struct vme_dma_list {
+	struct list_head list;
+	struct vme_dma_resource *parent;
+	struct list_head entries;
+	struct mutex mtx;
+};
+
+struct vme_dma_resource {
+	struct list_head list;
+	struct vme_bridge *parent;
+	struct mutex mtx;
+	int locked;
+	int number;
+	struct list_head pending;
+	struct list_head running;
+	vme_dma_route_t route_attr;
+};
+
+struct vme_lm_resource {
+	struct list_head list;
+	struct vme_bridge *parent;
+	struct mutex mtx;
+	int locked;
+	int number;
+	int monitors;
+};
+
+struct vme_bus_error {
+	struct list_head list;
+	unsigned long long address;
+	u32 attributes;
+};
+
+struct vme_callback {
+	void (*func)(int, int, void*);
+	void *priv_data;
+};
+
+struct vme_irq {
+	int count;
+	struct vme_callback callback[255];
+};
+
+/* Allow 16 characters for name (including null character) */
+#define VMENAMSIZ 16
+
+/* This structure stores all the information about one bridge
+ * The structure should be dynamically allocated by the driver and one instance
+ * of the structure should be present for each VME chip present in the system.
+ *
+ * Currently we assume that all chips are PCI-based
+ */
+struct vme_bridge {
+	char name[VMENAMSIZ];
+	int num;
+	struct list_head master_resources;
+	struct list_head slave_resources;
+	struct list_head dma_resources;
+	struct list_head lm_resources;
+
+	struct list_head vme_errors;	/* List for errors generated on VME */
+
+	/* Bridge Info - XXX Move to private structure? */
+	struct device *parent;	/* Generic device struct (pdev->dev for PCI) */
+	struct list_head buses_list;
+	void *driver_priv;	/* Private pointer for the bridge driver */
+
+	struct device dev[VME_SLOTS_MAX];	/* Device registered with
+						 * device model on VME bus
+						 */
+
+	/* Interrupt callbacks */
+	struct vme_irq irq[7];
+	/* Locking for VME irq callback configuration */
+	struct mutex irq_mtx;
+
+	/* Slave Functions */
+	int (*slave_get) (struct vme_slave_resource *, int *,
+		unsigned long long *, unsigned long long *, dma_addr_t *,
+		vme_address_t *, vme_cycle_t *);
+	int (*slave_set) (struct vme_slave_resource *, int, unsigned long long,
+		unsigned long long, dma_addr_t, vme_address_t, vme_cycle_t);
+
+	/* Master Functions */
+	int (*master_get) (struct vme_master_resource *, int *,
+		unsigned long long *, unsigned long long *, vme_address_t *,
+		vme_cycle_t *, vme_width_t *);
+	int (*master_set) (struct vme_master_resource *, int,
+		unsigned long long, unsigned long long,  vme_address_t,
+		vme_cycle_t, vme_width_t);
+	ssize_t (*master_read) (struct vme_master_resource *, void *, size_t,
+		loff_t);
+	ssize_t (*master_write) (struct vme_master_resource *, void *, size_t,
+		loff_t);
+	unsigned int (*master_rmw) (struct vme_master_resource *, unsigned int,
+		unsigned int, unsigned int, loff_t);
+
+	/* DMA Functions */
+	int (*dma_list_add) (struct vme_dma_list *, struct vme_dma_attr *,
+		struct vme_dma_attr *, size_t);
+	int (*dma_list_exec) (struct vme_dma_list *);
+	int (*dma_list_empty) (struct vme_dma_list *);
+
+	/* Interrupt Functions */
+	void (*irq_set) (struct vme_bridge *, int, int, int);
+	int (*irq_generate) (struct vme_bridge *, int, int);
+
+	/* Location monitor functions */
+	int (*lm_set) (struct vme_lm_resource *, unsigned long long,
+		vme_address_t, vme_cycle_t);
+	int (*lm_get) (struct vme_lm_resource *, unsigned long long *,
+		vme_address_t *, vme_cycle_t *);
+	int (*lm_attach) (struct vme_lm_resource *, int, void (*callback)(int));
+	int (*lm_detach) (struct vme_lm_resource *, int);
+
+	/* CR/CSR space functions */
+	int (*slot_get) (struct vme_bridge *);
+};
+
+/* functions for VME drivers */
 void *vme_alloc_consistent(struct vme_resource *, size_t, dma_addr_t *);
 void vme_free_consistent(struct vme_resource *, size_t,  void *,
 	dma_addr_t);
@@ -166,6 +334,11 @@ int vme_slot_get(struct device *);
 int vme_register_driver(struct vme_driver *);
 void vme_unregister_driver(struct vme_driver *);
 
+/* functions for VME bridges */
+void vme_irq_handler(struct vme_bridge *, int, int);
+int vme_register_bridge(struct vme_bridge *);
+void vme_unregister_bridge(struct vme_bridge *);
+
 
 #endif /* _VME_H_ */
 
diff --git a/drivers/staging/vme/vme_bridge.h b/drivers/staging/vme/vme_bridge.h
deleted file mode 100644
index 3bb1d7b..0000000
--- a/drivers/staging/vme/vme_bridge.h
+++ /dev/null
@@ -1,176 +0,0 @@
-#ifndef _VME_BRIDGE_H_
-#define _VME_BRIDGE_H_
-
-#define VME_CRCSR_BUF_SIZE (508*1024)
-#define VME_SLOTS_MAX 32
-/*
- * Resource structures
- */
-struct vme_master_resource {
-	struct list_head list;
-	struct vme_bridge *parent;
-	/*
-	 * We are likely to need to access the VME bus in interrupt context, so
-	 * protect master routines with a spinlock rather than a mutex.
-	 */
-	spinlock_t lock;
-	int locked;
-	int number;
-	vme_address_t address_attr;
-	vme_cycle_t cycle_attr;
-	vme_width_t width_attr;
-	struct resource bus_resource;
-	void __iomem *kern_base;
-};
-
-struct vme_slave_resource {
-	struct list_head list;
-	struct vme_bridge *parent;
-	struct mutex mtx;
-	int locked;
-	int number;
-	vme_address_t address_attr;
-	vme_cycle_t cycle_attr;
-};
-
-struct vme_dma_pattern {
-	u32 pattern;
-	vme_pattern_t type;
-};
-
-struct vme_dma_pci {
-	dma_addr_t address;
-};
-
-struct vme_dma_vme {
-	unsigned long long address;
-	vme_address_t aspace;
-	vme_cycle_t cycle;
-	vme_width_t dwidth;
-};
-
-struct vme_dma_list {
-	struct list_head list;
-	struct vme_dma_resource *parent;
-	struct list_head entries;
-	struct mutex mtx;
-};
-
-struct vme_dma_resource {
-	struct list_head list;
-	struct vme_bridge *parent;
-	struct mutex mtx;
-	int locked;
-	int number;
-	struct list_head pending;
-	struct list_head running;
-	vme_dma_route_t route_attr;
-};
-
-struct vme_lm_resource {
-	struct list_head list;
-	struct vme_bridge *parent;
-	struct mutex mtx;
-	int locked;
-	int number;
-	int monitors;
-};
-
-struct vme_bus_error {
-	struct list_head list;
-	unsigned long long address;
-	u32 attributes;
-};
-
-struct vme_callback {
-	void (*func)(int, int, void*);
-	void *priv_data;
-};
-
-struct vme_irq {
-	int count;
-	struct vme_callback callback[255];
-};
-
-/* Allow 16 characters for name (including null character) */
-#define VMENAMSIZ 16
-
-/* This structure stores all the information about one bridge
- * The structure should be dynamically allocated by the driver and one instance
- * of the structure should be present for each VME chip present in the system.
- *
- * Currently we assume that all chips are PCI-based
- */
-struct vme_bridge {
-	char name[VMENAMSIZ];
-	int num;
-	struct list_head master_resources;
-	struct list_head slave_resources;
-	struct list_head dma_resources;
-	struct list_head lm_resources;
-
-	struct list_head vme_errors;	/* List for errors generated on VME */
-
-	/* Bridge Info - XXX Move to private structure? */
-	struct device *parent;	/* Generic device struct (pdev->dev for PCI) */
-	struct list_head buses_list;
-	void *driver_priv;	/* Private pointer for the bridge driver */
-
-	struct device dev[VME_SLOTS_MAX];	/* Device registered with
-						 * device model on VME bus
-						 */
-
-	/* Interrupt callbacks */
-	struct vme_irq irq[7];
-	/* Locking for VME irq callback configuration */
-	struct mutex irq_mtx;
-
-	/* Slave Functions */
-	int (*slave_get) (struct vme_slave_resource *, int *,
-		unsigned long long *, unsigned long long *, dma_addr_t *,
-		vme_address_t *, vme_cycle_t *);
-	int (*slave_set) (struct vme_slave_resource *, int, unsigned long long,
-		unsigned long long, dma_addr_t, vme_address_t, vme_cycle_t);
-
-	/* Master Functions */
-	int (*master_get) (struct vme_master_resource *, int *,
-		unsigned long long *, unsigned long long *, vme_address_t *,
-		vme_cycle_t *, vme_width_t *);
-	int (*master_set) (struct vme_master_resource *, int,
-		unsigned long long, unsigned long long,  vme_address_t,
-		vme_cycle_t, vme_width_t);
-	ssize_t (*master_read) (struct vme_master_resource *, void *, size_t,
-		loff_t);
-	ssize_t (*master_write) (struct vme_master_resource *, void *, size_t,
-		loff_t);
-	unsigned int (*master_rmw) (struct vme_master_resource *, unsigned int,
-		unsigned int, unsigned int, loff_t);
-
-	/* DMA Functions */
-	int (*dma_list_add) (struct vme_dma_list *, struct vme_dma_attr *,
-		struct vme_dma_attr *, size_t);
-	int (*dma_list_exec) (struct vme_dma_list *);
-	int (*dma_list_empty) (struct vme_dma_list *);
-
-	/* Interrupt Functions */
-	void (*irq_set) (struct vme_bridge *, int, int, int);
-	int (*irq_generate) (struct vme_bridge *, int, int);
-
-	/* Location monitor functions */
-	int (*lm_set) (struct vme_lm_resource *, unsigned long long,
-		vme_address_t, vme_cycle_t);
-	int (*lm_get) (struct vme_lm_resource *, unsigned long long *,
-		vme_address_t *, vme_cycle_t *);
-	int (*lm_attach) (struct vme_lm_resource *, int, void (*callback)(int));
-	int (*lm_detach) (struct vme_lm_resource *, int);
-
-	/* CR/CSR space functions */
-	int (*slot_get) (struct vme_bridge *);
-};
-
-void vme_irq_handler(struct vme_bridge *, int, int);
-
-int vme_register_bridge(struct vme_bridge *);
-void vme_unregister_bridge(struct vme_bridge *);
-
-#endif /* _VME_BRIDGE_H_ */
-- 
1.7.1


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

* [PATCH 27/30] staging/vme: rework the bus model
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (25 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 26/30] staging/vme: move all contents of vme_bridge.h to vme.h Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-11-04  4:16   ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 28/30] staging/vme: convert vme_* users to vme_*_ng Emilio G. Cota
                   ` (3 subsequent siblings)
  30 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

The way in which VME devices and drivers are currently bound together
involves unnecessary contortions. Controlling a device with a VME driver
requires the following steps, in this order:

- installing the VME core, eg insmod vme.ko
- installing the VME boards' drivers, where the devices to be controlled
  are passed to the VME core through the so-called bind tables.  Note that
  these modules are hooking stuff onto the VME core while the bridge driver
  that provides the bus they'll to attach hasn't yet been loaded.
- insmod of the VME bridge driver. 32 devices (called slots) are _always_
  created, and then the bus's .match method is called for each of them.
  This works because the boards' drivers have already hooked stuff onto
  the VME core (see previous step.)

There are a few things I dislike about the above:

* installing drivers even before the bridges they need are present
  seems counter-intuitive and wrong.
* a VME bus may need more than 32 devices--the relation to the 32 slots on
  a VME crate is artificial and confusing:
	* Some VME cards may be best treated in the kernel as several
	  independent devices, and therefore it is pointless to limit the
	  number of devices on the bus.
	* In VME jargon, a slot is a physical place where hardware is sitting,
	  and is clearly out of the kernel's control. Users may thus have a
	  misleading impression of 'this is what's on slot X', and then go
	  to the crate and see that slot X is empty.
* .probe and .remove pass a pointer to a struct device representing a VME
  bridge, instead of representing the device to be added/removed.
	* a bridge's module may be removed anytime and things do fall over;
	  there is no refcounting at all and thus all drivers attached to
	  the removed bus will oops.
* the so-called "bind table" is tricky, unnecessary and boring code that just
  duplicates what modparam's arrays do.

The appended implements a new driver model for VME that is free of the
shortcomings described above.

In short, a VME driver calls vme_register_driver, which takes the number of
devices to be matched as a parameter, say n. Then the driver's .match method
is called n times for each bus registered on the VME core. That is,
if there are m VME buses registered, m * n devices are created and passed
to .match. Devices that do match are probed, while devices that don't match
are removed. The only difference between this and what happens in most
buses is that here .match is passed down from the bus to the drivers, which
in VME are the only ones that can tell whether or not a particular device is
present.

A VME device is thus uniquely identified by the triplet
(driver_name,bus_id,dev_id), formatted as '$driver_name-$bus_id.$dev_id'.

The VME bus has no auto-discovery capabilities, an illness which the ISA
bus also suffers from. Not surprisingly then, most of the appended code has
been adapted from drivers/base/isa.c, added to the kernel in a5117ba7da. For
further explanations please read that a5117ba7da's commit message. The major
difference here is that several VME buses can coexist whereas in ISA only
a single bus is supported.

To make things easier to digest, this patch just adds functions with _ng
appended, a suffix which will be removed once all callers of the original
functions have been converted to the new ones.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |  391 +++++++++++++++++++++++++++++++++++++--------
 drivers/staging/vme/vme.h |   43 +++++
 2 files changed, 369 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 96eb98e..5ecfecc 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -34,6 +34,20 @@
 #include "vme.h"
 
 /*
+ * A VME device is uniquely identified by a device id, a bus id and a driver
+ * controlling it.
+ * Devices of VME drivers are kept internally in a singly-linked list as
+ * described in the struct below.
+ */
+struct vme_dev {
+	struct device dev;
+	struct device *next;
+	unsigned int bus_id;
+	unsigned int id;
+};
+#define to_vme_dev(x) container_of((x), struct vme_dev, dev)
+
+/*
  * List of registered buses (bridges) and available bus numbers, both protected
  * by the same mutex.
  */
@@ -53,6 +67,48 @@ static struct vme_bridge *dev_to_bridge(struct device *dev)
 	return dev->platform_data;
 }
 
+/**
+ * vme_get_bridge - increments the reference count of a VME bridge
+ * @bus_id:	bus id of the bridge being referenced
+ *
+ * If found, a pointer to the bridge is returned and the reference count
+ * of the module that owns it is incremented.
+ * On success, it can be assumed that the bridge won't be removed until
+ * the corresponding call to vme_put_bridge().
+ * Normally drivers should call vme_get_bridge() in their .probe method,
+ * and vme_put_bridge() when releasing the device, e.g. in .remove.
+ */
+struct vme_bridge *vme_get_bridge(unsigned int bus_id)
+{
+	struct vme_bridge *bridge;
+	struct vme_bridge *retp = NULL;
+
+	mutex_lock(&vme_buses_lock);
+	list_for_each_entry(bridge, &vme_buses_list, buses_list) {
+		if (bridge->num == bus_id) {
+			if (try_module_get(bridge->owner))
+				retp = bridge;
+			break;
+		}
+	}
+	mutex_unlock(&vme_buses_lock);
+	return retp;
+}
+EXPORT_SYMBOL(vme_get_bridge);
+
+/**
+ * vme_put_bridge - decrease the reference count of a bridge
+ * @bridge:	bridge being referenced
+ *
+ * This function decrements the reference count of the module that controls
+ * the bridge. It must come after a call to vme_get_bridge().
+ */
+void vme_put_bridge(struct vme_bridge *bridge)
+{
+	module_put(bridge->owner);
+}
+EXPORT_SYMBOL(vme_put_bridge);
+
 /*
  * Find the bridge that the resource is associated with.
  */
@@ -232,21 +288,14 @@ static int vme_check_window(vme_address_t aspace, unsigned long long vme_base,
  * Request a slave image with specific attributes, return some unique
  * identifier.
  */
-struct vme_resource *vme_slave_request(struct device *dev,
-	vme_address_t address, vme_cycle_t cycle)
+struct vme_resource
+*vme_slave_request_ng(struct vme_bridge *bridge, vme_address_t address, vme_cycle_t cycle)
 {
-	struct vme_bridge *bridge;
 	struct list_head *slave_pos = NULL;
 	struct vme_slave_resource *allocated_image = NULL;
 	struct vme_slave_resource *slave_image = NULL;
 	struct vme_resource *resource = NULL;
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		goto err_bus;
-	}
-
 	/* Loop through slave resources */
 	list_for_each(slave_pos, &bridge->slave_resources) {
 		slave_image = list_entry(slave_pos,
@@ -291,7 +340,17 @@ err_alloc:
 	slave_image->locked = 0;
 	mutex_unlock(&slave_image->mtx);
 err_image:
-err_bus:
+	return NULL;
+}
+EXPORT_SYMBOL(vme_slave_request_ng);
+
+struct vme_resource
+*vme_slave_request(struct device *dev, vme_address_t address, vme_cycle_t cycle)
+{
+	struct vme_bridge *bridge = dev_to_bridge(dev);
+
+	if (bridge)
+		return vme_slave_request_ng(bridge, address, cycle);
 	return NULL;
 }
 EXPORT_SYMBOL(vme_slave_request);
@@ -388,21 +447,15 @@ EXPORT_SYMBOL(vme_slave_free);
  * Request a master image with specific attributes, return some unique
  * identifier.
  */
-struct vme_resource *vme_master_request(struct device *dev,
-	vme_address_t address, vme_cycle_t cycle, vme_width_t dwidth)
+struct vme_resource
+*vme_master_request_ng(struct vme_bridge *bridge, vme_address_t address,
+		      vme_cycle_t cycle, vme_width_t dwidth)
 {
-	struct vme_bridge *bridge;
 	struct list_head *master_pos = NULL;
 	struct vme_master_resource *allocated_image = NULL;
 	struct vme_master_resource *master_image = NULL;
 	struct vme_resource *resource = NULL;
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		goto err_bus;
-	}
-
 	/* Loop through master resources */
 	list_for_each(master_pos, &bridge->master_resources) {
 		master_image = list_entry(master_pos,
@@ -451,7 +504,18 @@ err_alloc:
 	master_image->locked = 0;
 	spin_unlock(&master_image->lock);
 err_image:
-err_bus:
+	return NULL;
+}
+EXPORT_SYMBOL(vme_master_request_ng);
+
+struct vme_resource
+*vme_master_request(struct device *dev, vme_address_t address,
+		    vme_cycle_t cycle, vme_width_t dwidth)
+{
+	struct vme_bridge *bridge = dev_to_bridge(dev);
+
+	if (bridge)
+		return vme_master_request_ng(bridge, address, cycle, dwidth);
 	return NULL;
 }
 EXPORT_SYMBOL(vme_master_request);
@@ -647,9 +711,9 @@ EXPORT_SYMBOL(vme_master_free);
  * Request a DMA controller with specific attributes, return some unique
  * identifier.
  */
-struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
+struct vme_resource
+*vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route)
 {
-	struct vme_bridge *bridge;
 	struct list_head *dma_pos = NULL;
 	struct vme_dma_resource *allocated_ctrlr = NULL;
 	struct vme_dma_resource *dma_ctrlr = NULL;
@@ -658,12 +722,6 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 	/* XXX Not checking resource attributes */
 	printk(KERN_ERR "No VME resource Attribute tests done\n");
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		goto err_bus;
-	}
-
 	/* Loop through DMA resources */
 	list_for_each(dma_pos, &bridge->dma_resources) {
 		dma_ctrlr = list_entry(dma_pos,
@@ -707,7 +765,16 @@ err_alloc:
 	dma_ctrlr->locked = 0;
 	mutex_unlock(&dma_ctrlr->mtx);
 err_ctrlr:
-err_bus:
+	return NULL;
+}
+EXPORT_SYMBOL(vme_dma_request_ng);
+
+struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
+{
+	struct vme_bridge *bridge = dev_to_bridge(dev);
+
+	if (bridge)
+		return vme_dma_request_ng(bridge, route);
 	return NULL;
 }
 EXPORT_SYMBOL(vme_dma_request);
@@ -994,18 +1061,9 @@ void vme_irq_handler(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_handler);
 
-int vme_irq_request(struct device *dev, int level, int statid,
-	void (*callback)(int, int, void *),
-	void *priv_data)
+int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
+		       void (*callback)(int, int, void *), void *priv_data)
 {
-	struct vme_bridge *bridge;
-
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		return -EINVAL;
-	}
-
 	if ((level < 1) || (level > 7)) {
 		printk(KERN_ERR "Invalid interrupt level\n");
 		return -EINVAL;
@@ -1035,18 +1093,21 @@ int vme_irq_request(struct device *dev, int level, int statid,
 
 	return 0;
 }
-EXPORT_SYMBOL(vme_irq_request);
+EXPORT_SYMBOL(vme_irq_request_ng);
 
-void vme_irq_free(struct device *dev, int level, int statid)
+int vme_irq_request(struct device *dev, int level, int statid,
+		    void (*callback)(int, int, void *), void *priv_data)
 {
-	struct vme_bridge *bridge;
+	struct vme_bridge *bridge = dev_to_bridge(dev);
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		return;
-	}
+	if (bridge)
+		return vme_irq_request_ng(bridge, level, statid, callback, priv_data);
+	return -EINVAL;
+}
+EXPORT_SYMBOL(vme_irq_request);
 
+void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
+{
 	if ((level < 1) || (level > 7)) {
 		printk(KERN_ERR "Invalid interrupt level\n");
 		return;
@@ -1070,18 +1131,20 @@ void vme_irq_free(struct device *dev, int level, int statid)
 
 	mutex_unlock(&bridge->irq_mtx);
 }
-EXPORT_SYMBOL(vme_irq_free);
+EXPORT_SYMBOL(vme_irq_free_ng);
 
-int vme_irq_generate(struct device *dev, int level, int statid)
+void vme_irq_free(struct device *dev, int level, int statid)
 {
-	struct vme_bridge *bridge;
+	struct vme_bridge *bridge = dev_to_bridge(dev);
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		return -EINVAL;
-	}
+	if (bridge)
+		return vme_irq_free_ng(bridge, level, statid);
+	return;
+}
+EXPORT_SYMBOL(vme_irq_free);
 
+int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
+{
 	if ((level < 1) || (level > 7)) {
 		printk(KERN_WARNING "Invalid interrupt level\n");
 		return -EINVAL;
@@ -1094,25 +1157,28 @@ int vme_irq_generate(struct device *dev, int level, int statid)
 
 	return bridge->irq_generate(bridge, level, statid);
 }
+EXPORT_SYMBOL(vme_irq_generate_ng);
+
+int vme_irq_generate(struct device *dev, int level, int statid)
+{
+	struct vme_bridge *bridge = dev_to_bridge(dev);
+
+	if (bridge)
+		return vme_irq_generate_ng(bridge, level, statid);
+	return -EINVAL;
+}
 EXPORT_SYMBOL(vme_irq_generate);
 
 /*
  * Request the location monitor, return resource or NULL
  */
-struct vme_resource *vme_lm_request(struct device *dev)
+struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge)
 {
-	struct vme_bridge *bridge;
 	struct list_head *lm_pos = NULL;
 	struct vme_lm_resource *allocated_lm = NULL;
 	struct vme_lm_resource *lm = NULL;
 	struct vme_resource *resource = NULL;
 
-	bridge = dev_to_bridge(dev);
-	if (bridge == NULL) {
-		printk(KERN_ERR "Can't find VME bus\n");
-		goto err_bus;
-	}
-
 	/* Loop through DMA resources */
 	list_for_each(lm_pos, &bridge->lm_resources) {
 		lm = list_entry(lm_pos,
@@ -1155,7 +1221,16 @@ err_alloc:
 	lm->locked = 0;
 	mutex_unlock(&lm->mtx);
 err_lm:
-err_bus:
+	return NULL;
+}
+EXPORT_SYMBOL(vme_lm_request_ng);
+
+struct vme_resource *vme_lm_request(struct device *dev)
+{
+	struct vme_bridge *bridge = dev_to_bridge(dev);
+
+	if (bridge)
+		return vme_lm_request_ng(bridge);
 	return NULL;
 }
 EXPORT_SYMBOL(vme_lm_request);
@@ -1424,6 +1499,28 @@ void vme_unregister_bridge(struct vme_bridge *bridge)
 }
 EXPORT_SYMBOL(vme_unregister_bridge);
 
+/**
+ * vme_register_bridge_ng - register a VME bridge in the VME core
+ * @bridge:	VME bridge to register
+ *
+ * Upon calling this function, the bridge must be ready to process requests.
+ */
+int vme_register_bridge_ng(struct vme_bridge *bridge)
+{
+	return vme_register_bus(bridge);
+}
+EXPORT_SYMBOL(vme_register_bridge_ng);
+
+/**
+ * vme_unregister_bridge_nr - unregister a VME bridge from the VME core
+ * @bridge:	VME bridge to unregister
+ */
+void vme_unregister_bridge_ng(struct vme_bridge *bridge)
+{
+	vme_unregister_bus(bridge);
+}
+EXPORT_SYMBOL(vme_unregister_bridge_ng);
+
 
 /* - Driver Registration --------------------------------------------------- */
 
@@ -1442,6 +1539,131 @@ void vme_unregister_driver(struct vme_driver *drv)
 }
 EXPORT_SYMBOL(vme_unregister_driver);
 
+static void vme_dev_release_ng(struct device *dev)
+{
+	kfree(to_vme_dev(dev));
+}
+
+/**
+ * vme_unregister_driver_ng - unregister a driver from the VME core
+ * @vme_driver:	VME driver to unregister
+ *
+ * First, all devices associated to the driver are unregistered; then the
+ * driver is removed from the core.
+ */
+void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver)
+{
+	struct device *dev = vme_driver->devices;
+
+	while (dev) {
+		struct device *next_dev = to_vme_dev(dev)->next;
+
+		device_unregister(dev);
+		dev = next_dev;
+	}
+	driver_unregister(&vme_driver->driver);
+}
+EXPORT_SYMBOL(vme_unregister_driver_ng);
+
+static int
+__vme_register_driver_bus(struct vme_driver_ng *vme_driver, struct vme_bridge *bridge, unsigned int n_devs)
+{
+	unsigned int id;
+	int error;
+
+	for (id = 0; id < n_devs; id++) {
+		struct vme_dev *vme_dev;
+
+		vme_dev = kzalloc(sizeof(*vme_dev), GFP_KERNEL);
+		if (!vme_dev) {
+			error = -ENOMEM;
+			break;
+		}
+		vme_dev->dev.platform_data = vme_driver;
+		vme_dev->dev.release = vme_dev_release_ng;
+		vme_dev->dev.parent = bridge->parent;
+		vme_dev->dev.bus = &vme_bus_type;
+		vme_dev->bus_id = bridge->num;
+		vme_dev->id = id;
+		dev_set_name(&vme_dev->dev, "%s.%u-%u",
+			vme_driver->name, vme_dev->bus_id, vme_dev->id);
+
+		error = device_register(&vme_dev->dev);
+		if (error) {
+			put_device(&vme_dev->dev);
+			break;
+		}
+		/* add the device to the linked list if there's been a match */
+		if (vme_dev->dev.platform_data) {
+			vme_dev->next = vme_driver->devices;
+			vme_driver->devices = &vme_dev->dev;
+		} else {
+			device_unregister(&vme_dev->dev);
+		}
+	}
+	return error;
+}
+
+static int __vme_register_driver(struct vme_driver_ng *vme_driver, unsigned n_devs)
+{
+	struct vme_bridge *bridge;
+	int error;
+
+	/*
+	 * Since __vme_register_driver_bus may acquire vme_buses_lock, we
+	 * release the lock and temporarily increment the refcount of each
+	 * bridge we're iterating over. This way a bridge cannot be removed
+	 * while we're matching/probing devices against it.
+	 */
+	mutex_lock(&vme_buses_lock);
+	list_for_each_entry(bridge, &vme_buses_list, buses_list) {
+		if (!try_module_get(bridge->owner))
+			continue;
+		mutex_unlock(&vme_buses_lock);
+
+		error = __vme_register_driver_bus(vme_driver, bridge, n_devs);
+
+		mutex_lock(&vme_buses_lock);
+		module_put(bridge->owner);
+		if (error)
+			break;
+	}
+	mutex_unlock(&vme_buses_lock);
+	return error;
+}
+
+/**
+ * vme_register_driver_ng - register a VME driver
+ * @vme_driver:	VME driver to register in the VME core
+ * @n_devs:	Number of devices (0 to n-1) to be matched for each bus
+ *
+ * For each bus already registered in the VME core, n_devs VME devices will be
+ * created and associated to this driver. Then the .match method of the
+ * driver will be called n_devs times for each already available VME bus.
+ * If there is a match, .probe is called; otherwise the created device is
+ * removed.
+ */
+int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs)
+{
+	int error;
+
+	vme_driver->driver.name = vme_driver->name;
+	vme_driver->driver.bus	= &vme_bus_type;
+	vme_driver->devices	= NULL;
+	error = driver_register(&vme_driver->driver);
+	if (error)
+		return error;
+
+	error = __vme_register_driver(vme_driver, n_devs);
+
+	if (!error && !vme_driver->devices)
+		error = -ENODEV;
+	if (error)
+		vme_unregister_driver_ng(vme_driver);
+	return error;
+}
+EXPORT_SYMBOL(vme_register_driver_ng);
+
 /* - Bus Registration ------------------------------------------------------ */
 
 static int vme_calc_slot(struct device *dev)
@@ -1549,6 +1771,45 @@ static int vme_bus_remove(struct device *dev)
 	return retval;
 }
 
+static int vme_bus_match_ng(struct device *dev, struct device_driver *drv)
+{
+	struct vme_driver_ng *vme_driver = to_vme_driver_ng(drv);
+
+	if (dev->platform_data == vme_driver) {
+		struct vme_dev *vme_dev = to_vme_dev(dev);
+
+		if (!vme_driver->match ||
+			vme_driver->match(dev, vme_dev->bus_id, vme_dev->id))
+			return 1;
+		dev->platform_data = NULL;
+	}
+	return 0;
+}
+
+static int vme_bus_probe_ng(struct device *dev)
+{
+	struct vme_driver_ng *vme_driver = dev->platform_data;
+
+	if (vme_driver->probe) {
+		struct vme_dev *vme_dev = to_vme_dev(dev);
+
+		return vme_driver->probe(dev, vme_dev->bus_id, vme_dev->id);
+	}
+	return 0;
+}
+
+static int vme_bus_remove_ng(struct device *dev)
+{
+	struct vme_driver_ng *vme_driver = dev->platform_data;
+
+	if (vme_driver->remove) {
+		struct vme_dev *vme_dev = to_vme_dev(dev);
+
+		return vme_driver->remove(dev, vme_dev->bus_id, vme_dev->id);
+	}
+	return 0;
+}
+
 struct bus_type vme_bus_type = {
 	.name = "vme",
 	.match = vme_bus_match,
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index 1c9ab64..a5dd284 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -107,6 +107,28 @@ struct vme_driver {
 	struct device_driver    driver;
 };
 
+/**
+ * struct vme_driver_ng - represent a VME driver
+ * @name: driver name
+ * @match: callback for matching devices
+ * @probe: callback for device binding
+ * @remove: callback for device unbinding
+ * @shutdown: callback for device shutdown
+ * @driver: used to attach this VME driver to the driver core
+ * @devices: pointer to the first device controlled by this driver. From this
+ * first device all others can be retrieved by traversing a list.
+ */
+struct vme_driver_ng {
+	char *name;
+	int (*match)(struct device *, unsigned int, unsigned int);
+	int (*probe)(struct device *, unsigned int, unsigned int);
+	int (*remove)(struct device *, unsigned int, unsigned int);
+	void (*shutdown)(struct device *, unsigned int, unsigned int);
+	struct device_driver driver;
+	struct device *devices;
+};
+#define to_vme_driver_ng(x) container_of((x), struct vme_driver_ng, driver)
+
 #define VME_CRCSR_BUF_SIZE (508*1024)
 #define VME_SLOTS_MAX 32
 /*
@@ -220,6 +242,7 @@ struct vme_bridge {
 	/* Bridge Info - XXX Move to private structure? */
 	struct device *parent;	/* Generic device struct (pdev->dev for PCI) */
 	struct list_head buses_list;
+	struct module *owner;	/* module that owns the bridge */
 	void *driver_priv;	/* Private pointer for the bridge driver */
 
 	struct device dev[VME_SLOTS_MAX];	/* Device registered with
@@ -283,6 +306,9 @@ size_t vme_get_size(struct vme_resource *);
 
 struct vme_resource *vme_slave_request(struct device *, vme_address_t,
 	vme_cycle_t);
+struct vme_resource *vme_slave_request_ng(struct vme_bridge *bridge,
+					  vme_address_t address,
+					  vme_cycle_t cycle);
 int vme_slave_set(struct vme_resource *, int, unsigned long long,
 	unsigned long long, dma_addr_t, vme_address_t, vme_cycle_t);
 int vme_slave_get(struct vme_resource *, int *, unsigned long long *,
@@ -291,6 +317,10 @@ void vme_slave_free(struct vme_resource *);
 
 struct vme_resource *vme_master_request(struct device *, vme_address_t,
 	vme_cycle_t, vme_width_t);
+struct vme_resource *vme_master_request_ng(struct vme_bridge *bridge,
+					   vme_address_t address,
+					   vme_cycle_t cycle,
+					   vme_width_t dwidth);
 int vme_master_set(struct vme_resource *, int, unsigned long long,
 	unsigned long long, vme_address_t, vme_cycle_t, vme_width_t);
 int vme_master_get(struct vme_resource *, int *, unsigned long long *,
@@ -302,6 +332,7 @@ unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int,
 void vme_master_free(struct vme_resource *);
 
 struct vme_resource *vme_dma_request(struct device *, vme_dma_route_t);
+struct vme_resource *vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route);
 struct vme_dma_list *vme_new_dma_list(struct vme_resource *);
 struct vme_dma_attr *vme_dma_pattern_attribute(u32, vme_pattern_t);
 struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t);
@@ -316,10 +347,15 @@ int vme_dma_free(struct vme_resource *);
 
 int vme_irq_request(struct device *, int, int,
 	void (*callback)(int, int, void *), void *);
+int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
+		       void (*callback)(int, int, void *), void *priv_data);
 void vme_irq_free(struct device *, int, int);
+void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid);
 int vme_irq_generate(struct device *, int, int);
+int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid);
 
 struct vme_resource * vme_lm_request(struct device *);
+struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge);
 int vme_lm_count(struct vme_resource *);
 int vme_lm_set(struct vme_resource *, unsigned long long, vme_address_t,
 	vme_cycle_t);
@@ -332,12 +368,19 @@ void vme_lm_free(struct vme_resource *);
 int vme_slot_get(struct device *);
 
 int vme_register_driver(struct vme_driver *);
+int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs);
 void vme_unregister_driver(struct vme_driver *);
+void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver);
+
+struct vme_bridge *vme_get_bridge(unsigned int bus_id);
+void vme_put_bridge(struct vme_bridge *bridge);
 
 /* functions for VME bridges */
 void vme_irq_handler(struct vme_bridge *, int, int);
 int vme_register_bridge(struct vme_bridge *);
+int vme_register_bridge_ng(struct vme_bridge *bridge);
 void vme_unregister_bridge(struct vme_bridge *);
+void vme_unregister_bridge_ng(struct vme_bridge *bridge);
 
 
 #endif /* _VME_H_ */
-- 
1.7.1


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

* [PATCH 28/30] staging/vme: convert vme_* users to vme_*_ng
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (26 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 27/30] staging/vme: rework the bus model Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 29/30] staging/vme: remove unused vme_* functions and related code Emilio G. Cota
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Only vme_user.c is calling the old functions.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |    7 +-
 drivers/staging/vme/bridges/vme_tsi148.c   |    5 +-
 drivers/staging/vme/devices/vme_user.c     |  100 ++++++++++++----------------
 drivers/staging/vme/vme.c                  |    6 +-
 4 files changed, 54 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index b91c130..0f7dd66 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -1599,6 +1599,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	ca91cx42_bridge->driver_priv = ca91cx42_device;
+	ca91cx42_bridge->owner = THIS_MODULE;
 	ca91cx42_bridge->num = -1;
 
 	/* Enable the device */
@@ -1772,7 +1773,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* Need to save ca91cx42_bridge pointer locally in link list for use in
 	 * ca91cx42_remove()
 	 */
-	retval = vme_register_bridge(ca91cx42_bridge);
+	retval = vme_register_bridge_ng(ca91cx42_bridge);
 	if (retval != 0) {
 		dev_err(&pdev->dev, "Chip Registration failed.\n");
 		goto err_reg;
@@ -1782,7 +1783,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	return 0;
 
-	vme_unregister_bridge(ca91cx42_bridge);
+	vme_unregister_bridge_ng(ca91cx42_bridge);
 err_reg:
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 err_lm:
@@ -1866,7 +1867,7 @@ static void ca91cx42_remove(struct pci_dev *pdev)
 	iowrite32(0x00F00000, bridge->base + VSI6_CTL);
 	iowrite32(0x00F00000, bridge->base + VSI7_CTL);
 
-	vme_unregister_bridge(ca91cx42_bridge);
+	vme_unregister_bridge_ng(ca91cx42_bridge);
 
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 80a9829..b12d517 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2248,6 +2248,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	tsi148_bridge->driver_priv = tsi148_device;
+	tsi148_bridge->owner = THIS_MODULE;
 	tsi148_bridge->num = -1;
 
 	/* Enable the device */
@@ -2463,7 +2464,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_crcsr;
 	}
 
-	retval = vme_register_bridge(tsi148_bridge);
+	retval = vme_register_bridge_ng(tsi148_bridge);
 	if (retval != 0) {
 		dev_err(&pdev->dev, "Chip Registration failed.\n");
 		goto err_reg;
@@ -2586,7 +2587,7 @@ static void tsi148_remove(struct pci_dev *pdev)
 
 	tsi148_irq_exit(tsi148_bridge, pdev);
 
-	vme_unregister_bridge(tsi148_bridge);
+	vme_unregister_bridge_ng(tsi148_bridge);
 
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 75f6472..030f5ee 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -116,7 +116,8 @@ static driver_stats_t statistics;
 
 static struct cdev *vme_user_cdev;		/* Character device */
 static struct class *vme_user_sysfs_class;	/* Sysfs class */
-static struct device *vme_user_bridge;		/* Pointer to the bridge device */
+static struct vme_bridge *bridges[USER_BUS_MAX];
+static int bus_registered;
 
 
 static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,
@@ -134,8 +135,9 @@ static ssize_t vme_user_write(struct file *, const char __user *, size_t, loff_t
 static loff_t vme_user_llseek(struct file *, loff_t, int);
 static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 
-static int __devinit vme_user_probe(struct device *, int, int);
-static int __devexit vme_user_remove(struct device *, int, int);
+static int __devinit vme_user_match(struct device *, unsigned int, unsigned int);
+static int __devinit vme_user_probe(struct device *, unsigned int, unsigned int);
+static int __devexit vme_user_remove(struct device *, unsigned int, unsigned int);
 
 static struct file_operations vme_user_fops = {
 	.open = vme_user_open,
@@ -146,6 +148,16 @@ static struct file_operations vme_user_fops = {
 	.unlocked_ioctl = vme_user_unlocked_ioctl,
 };
 
+static int get_bus_index(unsigned int bus_id)
+{
+	int i;
+
+	for (i = 0; i < bus_num; i++) {
+		if (bus[i] == bus_id)
+			return i;
+	}
+	return -1;
+}
 
 /*
  * Reset all the statistic counters
@@ -590,8 +602,9 @@ static void buf_unalloc(int num)
 	}
 }
 
-static struct vme_driver vme_user_driver = {
+static struct vme_driver_ng vme_user_driver_ng = {
 	.name = driver_name,
+	.match = vme_user_match,
 	.probe = vme_user_probe,
 	.remove = __devexit_p(vme_user_remove),
 };
@@ -599,17 +612,12 @@ static struct vme_driver vme_user_driver = {
 
 static int __init vme_user_init(void)
 {
-	int retval = 0;
-	int i;
-	struct vme_device_id *ids;
-
 	printk(KERN_INFO "VME User Space Access Driver\n");
 
 	if (bus_num == 0) {
 		printk(KERN_ERR "%s: No cards, skipping registration\n",
 			driver_name);
-		retval = -ENODEV;
-		goto err_nocard;
+		return -ENODEV;
 	}
 
 	/* Let's start by supporting one bus, we can support more than one
@@ -621,41 +629,14 @@ static int __init vme_user_init(void)
 		bus_num = USER_BUS_MAX;
 	}
 
+	return vme_register_driver_ng(&vme_user_driver_ng, 1);
+}
 
-	/* Dynamically create the bind table based on module parameters */
-	ids = kmalloc(sizeof(struct vme_device_id) * (bus_num + 1), GFP_KERNEL);
-	if (ids == NULL) {
-		printk(KERN_ERR "%s: Unable to allocate ID table\n",
-			driver_name);
-		retval = -ENOMEM;
-		goto err_id;
-	}
-
-	memset(ids, 0, (sizeof(struct vme_device_id) * (bus_num + 1)));
-
-	for (i = 0; i < bus_num; i++) {
-		ids[i].bus = bus[i];
-		/*
-		 * We register the driver against the slot occupied by *this*
-		 * card, since it's really a low level way of controlling
-		 * the VME bridge
-		 */
-		ids[i].slot = VME_SLOT_CURRENT;
-	}
-
-	vme_user_driver.bind_table = ids;
-
-	retval = vme_register_driver(&vme_user_driver);
-	if (retval != 0)
-		goto err_reg;
-
-	return retval;
-
-err_reg:
-	kfree(ids);
-err_id:
-err_nocard:
-	return retval;
+/* NOTE: This only supports one device per bus */
+static int __devinit
+vme_user_match(struct device *devp, unsigned int bus_id, unsigned int id)
+{
+	return get_bus_index(bus_id) >= 0 && id == 0 ? 1 : 0;
 }
 
 /*
@@ -663,19 +644,25 @@ err_nocard:
  * as practical. We will therefore reserve the buffers and request the images
  * here so that we don't have to do it later.
  */
-static int __devinit vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
+static int __devinit
+vme_user_probe(struct device *dev, unsigned int bus_id, unsigned int id)
 {
 	int i, err;
 	char name[12];
 
-	/* Save pointer to the bridge device */
-	if (vme_user_bridge != NULL) {
+	if (bus_registered) {
 		printk(KERN_ERR "%s: Driver can only be loaded for 1 device\n",
 			driver_name);
 		err = -EINVAL;
 		goto err_dev;
 	}
-	vme_user_bridge = dev;
+	bus_registered = 1;
+
+	bridges[0] = vme_get_bridge(bus_id);
+	if (bridges[0] == NULL) {
+		err = -ENODEV;
+		goto err_get_bridge;
+	}
 
 	/* Initialise descriptors */
 	for (i = 0; i < VME_DEVS; i++) {
@@ -716,8 +703,7 @@ static int __devinit vme_user_probe(struct device *dev, int cur_bus, int cur_slo
 		 * supporting A16 addressing, so we request A24 supported
 		 * by all windows.
 		 */
-		image[i].resource = vme_slave_request(vme_user_bridge,
-			VME_A24, VME_SCT);
+		image[i].resource = vme_slave_request_ng(bridges[0], VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
 			printk(KERN_WARNING "Unable to allocate slave "
 				"resource\n");
@@ -742,8 +728,7 @@ static int __devinit vme_user_probe(struct device *dev, int cur_bus, int cur_slo
 	 */
 	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) {
 		/* XXX Need to properly request attributes */
-		image[i].resource = vme_master_request(vme_user_bridge,
-			VME_A32, VME_SCT, VME_D32);
+		image[i].resource = vme_master_request_ng(bridges[0], VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
 			printk(KERN_WARNING "Unable to allocate master "
 				"resource\n");
@@ -834,11 +819,14 @@ err_class:
 err_char:
 	unregister_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS);
 err_region:
+	vme_put_bridge(bridges[0]);
+err_get_bridge:
+	bus_registered = 0;
 err_dev:
 	return err;
 }
 
-static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
+static int __devexit vme_user_remove(struct device *dev, unsigned int bus_id, unsigned int id)
 {
 	int i;
 
@@ -863,14 +851,14 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
 	/* Unregiser the major and minor device numbers */
 	unregister_chrdev_region(MKDEV(VME_MAJOR, 0), VME_DEVS);
 
+	vme_put_bridge(bridges[0]);
+
 	return 0;
 }
 
 static void __exit vme_user_exit(void)
 {
-	vme_unregister_driver(&vme_user_driver);
-
-	kfree(vme_user_driver.bind_table);
+	vme_unregister_driver_ng(&vme_user_driver_ng);
 }
 
 
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 5ecfecc..88697aa 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1812,9 +1812,9 @@ static int vme_bus_remove_ng(struct device *dev)
 
 struct bus_type vme_bus_type = {
 	.name = "vme",
-	.match = vme_bus_match,
-	.probe = vme_bus_probe,
-	.remove = vme_bus_remove,
+	.match = vme_bus_match_ng,
+	.probe = vme_bus_probe_ng,
+	.remove = vme_bus_remove_ng,
 };
 EXPORT_SYMBOL(vme_bus_type);
 
-- 
1.7.1


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

* [PATCH 29/30] staging/vme: remove unused vme_* functions and related code
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (27 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 28/30] staging/vme: convert vme_* users to vme_*_ng Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-10-26  1:11 ` [PATCH 30/30] staging/vme: remove _ng suffixes Emilio G. Cota
  2010-11-09 23:12 ` [re-send][-next] staging/vme: various fixes + new driver model for VME Greg KH
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |  260 ---------------------------------------------
 drivers/staging/vme/vme.h |   24 ----
 2 files changed, 0 insertions(+), 284 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 88697aa..c50f764 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -344,17 +344,6 @@ err_image:
 }
 EXPORT_SYMBOL(vme_slave_request_ng);
 
-struct vme_resource
-*vme_slave_request(struct device *dev, vme_address_t address, vme_cycle_t cycle)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_slave_request_ng(bridge, address, cycle);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_slave_request);
-
 int vme_slave_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t buf_base, vme_address_t aspace, vme_cycle_t cycle)
@@ -508,18 +497,6 @@ err_image:
 }
 EXPORT_SYMBOL(vme_master_request_ng);
 
-struct vme_resource
-*vme_master_request(struct device *dev, vme_address_t address,
-		    vme_cycle_t cycle, vme_width_t dwidth)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_master_request_ng(bridge, address, cycle, dwidth);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_master_request);
-
 int vme_master_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
@@ -769,16 +746,6 @@ err_ctrlr:
 }
 EXPORT_SYMBOL(vme_dma_request_ng);
 
-struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_dma_request_ng(bridge, route);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_dma_request);
-
 /*
  * Start new list
  */
@@ -1095,17 +1062,6 @@ int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
 }
 EXPORT_SYMBOL(vme_irq_request_ng);
 
-int vme_irq_request(struct device *dev, int level, int statid,
-		    void (*callback)(int, int, void *), void *priv_data)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_request_ng(bridge, level, statid, callback, priv_data);
-	return -EINVAL;
-}
-EXPORT_SYMBOL(vme_irq_request);
-
 void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
@@ -1133,16 +1089,6 @@ void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_free_ng);
 
-void vme_irq_free(struct device *dev, int level, int statid)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_free_ng(bridge, level, statid);
-	return;
-}
-EXPORT_SYMBOL(vme_irq_free);
-
 int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
@@ -1159,16 +1105,6 @@ int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_generate_ng);
 
-int vme_irq_generate(struct device *dev, int level, int statid)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_irq_generate_ng(bridge, level, statid);
-	return -EINVAL;
-}
-EXPORT_SYMBOL(vme_irq_generate);
-
 /*
  * Request the location monitor, return resource or NULL
  */
@@ -1225,16 +1161,6 @@ err_lm:
 }
 EXPORT_SYMBOL(vme_lm_request_ng);
 
-struct vme_resource *vme_lm_request(struct device *dev)
-{
-	struct vme_bridge *bridge = dev_to_bridge(dev);
-
-	if (bridge)
-		return vme_lm_request_ng(bridge);
-	return NULL;
-}
-EXPORT_SYMBOL(vme_lm_request);
-
 int vme_lm_count(struct vme_resource *resource)
 {
 	struct vme_lm_resource *lm;
@@ -1433,72 +1359,6 @@ static void vme_unregister_bus(struct vme_bridge *bridge)
 	mutex_unlock(&vme_buses_lock);
 }
 
-/* Note: device_release(dev) throws a warning if dev->release isn't filled in */
-static void vme_dev_release(struct device *dev)
-{
-}
-
-int vme_register_bridge(struct vme_bridge *bridge)
-{
-	struct device *dev;
-	int retval;
-	int i;
-
-	retval = vme_register_bus(bridge);
-	if (retval)
-		return retval;
-
-	/* This creates 32 vme "slot" devices. This equates to a slot for each
-	 * ID available in a system conforming to the ANSI/VITA 1-1994
-	 * specification.
-	 */
-	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &bridge->dev[i];
-		memset(dev, 0, sizeof(struct device));
-
-		dev->parent = bridge->parent;
-		dev->bus = &vme_bus_type;
-		dev->release = vme_dev_release;
-		/*
-		 * We save a pointer to the bridge in platform_data so that we
-		 * can get to it later. We keep driver_data for use by the
-		 * driver that binds against the slot
-		 */
-		dev->platform_data = bridge;
-		dev_set_name(dev, "vme-%x.%x", bridge->num, i + 1);
-
-		retval = device_register(dev);
-		if (retval)
-			goto err_reg;
-	}
-
-	return retval;
-
-	i = VME_SLOTS_MAX;
-err_reg:
-	while (i > -1) {
-		dev = &bridge->dev[i];
-		device_unregister(dev);
-	}
-	vme_unregister_bus(bridge);
-	return retval;
-}
-EXPORT_SYMBOL(vme_register_bridge);
-
-void vme_unregister_bridge(struct vme_bridge *bridge)
-{
-	int i;
-	struct device *dev;
-
-
-	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &bridge->dev[i];
-		device_unregister(dev);
-	}
-	vme_unregister_bus(bridge);
-}
-EXPORT_SYMBOL(vme_unregister_bridge);
-
 /**
  * vme_register_bridge_ng - register a VME bridge in the VME core
  * @bridge:	VME bridge to register
@@ -1524,21 +1384,6 @@ EXPORT_SYMBOL(vme_unregister_bridge_ng);
 
 /* - Driver Registration --------------------------------------------------- */
 
-int vme_register_driver(struct vme_driver *drv)
-{
-	drv->driver.name = drv->name;
-	drv->driver.bus = &vme_bus_type;
-
-	return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(vme_register_driver);
-
-void vme_unregister_driver(struct vme_driver *drv)
-{
-	driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(vme_unregister_driver);
-
 static void vme_dev_release_ng(struct device *dev)
 {
 	kfree(to_vme_dev(dev));
@@ -1666,111 +1511,6 @@ EXPORT_SYMBOL(vme_register_driver_ng);
 
 /* - Bus Registration ------------------------------------------------------ */
 
-static int vme_calc_slot(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	int num;
-
-	bridge = dev_to_bridge(dev);
-
-	/* Determine slot number */
-	num = 0;
-	while (num < VME_SLOTS_MAX) {
-		if (&bridge->dev[num] == dev)
-			break;
-
-		num++;
-	}
-	if (num == VME_SLOTS_MAX) {
-		dev_err(dev, "Failed to identify slot\n");
-		num = 0;
-		goto err_dev;
-	}
-	num++;
-
-err_dev:
-	return num;
-}
-
-static struct vme_driver *dev_to_vme_driver(struct device *dev)
-{
-	if (dev->driver == NULL)
-		printk(KERN_ERR "Bugger dev->driver is NULL\n");
-
-	return container_of(dev->driver, struct vme_driver, driver);
-}
-
-static int vme_bus_match(struct device *dev, struct device_driver *drv)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int i, num;
-
-	bridge = dev_to_bridge(dev);
-	driver = container_of(drv, struct vme_driver, driver);
-
-	num = vme_calc_slot(dev);
-	if (!num)
-		goto err_dev;
-
-	if (driver->bind_table == NULL) {
-		dev_err(dev, "Bind table NULL\n");
-		goto err_table;
-	}
-
-	i = 0;
-	while ((driver->bind_table[i].bus != 0) ||
-		(driver->bind_table[i].slot != 0)) {
-
-		if (bridge->num == driver->bind_table[i].bus) {
-			if (num == driver->bind_table[i].slot)
-				return 1;
-
-			if (driver->bind_table[i].slot == VME_SLOT_ALL)
-				return 1;
-
-			if ((driver->bind_table[i].slot == VME_SLOT_CURRENT) &&
-				(num == vme_slot_get(dev)))
-				return 1;
-		}
-		i++;
-	}
-
-err_dev:
-err_table:
-	return 0;
-}
-
-static int vme_bus_probe(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int retval = -ENODEV;
-
-	driver = dev_to_vme_driver(dev);
-	bridge = dev_to_bridge(dev);
-
-	if (driver->probe != NULL)
-		retval = driver->probe(dev, bridge->num, vme_calc_slot(dev));
-
-	return retval;
-}
-
-static int vme_bus_remove(struct device *dev)
-{
-	struct vme_bridge *bridge;
-	struct vme_driver *driver;
-	int retval = -ENODEV;
-
-	driver = dev_to_vme_driver(dev);
-	bridge = dev_to_bridge(dev);
-
-	if (driver->remove != NULL)
-		retval = driver->remove(dev, bridge->num, vme_calc_slot(dev));
-
-	return retval;
-}
-
 static int vme_bus_match_ng(struct device *dev, struct device_driver *drv)
 {
 	struct vme_driver_ng *vme_driver = to_vme_driver_ng(drv);
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index a5dd284..0d9cfb6 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -97,16 +97,6 @@ struct vme_device_id {
 	int slot;
 };
 
-struct vme_driver {
-	struct list_head node;
-	char *name;
-	const struct vme_device_id *bind_table;
-	int (*probe)  (struct device *, int, int);
-	int (*remove) (struct device *, int, int);
-	void (*shutdown) (void);
-	struct device_driver    driver;
-};
-
 /**
  * struct vme_driver_ng - represent a VME driver
  * @name: driver name
@@ -304,8 +294,6 @@ void vme_free_consistent(struct vme_resource *, size_t,  void *,
 
 size_t vme_get_size(struct vme_resource *);
 
-struct vme_resource *vme_slave_request(struct device *, vme_address_t,
-	vme_cycle_t);
 struct vme_resource *vme_slave_request_ng(struct vme_bridge *bridge,
 					  vme_address_t address,
 					  vme_cycle_t cycle);
@@ -315,8 +303,6 @@ int vme_slave_get(struct vme_resource *, int *, unsigned long long *,
 	unsigned long long *, dma_addr_t *, vme_address_t *, vme_cycle_t *);
 void vme_slave_free(struct vme_resource *);
 
-struct vme_resource *vme_master_request(struct device *, vme_address_t,
-	vme_cycle_t, vme_width_t);
 struct vme_resource *vme_master_request_ng(struct vme_bridge *bridge,
 					   vme_address_t address,
 					   vme_cycle_t cycle,
@@ -331,7 +317,6 @@ unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int,
 	unsigned int, loff_t);
 void vme_master_free(struct vme_resource *);
 
-struct vme_resource *vme_dma_request(struct device *, vme_dma_route_t);
 struct vme_resource *vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route);
 struct vme_dma_list *vme_new_dma_list(struct vme_resource *);
 struct vme_dma_attr *vme_dma_pattern_attribute(u32, vme_pattern_t);
@@ -345,16 +330,11 @@ int vme_dma_list_exec(struct vme_dma_list *);
 int vme_dma_list_free(struct vme_dma_list *);
 int vme_dma_free(struct vme_resource *);
 
-int vme_irq_request(struct device *, int, int,
-	void (*callback)(int, int, void *), void *);
 int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
 		       void (*callback)(int, int, void *), void *priv_data);
-void vme_irq_free(struct device *, int, int);
 void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid);
-int vme_irq_generate(struct device *, int, int);
 int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid);
 
-struct vme_resource * vme_lm_request(struct device *);
 struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge);
 int vme_lm_count(struct vme_resource *);
 int vme_lm_set(struct vme_resource *, unsigned long long, vme_address_t,
@@ -367,9 +347,7 @@ void vme_lm_free(struct vme_resource *);
 
 int vme_slot_get(struct device *);
 
-int vme_register_driver(struct vme_driver *);
 int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs);
-void vme_unregister_driver(struct vme_driver *);
 void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver);
 
 struct vme_bridge *vme_get_bridge(unsigned int bus_id);
@@ -377,9 +355,7 @@ void vme_put_bridge(struct vme_bridge *bridge);
 
 /* functions for VME bridges */
 void vme_irq_handler(struct vme_bridge *, int, int);
-int vme_register_bridge(struct vme_bridge *);
 int vme_register_bridge_ng(struct vme_bridge *bridge);
-void vme_unregister_bridge(struct vme_bridge *);
 void vme_unregister_bridge_ng(struct vme_bridge *bridge);
 
 
-- 
1.7.1


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

* [PATCH 30/30] staging/vme: remove _ng suffixes
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (28 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 29/30] staging/vme: remove unused vme_* functions and related code Emilio G. Cota
@ 2010-10-26  1:11 ` Emilio G. Cota
  2010-11-09 23:12 ` [re-send][-next] staging/vme: various fixes + new driver model for VME Greg KH
  30 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-26  1:11 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton,
	Emilio G. Cota

From: Emilio G. Cota <cota@braap.org>

This completes the transition to the new model.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/bridges/vme_ca91cx42.c |    6 +-
 drivers/staging/vme/bridges/vme_tsi148.c   |    4 +-
 drivers/staging/vme/devices/vme_user.c     |   10 ++--
 drivers/staging/vme/vme.c                  |   78 ++++++++++++++--------------
 drivers/staging/vme/vme.h                  |   28 +++++-----
 5 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 0f7dd66..d702bdb 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -1773,7 +1773,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* Need to save ca91cx42_bridge pointer locally in link list for use in
 	 * ca91cx42_remove()
 	 */
-	retval = vme_register_bridge_ng(ca91cx42_bridge);
+	retval = vme_register_bridge(ca91cx42_bridge);
 	if (retval != 0) {
 		dev_err(&pdev->dev, "Chip Registration failed.\n");
 		goto err_reg;
@@ -1783,7 +1783,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	return 0;
 
-	vme_unregister_bridge_ng(ca91cx42_bridge);
+	vme_unregister_bridge(ca91cx42_bridge);
 err_reg:
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 err_lm:
@@ -1867,7 +1867,7 @@ static void ca91cx42_remove(struct pci_dev *pdev)
 	iowrite32(0x00F00000, bridge->base + VSI6_CTL);
 	iowrite32(0x00F00000, bridge->base + VSI7_CTL);
 
-	vme_unregister_bridge_ng(ca91cx42_bridge);
+	vme_unregister_bridge(ca91cx42_bridge);
 
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index b12d517..77bf4ce 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2464,7 +2464,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_crcsr;
 	}
 
-	retval = vme_register_bridge_ng(tsi148_bridge);
+	retval = vme_register_bridge(tsi148_bridge);
 	if (retval != 0) {
 		dev_err(&pdev->dev, "Chip Registration failed.\n");
 		goto err_reg;
@@ -2587,7 +2587,7 @@ static void tsi148_remove(struct pci_dev *pdev)
 
 	tsi148_irq_exit(tsi148_bridge, pdev);
 
-	vme_unregister_bridge_ng(tsi148_bridge);
+	vme_unregister_bridge(tsi148_bridge);
 
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 030f5ee..57c0e00 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -602,7 +602,7 @@ static void buf_unalloc(int num)
 	}
 }
 
-static struct vme_driver_ng vme_user_driver_ng = {
+static struct vme_driver vme_user_driver = {
 	.name = driver_name,
 	.match = vme_user_match,
 	.probe = vme_user_probe,
@@ -629,7 +629,7 @@ static int __init vme_user_init(void)
 		bus_num = USER_BUS_MAX;
 	}
 
-	return vme_register_driver_ng(&vme_user_driver_ng, 1);
+	return vme_register_driver(&vme_user_driver, 1);
 }
 
 /* NOTE: This only supports one device per bus */
@@ -703,7 +703,7 @@ vme_user_probe(struct device *dev, unsigned int bus_id, unsigned int id)
 		 * supporting A16 addressing, so we request A24 supported
 		 * by all windows.
 		 */
-		image[i].resource = vme_slave_request_ng(bridges[0], VME_A24, VME_SCT);
+		image[i].resource = vme_slave_request(bridges[0], VME_A24, VME_SCT);
 		if (image[i].resource == NULL) {
 			printk(KERN_WARNING "Unable to allocate slave "
 				"resource\n");
@@ -728,7 +728,7 @@ vme_user_probe(struct device *dev, unsigned int bus_id, unsigned int id)
 	 */
 	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) {
 		/* XXX Need to properly request attributes */
-		image[i].resource = vme_master_request_ng(bridges[0], VME_A32, VME_SCT, VME_D32);
+		image[i].resource = vme_master_request(bridges[0], VME_A32, VME_SCT, VME_D32);
 		if (image[i].resource == NULL) {
 			printk(KERN_WARNING "Unable to allocate master "
 				"resource\n");
@@ -858,7 +858,7 @@ static int __devexit vme_user_remove(struct device *dev, unsigned int bus_id, un
 
 static void __exit vme_user_exit(void)
 {
-	vme_unregister_driver_ng(&vme_user_driver_ng);
+	vme_unregister_driver(&vme_user_driver);
 }
 
 
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index c50f764..c638e08 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -289,7 +289,7 @@ static int vme_check_window(vme_address_t aspace, unsigned long long vme_base,
  * identifier.
  */
 struct vme_resource
-*vme_slave_request_ng(struct vme_bridge *bridge, vme_address_t address, vme_cycle_t cycle)
+*vme_slave_request(struct vme_bridge *bridge, vme_address_t address, vme_cycle_t cycle)
 {
 	struct list_head *slave_pos = NULL;
 	struct vme_slave_resource *allocated_image = NULL;
@@ -342,7 +342,7 @@ err_alloc:
 err_image:
 	return NULL;
 }
-EXPORT_SYMBOL(vme_slave_request_ng);
+EXPORT_SYMBOL(vme_slave_request);
 
 int vme_slave_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
@@ -437,7 +437,7 @@ EXPORT_SYMBOL(vme_slave_free);
  * identifier.
  */
 struct vme_resource
-*vme_master_request_ng(struct vme_bridge *bridge, vme_address_t address,
+*vme_master_request(struct vme_bridge *bridge, vme_address_t address,
 		      vme_cycle_t cycle, vme_width_t dwidth)
 {
 	struct list_head *master_pos = NULL;
@@ -495,7 +495,7 @@ err_alloc:
 err_image:
 	return NULL;
 }
-EXPORT_SYMBOL(vme_master_request_ng);
+EXPORT_SYMBOL(vme_master_request);
 
 int vme_master_set(struct vme_resource *resource, int enabled,
 	unsigned long long vme_base, unsigned long long size,
@@ -689,7 +689,7 @@ EXPORT_SYMBOL(vme_master_free);
  * identifier.
  */
 struct vme_resource
-*vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route)
+*vme_dma_request(struct vme_bridge *bridge, vme_dma_route_t route)
 {
 	struct list_head *dma_pos = NULL;
 	struct vme_dma_resource *allocated_ctrlr = NULL;
@@ -744,7 +744,7 @@ err_alloc:
 err_ctrlr:
 	return NULL;
 }
-EXPORT_SYMBOL(vme_dma_request_ng);
+EXPORT_SYMBOL(vme_dma_request);
 
 /*
  * Start new list
@@ -1028,7 +1028,7 @@ void vme_irq_handler(struct vme_bridge *bridge, int level, int statid)
 }
 EXPORT_SYMBOL(vme_irq_handler);
 
-int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
+int vme_irq_request(struct vme_bridge *bridge, int level, int statid,
 		       void (*callback)(int, int, void *), void *priv_data)
 {
 	if ((level < 1) || (level > 7)) {
@@ -1060,9 +1060,9 @@ int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
 
 	return 0;
 }
-EXPORT_SYMBOL(vme_irq_request_ng);
+EXPORT_SYMBOL(vme_irq_request);
 
-void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
+void vme_irq_free(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
 		printk(KERN_ERR "Invalid interrupt level\n");
@@ -1087,9 +1087,9 @@ void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid)
 
 	mutex_unlock(&bridge->irq_mtx);
 }
-EXPORT_SYMBOL(vme_irq_free_ng);
+EXPORT_SYMBOL(vme_irq_free);
 
-int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
+int vme_irq_generate(struct vme_bridge *bridge, int level, int statid)
 {
 	if ((level < 1) || (level > 7)) {
 		printk(KERN_WARNING "Invalid interrupt level\n");
@@ -1103,12 +1103,12 @@ int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid)
 
 	return bridge->irq_generate(bridge, level, statid);
 }
-EXPORT_SYMBOL(vme_irq_generate_ng);
+EXPORT_SYMBOL(vme_irq_generate);
 
 /*
  * Request the location monitor, return resource or NULL
  */
-struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge)
+struct vme_resource *vme_lm_request(struct vme_bridge *bridge)
 {
 	struct list_head *lm_pos = NULL;
 	struct vme_lm_resource *allocated_lm = NULL;
@@ -1159,7 +1159,7 @@ err_alloc:
 err_lm:
 	return NULL;
 }
-EXPORT_SYMBOL(vme_lm_request_ng);
+EXPORT_SYMBOL(vme_lm_request);
 
 int vme_lm_count(struct vme_resource *resource)
 {
@@ -1360,43 +1360,43 @@ static void vme_unregister_bus(struct vme_bridge *bridge)
 }
 
 /**
- * vme_register_bridge_ng - register a VME bridge in the VME core
+ * vme_register_bridge - register a VME bridge in the VME core
  * @bridge:	VME bridge to register
  *
  * Upon calling this function, the bridge must be ready to process requests.
  */
-int vme_register_bridge_ng(struct vme_bridge *bridge)
+int vme_register_bridge(struct vme_bridge *bridge)
 {
 	return vme_register_bus(bridge);
 }
-EXPORT_SYMBOL(vme_register_bridge_ng);
+EXPORT_SYMBOL(vme_register_bridge);
 
 /**
  * vme_unregister_bridge_nr - unregister a VME bridge from the VME core
  * @bridge:	VME bridge to unregister
  */
-void vme_unregister_bridge_ng(struct vme_bridge *bridge)
+void vme_unregister_bridge(struct vme_bridge *bridge)
 {
 	vme_unregister_bus(bridge);
 }
-EXPORT_SYMBOL(vme_unregister_bridge_ng);
+EXPORT_SYMBOL(vme_unregister_bridge);
 
 
 /* - Driver Registration --------------------------------------------------- */
 
-static void vme_dev_release_ng(struct device *dev)
+static void vme_dev_release(struct device *dev)
 {
 	kfree(to_vme_dev(dev));
 }
 
 /**
- * vme_unregister_driver_ng - unregister a driver from the VME core
+ * vme_unregister_driver - unregister a driver from the VME core
  * @vme_driver:	VME driver to unregister
  *
  * First, all devices associated to the driver are unregistered; then the
  * driver is removed from the core.
  */
-void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver)
+void vme_unregister_driver(struct vme_driver *vme_driver)
 {
 	struct device *dev = vme_driver->devices;
 
@@ -1408,10 +1408,10 @@ void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver)
 	}
 	driver_unregister(&vme_driver->driver);
 }
-EXPORT_SYMBOL(vme_unregister_driver_ng);
+EXPORT_SYMBOL(vme_unregister_driver);
 
 static int
-__vme_register_driver_bus(struct vme_driver_ng *vme_driver, struct vme_bridge *bridge, unsigned int n_devs)
+__vme_register_driver_bus(struct vme_driver *vme_driver, struct vme_bridge *bridge, unsigned int n_devs)
 {
 	unsigned int id;
 	int error;
@@ -1425,7 +1425,7 @@ __vme_register_driver_bus(struct vme_driver_ng *vme_driver, struct vme_bridge *b
 			break;
 		}
 		vme_dev->dev.platform_data = vme_driver;
-		vme_dev->dev.release = vme_dev_release_ng;
+		vme_dev->dev.release = vme_dev_release;
 		vme_dev->dev.parent = bridge->parent;
 		vme_dev->dev.bus = &vme_bus_type;
 		vme_dev->bus_id = bridge->num;
@@ -1449,7 +1449,7 @@ __vme_register_driver_bus(struct vme_driver_ng *vme_driver, struct vme_bridge *b
 	return error;
 }
 
-static int __vme_register_driver(struct vme_driver_ng *vme_driver, unsigned n_devs)
+static int __vme_register_driver(struct vme_driver *vme_driver, unsigned n_devs)
 {
 	struct vme_bridge *bridge;
 	int error;
@@ -1478,7 +1478,7 @@ static int __vme_register_driver(struct vme_driver_ng *vme_driver, unsigned n_de
 }
 
 /**
- * vme_register_driver_ng - register a VME driver
+ * vme_register_driver - register a VME driver
  * @vme_driver:	VME driver to register in the VME core
  * @n_devs:	Number of devices (0 to n-1) to be matched for each bus
  *
@@ -1488,7 +1488,7 @@ static int __vme_register_driver(struct vme_driver_ng *vme_driver, unsigned n_de
  * If there is a match, .probe is called; otherwise the created device is
  * removed.
  */
-int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs)
+int vme_register_driver(struct vme_driver *vme_driver, unsigned int n_devs)
 {
 	int error;
 
@@ -1504,16 +1504,16 @@ int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs
 	if (!error && !vme_driver->devices)
 		error = -ENODEV;
 	if (error)
-		vme_unregister_driver_ng(vme_driver);
+		vme_unregister_driver(vme_driver);
 	return error;
 }
-EXPORT_SYMBOL(vme_register_driver_ng);
+EXPORT_SYMBOL(vme_register_driver);
 
 /* - Bus Registration ------------------------------------------------------ */
 
-static int vme_bus_match_ng(struct device *dev, struct device_driver *drv)
+static int vme_bus_match(struct device *dev, struct device_driver *drv)
 {
-	struct vme_driver_ng *vme_driver = to_vme_driver_ng(drv);
+	struct vme_driver *vme_driver = to_vme_driver(drv);
 
 	if (dev->platform_data == vme_driver) {
 		struct vme_dev *vme_dev = to_vme_dev(dev);
@@ -1526,9 +1526,9 @@ static int vme_bus_match_ng(struct device *dev, struct device_driver *drv)
 	return 0;
 }
 
-static int vme_bus_probe_ng(struct device *dev)
+static int vme_bus_probe(struct device *dev)
 {
-	struct vme_driver_ng *vme_driver = dev->platform_data;
+	struct vme_driver *vme_driver = dev->platform_data;
 
 	if (vme_driver->probe) {
 		struct vme_dev *vme_dev = to_vme_dev(dev);
@@ -1538,9 +1538,9 @@ static int vme_bus_probe_ng(struct device *dev)
 	return 0;
 }
 
-static int vme_bus_remove_ng(struct device *dev)
+static int vme_bus_remove(struct device *dev)
 {
-	struct vme_driver_ng *vme_driver = dev->platform_data;
+	struct vme_driver *vme_driver = dev->platform_data;
 
 	if (vme_driver->remove) {
 		struct vme_dev *vme_dev = to_vme_dev(dev);
@@ -1552,9 +1552,9 @@ static int vme_bus_remove_ng(struct device *dev)
 
 struct bus_type vme_bus_type = {
 	.name = "vme",
-	.match = vme_bus_match_ng,
-	.probe = vme_bus_probe_ng,
-	.remove = vme_bus_remove_ng,
+	.match = vme_bus_match,
+	.probe = vme_bus_probe,
+	.remove = vme_bus_remove,
 };
 EXPORT_SYMBOL(vme_bus_type);
 
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index 0d9cfb6..5080848 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -98,7 +98,7 @@ struct vme_device_id {
 };
 
 /**
- * struct vme_driver_ng - represent a VME driver
+ * struct vme_driver - represent a VME driver
  * @name: driver name
  * @match: callback for matching devices
  * @probe: callback for device binding
@@ -108,7 +108,7 @@ struct vme_device_id {
  * @devices: pointer to the first device controlled by this driver. From this
  * first device all others can be retrieved by traversing a list.
  */
-struct vme_driver_ng {
+struct vme_driver {
 	char *name;
 	int (*match)(struct device *, unsigned int, unsigned int);
 	int (*probe)(struct device *, unsigned int, unsigned int);
@@ -117,7 +117,7 @@ struct vme_driver_ng {
 	struct device_driver driver;
 	struct device *devices;
 };
-#define to_vme_driver_ng(x) container_of((x), struct vme_driver_ng, driver)
+#define to_vme_driver(x) container_of((x), struct vme_driver, driver)
 
 #define VME_CRCSR_BUF_SIZE (508*1024)
 #define VME_SLOTS_MAX 32
@@ -294,7 +294,7 @@ void vme_free_consistent(struct vme_resource *, size_t,  void *,
 
 size_t vme_get_size(struct vme_resource *);
 
-struct vme_resource *vme_slave_request_ng(struct vme_bridge *bridge,
+struct vme_resource *vme_slave_request(struct vme_bridge *bridge,
 					  vme_address_t address,
 					  vme_cycle_t cycle);
 int vme_slave_set(struct vme_resource *, int, unsigned long long,
@@ -303,7 +303,7 @@ int vme_slave_get(struct vme_resource *, int *, unsigned long long *,
 	unsigned long long *, dma_addr_t *, vme_address_t *, vme_cycle_t *);
 void vme_slave_free(struct vme_resource *);
 
-struct vme_resource *vme_master_request_ng(struct vme_bridge *bridge,
+struct vme_resource *vme_master_request(struct vme_bridge *bridge,
 					   vme_address_t address,
 					   vme_cycle_t cycle,
 					   vme_width_t dwidth);
@@ -317,7 +317,7 @@ unsigned int vme_master_rmw(struct vme_resource *, unsigned int, unsigned int,
 	unsigned int, loff_t);
 void vme_master_free(struct vme_resource *);
 
-struct vme_resource *vme_dma_request_ng(struct vme_bridge *bridge, vme_dma_route_t route);
+struct vme_resource *vme_dma_request(struct vme_bridge *bridge, vme_dma_route_t route);
 struct vme_dma_list *vme_new_dma_list(struct vme_resource *);
 struct vme_dma_attr *vme_dma_pattern_attribute(u32, vme_pattern_t);
 struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t);
@@ -330,12 +330,12 @@ int vme_dma_list_exec(struct vme_dma_list *);
 int vme_dma_list_free(struct vme_dma_list *);
 int vme_dma_free(struct vme_resource *);
 
-int vme_irq_request_ng(struct vme_bridge *bridge, int level, int statid,
+int vme_irq_request(struct vme_bridge *bridge, int level, int statid,
 		       void (*callback)(int, int, void *), void *priv_data);
-void vme_irq_free_ng(struct vme_bridge *bridge, int level, int statid);
-int vme_irq_generate_ng(struct vme_bridge *bridge, int level, int statid);
+void vme_irq_free(struct vme_bridge *bridge, int level, int statid);
+int vme_irq_generate(struct vme_bridge *bridge, int level, int statid);
 
-struct vme_resource *vme_lm_request_ng(struct vme_bridge *bridge);
+struct vme_resource *vme_lm_request(struct vme_bridge *bridge);
 int vme_lm_count(struct vme_resource *);
 int vme_lm_set(struct vme_resource *, unsigned long long, vme_address_t,
 	vme_cycle_t);
@@ -347,16 +347,16 @@ void vme_lm_free(struct vme_resource *);
 
 int vme_slot_get(struct device *);
 
-int vme_register_driver_ng(struct vme_driver_ng *vme_driver, unsigned int n_devs);
-void vme_unregister_driver_ng(struct vme_driver_ng *vme_driver);
+int vme_register_driver(struct vme_driver *vme_driver, unsigned int n_devs);
+void vme_unregister_driver(struct vme_driver *vme_driver);
 
 struct vme_bridge *vme_get_bridge(unsigned int bus_id);
 void vme_put_bridge(struct vme_bridge *bridge);
 
 /* functions for VME bridges */
 void vme_irq_handler(struct vme_bridge *, int, int);
-int vme_register_bridge_ng(struct vme_bridge *bridge);
-void vme_unregister_bridge_ng(struct vme_bridge *bridge);
+int vme_register_bridge(struct vme_bridge *bridge);
+void vme_unregister_bridge(struct vme_bridge *bridge);
 
 
 #endif /* _VME_H_ */
-- 
1.7.1


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

* Re: [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo'
  2010-10-26  1:10 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
@ 2010-10-27  9:17   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:17 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> done with
> find . -name '*.c' | xargs perl -p -i -e 's/&\(([^()]+)\)/&$1/g'
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_ca91cx42.c |  181 ++++++++++++------------
>  drivers/staging/vme/bridges/vme_tsi148.c   |  204 ++++++++++++++--------------
>  drivers/staging/vme/devices/vme_user.c     |   16 +-
>  drivers/staging/vme/vme.c                  |  114 ++++++++--------
>  4 files changed, 258 insertions(+), 257 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
> index 4d74562..1f2089f 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
> @@ -58,7 +58,7 @@ static struct pci_driver ca91cx42_driver = {
>  
>  static u32 ca91cx42_DMA_irqhandler(struct ca91cx42_driver *bridge)
>  {
> -	wake_up(&(bridge->dma_queue));
> +	wake_up(&bridge->dma_queue);
>  
>  	return CA91CX42_LINT_DMA;
>  }
> @@ -82,14 +82,14 @@ static u32 ca91cx42_LM_irqhandler(struct ca91cx42_driver *bridge, u32 stat)
>  /* XXX This needs to be split into 4 queues */
>  static u32 ca91cx42_MB_irqhandler(struct ca91cx42_driver *bridge, int mbox_mask)
>  {
> -	wake_up(&(bridge->mbox_queue));
> +	wake_up(&bridge->mbox_queue);
>  
>  	return CA91CX42_LINT_MBOX;
>  }
>  
>  static u32 ca91cx42_IACK_irqhandler(struct ca91cx42_driver *bridge)
>  {
> -	wake_up(&(bridge->iack_queue));
> +	wake_up(&bridge->iack_queue);
>  
>  	return CA91CX42_LINT_SW_IACK;
>  }
> @@ -207,9 +207,9 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
>  	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
>  
>  	/* Initialise list for VME bus errors */
> -	INIT_LIST_HEAD(&(ca91cx42_bridge->vme_errors));
> +	INIT_LIST_HEAD(&ca91cx42_bridge->vme_errors);
>  
> -	mutex_init(&(ca91cx42_bridge->irq_mtx));
> +	mutex_init(&ca91cx42_bridge->irq_mtx);
>  
>  	/* Disable interrupts from PCI to VME */
>  	iowrite32(0, bridge->base + VINT_EN);
> @@ -299,7 +299,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
>  	if (statid & 1)
>  		return -EINVAL;
>  
> -	mutex_lock(&(bridge->vme_int));
> +	mutex_lock(&bridge->vme_int);
>  
>  	tmp = ioread32(bridge->base + VINT_EN);
>  
> @@ -318,7 +318,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
>  	tmp = tmp & ~(1 << (level + 24));
>  	iowrite32(tmp, bridge->base + VINT_EN);
>  
> -	mutex_unlock(&(bridge->vme_int));
> +	mutex_unlock(&bridge->vme_int);
>  
>  	return 0;
>  }
> @@ -518,8 +518,8 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
>  		image->kern_base = NULL;
>  		if (image->bus_resource.name != NULL)
>  			kfree(image->bus_resource.name);
> -		release_resource(&(image->bus_resource));
> -		memset(&(image->bus_resource), 0, sizeof(struct resource));
> +		release_resource(&image->bus_resource);
> +		memset(&image->bus_resource, 0, sizeof(struct resource));
>  	}
>  
>  	if (image->bus_resource.name == NULL) {
> @@ -540,7 +540,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
>  	image->bus_resource.flags = IORESOURCE_MEM;
>  
>  	retval = pci_bus_alloc_resource(pdev->bus,
> -		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
> +		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
>  		0, NULL, NULL);
>  	if (retval) {
>  		dev_err(ca91cx42_bridge->parent, "Failed to allocate mem "
> @@ -563,10 +563,10 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
>  	iounmap(image->kern_base);
>  	image->kern_base = NULL;
>  err_remap:
> -	release_resource(&(image->bus_resource));
> +	release_resource(&image->bus_resource);
>  err_resource:
>  	kfree(image->bus_resource.name);
> -	memset(&(image->bus_resource), 0, sizeof(struct resource));
> +	memset(&image->bus_resource, 0, sizeof(struct resource));
>  err_name:
>  	return retval;
>  }
> @@ -578,9 +578,9 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
>  {
>  	iounmap(image->kern_base);
>  	image->kern_base = NULL;
> -	release_resource(&(image->bus_resource));
> +	release_resource(&image->bus_resource);
>  	kfree(image->bus_resource.name);
> -	memset(&(image->bus_resource), 0, sizeof(struct resource));
> +	memset(&image->bus_resource, 0, sizeof(struct resource));
>  }
>  
>  
> @@ -620,7 +620,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  		goto err_window;
>  	}
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	/*
>  	 * Let's allocate the resource here rather than further up the stack as
> @@ -628,7 +628,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  	 */
>  	retval = ca91cx42_alloc_resource(image, size);
>  	if (retval) {
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(ca91cx42_bridge->parent, "Unable to allocate memory "
>  			"for resource name\n");
>  		retval = -ENOMEM;
> @@ -672,7 +672,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  		temp_ctl |= CA91CX42_LSI_CTL_VDW_D64;
>  		break;
>  	default:
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(ca91cx42_bridge->parent, "Invalid data width\n");
>  		retval = -EINVAL;
>  		goto err_dwidth;
> @@ -704,7 +704,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  	case VME_USER3:
>  	case VME_USER4:
>  	default:
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(ca91cx42_bridge->parent, "Invalid address space\n");
>  		retval = -EINVAL;
>  		goto err_aspace;
> @@ -730,7 +730,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  
>  	iowrite32(temp_ctl, bridge->base + CA91CX42_LSI_CTL[i]);
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  	return 0;
>  
>  err_aspace:
> @@ -834,12 +834,12 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
>  {
>  	int retval;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace,
>  		cycle, dwidth);
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
>  	return retval;
>  }
> @@ -855,7 +855,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
>  	if (count == 0)
>  		return 0;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	/* The following code handles VME address alignment problem
>  	 * in order to assure the maximal data width cycle.
> @@ -899,7 +899,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
>  	}
>  out:
>  	retval = count;
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
>  	return retval;
>  }
> @@ -915,7 +915,7 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
>  	if (count == 0)
>  		return 0;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	/* Here we apply for the same strategy we do in master_read
>  	 * function in order to assure D16 cycle when required.
> @@ -954,7 +954,8 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
>  out:
>  	retval = count;
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
> +
>  	return retval;
>  }
>  
> @@ -974,10 +975,10 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
>  	i = image->number;
>  
>  	/* Locking as we can only do one of these at a time */
> -	mutex_lock(&(bridge->vme_rmw));
> +	mutex_lock(&bridge->vme_rmw);
>  
>  	/* Lock image */
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	pci_addr = (u32)image->kern_base + offset;
>  
> @@ -1007,9 +1008,9 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
>  	iowrite32(0, bridge->base + SCYC_CTL);
>  
>  out:
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
> -	mutex_unlock(&(bridge->vme_rmw));
> +	mutex_unlock(&bridge->vme_rmw);
>  
>  	return result;
>  }
> @@ -1036,14 +1037,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	}
>  
>  	/* Test descriptor alignment */
> -	if ((unsigned long)&(entry->descriptor) & CA91CX42_DCPP_M) {
> +	if ((unsigned long)&entry->descriptor & CA91CX42_DCPP_M) {
>  		dev_err(dev, "Descriptor not aligned to 16 byte boundary as "
> -			"required: %p\n", &(entry->descriptor));
> +			"required: %p\n", &entry->descriptor);
>  		retval = -EINVAL;
>  		goto err_align;
>  	}
>  
> -	memset(&(entry->descriptor), 0, sizeof(struct ca91cx42_dma_descriptor));
> +	memset(&entry->descriptor, 0, sizeof(struct ca91cx42_dma_descriptor));
>  
>  	if (dest->type == VME_DMA_VME) {
>  		entry->descriptor.dctl |= CA91CX42_DCTL_L2V;
> @@ -1138,14 +1139,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	entry->descriptor.dcpp = CA91CX42_DCPP_NULL;
>  
>  	/* Add to list */
> -	list_add_tail(&(entry->list), &(list->entries));
> +	list_add_tail(&entry->list, &list->entries);
>  
>  	/* Fill out previous descriptors "Next Address" */
> -	if (entry->list.prev != &(list->entries)) {
> +	if (entry->list.prev != &list->entries) {
>  		prev = list_entry(entry->list.prev, struct ca91cx42_dma_entry,
>  			list);
>  		/* We need the bus address for the pointer */
> -		desc_ptr = virt_to_bus(&(entry->descriptor));
> +		desc_ptr = virt_to_bus(&entry->descriptor);
>  		prev->descriptor.dcpp = desc_ptr & ~CA91CX42_DCPP_M;
>  	}
>  
> @@ -1190,28 +1191,28 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
>  	bridge = ctrlr->parent->driver_priv;
>  	dev = ctrlr->parent->parent;
>  
> -	mutex_lock(&(ctrlr->mtx));
> +	mutex_lock(&ctrlr->mtx);
>  
> -	if (!(list_empty(&(ctrlr->running)))) {
> +	if (!(list_empty(&ctrlr->running))) {
>  		/*
>  		 * XXX We have an active DMA transfer and currently haven't
>  		 *     sorted out the mechanism for "pending" DMA transfers.
>  		 *     Return busy.
>  		 */
>  		/* Need to add to pending here */
> -		mutex_unlock(&(ctrlr->mtx));
> +		mutex_unlock(&ctrlr->mtx);
>  		return -EBUSY;
>  	} else {
> -		list_add(&(list->list), &(ctrlr->running));
> +		list_add(&list->list, &ctrlr->running);
>  	}
>  
>  	/* Get first bus address and write into registers */
> -	entry = list_first_entry(&(list->entries), struct ca91cx42_dma_entry,
> +	entry = list_first_entry(&list->entries, struct ca91cx42_dma_entry,
>  		list);
>  
> -	bus_addr = virt_to_bus(&(entry->descriptor));
> +	bus_addr = virt_to_bus(&entry->descriptor);
>  
> -	mutex_unlock(&(ctrlr->mtx));
> +	mutex_unlock(&ctrlr->mtx);
>  
>  	iowrite32(0, bridge->base + DTBC);
>  	iowrite32(bus_addr & ~CA91CX42_DCPP_M, bridge->base + DCPP);
> @@ -1249,9 +1250,9 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
>  	}
>  
>  	/* Remove list from running list */
> -	mutex_lock(&(ctrlr->mtx));
> -	list_del(&(list->list));
> -	mutex_unlock(&(ctrlr->mtx));
> +	mutex_lock(&ctrlr->mtx);
> +	list_del(&list->list);
> +	mutex_unlock(&ctrlr->mtx);
>  
>  	return retval;
>  
> @@ -1263,7 +1264,7 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
>  	struct ca91cx42_dma_entry *entry;
>  
>  	/* detach and free each entry */
> -	list_for_each_safe(pos, temp, &(list->entries)) {
> +	list_for_each_safe(pos, temp, &list->entries) {
>  		list_del(pos);
>  		entry = list_entry(pos, struct ca91cx42_dma_entry, list);
>  		kfree(entry);
> @@ -1298,12 +1299,12 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  		return -EINVAL;
>  	}
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* If we already have a callback attached, we can't move it! */
>  	for (i = 0; i < lm->monitors; i++) {
>  		if (bridge->lm_callback[i] != NULL) {
> -			mutex_unlock(&(lm->mtx));
> +			mutex_unlock(&lm->mtx);
>  			dev_err(dev, "Location monitor callback attached, "
>  				"can't reset\n");
>  			return -EBUSY;
> @@ -1321,7 +1322,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  		lm_ctl |= CA91CX42_LM_CTL_AS_A32;
>  		break;
>  	default:
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(dev, "Invalid address space\n");
>  		return -EINVAL;
>  		break;
> @@ -1339,7 +1340,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  	iowrite32(lm_base, bridge->base + LM_BS);
>  	iowrite32(lm_ctl, bridge->base + LM_CTL);
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -1355,7 +1356,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  
>  	bridge = lm->parent->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	*lm_base = (unsigned long long)ioread32(bridge->base + LM_BS);
>  	lm_ctl = ioread32(bridge->base + LM_CTL);
> @@ -1380,7 +1381,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  	if (lm_ctl & CA91CX42_LM_CTL_DATA)
>  		*cycle |= VME_DATA;
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return enabled;
>  }
> @@ -1400,19 +1401,19 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
>  	bridge = lm->parent->driver_priv;
>  	dev = lm->parent->parent;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* Ensure that the location monitor is configured - need PGM or DATA */
>  	lm_ctl = ioread32(bridge->base + LM_CTL);
>  	if ((lm_ctl & (CA91CX42_LM_CTL_PGM | CA91CX42_LM_CTL_DATA)) == 0) {
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(dev, "Location monitor not properly configured\n");
>  		return -EINVAL;
>  	}
>  
>  	/* Check that a callback isn't already attached */
>  	if (bridge->lm_callback[monitor] != NULL) {
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(dev, "Existing callback attached\n");
>  		return -EBUSY;
>  	}
> @@ -1431,7 +1432,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
>  		iowrite32(lm_ctl, bridge->base + LM_CTL);
>  	}
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -1446,7 +1447,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
>  
>  	bridge = lm->parent->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* Disable Location Monitor and ensure previous interrupts are clear */
>  	tmp = ioread32(bridge->base + LINT_EN);
> @@ -1467,7 +1468,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
>  		iowrite32(tmp, bridge->base + LM_CTL);
>  	}
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -1526,7 +1527,7 @@ static int ca91cx42_crcsr_init(struct vme_bridge *ca91cx42_bridge,
>  
>  	/* Allocate mem for CR/CSR image */
>  	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
> -		&(bridge->crcsr_bus));
> +		&bridge->crcsr_bus);
>  	if (bridge->crcsr_kernel == NULL) {
>  		dev_err(&pdev->dev, "Failed to allocate memory for CR/CSR "
>  			"image\n");
> @@ -1632,12 +1633,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	}
>  
>  	/* Initialize wait queues & mutual exclusion flags */
> -	init_waitqueue_head(&(ca91cx42_device->dma_queue));
> -	init_waitqueue_head(&(ca91cx42_device->iack_queue));
> -	mutex_init(&(ca91cx42_device->vme_int));
> -	mutex_init(&(ca91cx42_device->vme_rmw));
> +	init_waitqueue_head(&ca91cx42_device->dma_queue);
> +	init_waitqueue_head(&ca91cx42_device->iack_queue);
> +	mutex_init(&ca91cx42_device->vme_int);
> +	mutex_init(&ca91cx42_device->vme_rmw);
>  
> -	ca91cx42_bridge->parent = &(pdev->dev);
> +	ca91cx42_bridge->parent = &pdev->dev;
>  	strcpy(ca91cx42_bridge->name, driver_name);
>  
>  	/* Setup IRQ */
> @@ -1648,7 +1649,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	}
>  
>  	/* Add master windows to list */
> -	INIT_LIST_HEAD(&(ca91cx42_bridge->master_resources));
> +	INIT_LIST_HEAD(&ca91cx42_bridge->master_resources);
>  	for (i = 0; i < CA91C142_MAX_MASTER; i++) {
>  		master_image = kmalloc(sizeof(struct vme_master_resource),
>  			GFP_KERNEL);
> @@ -1659,7 +1660,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_master;
>  		}
>  		master_image->parent = ca91cx42_bridge;
> -		spin_lock_init(&(master_image->lock));
> +		spin_lock_init(&master_image->lock);
>  		master_image->locked = 0;
>  		master_image->number = i;
>  		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> @@ -1667,15 +1668,15 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
>  			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
>  		master_image->width_attr = VME_D8 | VME_D16 | VME_D32 | VME_D64;
> -		memset(&(master_image->bus_resource), 0,
> +		memset(&master_image->bus_resource, 0,
>  			sizeof(struct resource));
>  		master_image->kern_base  = NULL;
> -		list_add_tail(&(master_image->list),
> -			&(ca91cx42_bridge->master_resources));
> +		list_add_tail(&master_image->list,
> +			&ca91cx42_bridge->master_resources);
>  	}
>  
>  	/* Add slave windows to list */
> -	INIT_LIST_HEAD(&(ca91cx42_bridge->slave_resources));
> +	INIT_LIST_HEAD(&ca91cx42_bridge->slave_resources);
>  	for (i = 0; i < CA91C142_MAX_SLAVE; i++) {
>  		slave_image = kmalloc(sizeof(struct vme_slave_resource),
>  			GFP_KERNEL);
> @@ -1686,7 +1687,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_slave;
>  		}
>  		slave_image->parent = ca91cx42_bridge;
> -		mutex_init(&(slave_image->mtx));
> +		mutex_init(&slave_image->mtx);
>  		slave_image->locked = 0;
>  		slave_image->number = i;
>  		slave_image->address_attr = VME_A24 | VME_A32 | VME_USER1 |
> @@ -1698,12 +1699,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
>  			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
> -		list_add_tail(&(slave_image->list),
> -			&(ca91cx42_bridge->slave_resources));
> +		list_add_tail(&slave_image->list,
> +			&ca91cx42_bridge->slave_resources);
>  	}
>  
>  	/* Add dma engines to list */
> -	INIT_LIST_HEAD(&(ca91cx42_bridge->dma_resources));
> +	INIT_LIST_HEAD(&ca91cx42_bridge->dma_resources);
>  	for (i = 0; i < CA91C142_MAX_DMA; i++) {
>  		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
>  			GFP_KERNEL);
> @@ -1714,19 +1715,19 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_dma;
>  		}
>  		dma_ctrlr->parent = ca91cx42_bridge;
> -		mutex_init(&(dma_ctrlr->mtx));
> +		mutex_init(&dma_ctrlr->mtx);
>  		dma_ctrlr->locked = 0;
>  		dma_ctrlr->number = i;
>  		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
>  			VME_DMA_MEM_TO_VME;
> -		INIT_LIST_HEAD(&(dma_ctrlr->pending));
> -		INIT_LIST_HEAD(&(dma_ctrlr->running));
> -		list_add_tail(&(dma_ctrlr->list),
> -			&(ca91cx42_bridge->dma_resources));
> +		INIT_LIST_HEAD(&dma_ctrlr->pending);
> +		INIT_LIST_HEAD(&dma_ctrlr->running);
> +		list_add_tail(&dma_ctrlr->list,
> +			&ca91cx42_bridge->dma_resources);
>  	}
>  
>  	/* Add location monitor to list */
> -	INIT_LIST_HEAD(&(ca91cx42_bridge->lm_resources));
> +	INIT_LIST_HEAD(&ca91cx42_bridge->lm_resources);
>  	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
>  	if (lm == NULL) {
>  		dev_err(&pdev->dev, "Failed to allocate memory for "
> @@ -1735,11 +1736,11 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		goto err_lm;
>  	}
>  	lm->parent = ca91cx42_bridge;
> -	mutex_init(&(lm->mtx));
> +	mutex_init(&lm->mtx);
>  	lm->locked = 0;
>  	lm->number = 1;
>  	lm->monitors = 4;
> -	list_add_tail(&(lm->list), &(ca91cx42_bridge->lm_resources));
> +	list_add_tail(&lm->list, &ca91cx42_bridge->lm_resources);
>  
>  	ca91cx42_bridge->slave_get = ca91cx42_slave_get;
>  	ca91cx42_bridge->slave_set = ca91cx42_slave_set;
> @@ -1786,28 +1787,28 @@ err_reg:
>  	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
>  err_lm:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
>  		lm = list_entry(pos, struct vme_lm_resource, list);
>  		list_del(pos);
>  		kfree(lm);
>  	}
>  err_dma:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
>  		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
>  		list_del(pos);
>  		kfree(dma_ctrlr);
>  	}
>  err_slave:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
>  		slave_image = list_entry(pos, struct vme_slave_resource, list);
>  		list_del(pos);
>  		kfree(slave_image);
>  	}
>  err_master:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->master_resources) {
>  		master_image = list_entry(pos, struct vme_master_resource,
>  			list);
>  		list_del(pos);
> @@ -1870,28 +1871,28 @@ void ca91cx42_remove(struct pci_dev *pdev)
>  	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
>  		lm = list_entry(pos, struct vme_lm_resource, list);
>  		list_del(pos);
>  		kfree(lm);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
>  		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
>  		list_del(pos);
>  		kfree(dma_ctrlr);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
>  		slave_image = list_entry(pos, struct vme_slave_resource, list);
>  		list_del(pos);
>  		kfree(slave_image);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
> +	list_for_each(pos, &ca91cx42_bridge->master_resources) {
>  		master_image = list_entry(pos, struct vme_master_resource,
>  			list);
>  		list_del(pos);
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index 492ddb2..1cba1fa 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -81,11 +81,11 @@ static u32 tsi148_DMA_irqhandler(struct tsi148_driver *bridge,
>  	u32 serviced = 0;
>  
>  	if (channel_mask & TSI148_LCSR_INTS_DMA0S) {
> -		wake_up(&(bridge->dma_queue[0]));
> +		wake_up(&bridge->dma_queue[0]);
>  		serviced |= TSI148_LCSR_INTC_DMA0C;
>  	}
>  	if (channel_mask & TSI148_LCSR_INTS_DMA1S) {
> -		wake_up(&(bridge->dma_queue[1]));
> +		wake_up(&bridge->dma_queue[1]);
>  		serviced |= TSI148_LCSR_INTC_DMA1C;
>  	}
>  
> @@ -191,7 +191,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
>  	if (error) {
>  		error->address = error_addr;
>  		error->attributes = error_attrib;
> -		list_add_tail(&(error->list), &(tsi148_bridge->vme_errors));
> +		list_add_tail(&error->list, &tsi148_bridge->vme_errors);
>  	} else {
>  		dev_err(tsi148_bridge->parent, "Unable to alloc memory for "
>  			"VMEbus Error reporting\n");
> @@ -210,7 +210,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
>   */
>  static u32 tsi148_IACK_irqhandler(struct tsi148_driver *bridge)
>  {
> -	wake_up(&(bridge->iack_queue));
> +	wake_up(&bridge->iack_queue);
>  
>  	return TSI148_LCSR_INTC_IACKC;
>  }
> @@ -320,9 +320,9 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
>  	bridge = tsi148_bridge->driver_priv;
>  
>  	/* Initialise list for VME bus errors */
> -	INIT_LIST_HEAD(&(tsi148_bridge->vme_errors));
> +	INIT_LIST_HEAD(&tsi148_bridge->vme_errors);
>  
> -	mutex_init(&(tsi148_bridge->irq_mtx));
> +	mutex_init(&tsi148_bridge->irq_mtx);
>  
>  	result = request_irq(pdev->irq,
>  			     tsi148_irqhandler,
> @@ -452,7 +452,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
>  
>  	bridge = tsi148_bridge->driver_priv;
>  
> -	mutex_lock(&(bridge->vme_int));
> +	mutex_lock(&bridge->vme_int);
>  
>  	/* Read VICR register */
>  	tmp = ioread32be(bridge->base + TSI148_LCSR_VICR);
> @@ -470,7 +470,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
>  	wait_event_interruptible(bridge->iack_queue,
>  		tsi148_iack_received(bridge));
>  
> -	mutex_unlock(&(bridge->vme_int));
> +	mutex_unlock(&bridge->vme_int);
>  
>  	return 0;
>  }
> @@ -496,7 +496,7 @@ static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge,
>  	 */
>  	err_pos = NULL;
>  	/* Iterate through errors */
> -	list_for_each(err_pos, &(tsi148_bridge->vme_errors)) {
> +	list_for_each(err_pos, &tsi148_bridge->vme_errors) {
>  		vme_err = list_entry(err_pos, struct vme_bus_error, list);
>  		if ((vme_err->address >= address) &&
>  			(vme_err->address < bound)) {
> @@ -530,7 +530,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
>  	 */
>  	err_pos = NULL;
>  	/* Iterate through errors */
> -	list_for_each_safe(err_pos, temp, &(tsi148_bridge->vme_errors)) {
> +	list_for_each_safe(err_pos, temp, &tsi148_bridge->vme_errors) {
>  		vme_err = list_entry(err_pos, struct vme_bus_error, list);
>  
>  		if ((vme_err->address >= address) &&
> @@ -819,8 +819,8 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
>  		image->kern_base = NULL;
>  		if (image->bus_resource.name != NULL)
>  			kfree(image->bus_resource.name);
> -		release_resource(&(image->bus_resource));
> -		memset(&(image->bus_resource), 0, sizeof(struct resource));
> +		release_resource(&image->bus_resource);
> +		memset(&image->bus_resource, 0, sizeof(struct resource));
>  	}
>  
>  	/* Exit here if size is zero */
> @@ -845,7 +845,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
>  	image->bus_resource.flags = IORESOURCE_MEM;
>  
>  	retval = pci_bus_alloc_resource(pdev->bus,
> -		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
> +		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
>  		0, NULL, NULL);
>  	if (retval) {
>  		dev_err(tsi148_bridge->parent, "Failed to allocate mem "
> @@ -868,10 +868,10 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
>  	iounmap(image->kern_base);
>  	image->kern_base = NULL;
>  err_remap:
> -	release_resource(&(image->bus_resource));
> +	release_resource(&image->bus_resource);
>  err_resource:
>  	kfree(image->bus_resource.name);
> -	memset(&(image->bus_resource), 0, sizeof(struct resource));
> +	memset(&image->bus_resource, 0, sizeof(struct resource));
>  err_name:
>  	return retval;
>  }
> @@ -883,9 +883,9 @@ static void tsi148_free_resource(struct vme_master_resource *image)
>  {
>  	iounmap(image->kern_base);
>  	image->kern_base = NULL;
> -	release_resource(&(image->bus_resource));
> +	release_resource(&image->bus_resource);
>  	kfree(image->bus_resource.name);
> -	memset(&(image->bus_resource), 0, sizeof(struct resource));
> +	memset(&image->bus_resource, 0, sizeof(struct resource));
>  }
>  
>  /*
> @@ -924,7 +924,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  		goto err_window;
>  	}
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	/* Let's allocate the resource here rather than further up the stack as
>  	 * it avoids pushing loads of bus dependant stuff up the stack. If size
> @@ -932,7 +932,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  	 */
>  	retval = tsi148_alloc_resource(image, size);
>  	if (retval) {
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Unable to allocate memory for "
>  			"resource\n");
>  		goto err_res;
> @@ -959,19 +959,19 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  	reg_split(vme_offset, &vme_offset_high, &vme_offset_low);
>  
>  	if (pci_base_low & 0xFFFF) {
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Invalid PCI base alignment\n");
>  		retval = -EINVAL;
>  		goto err_gran;
>  	}
>  	if (pci_bound_low & 0xFFFF) {
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Invalid PCI bound alignment\n");
>  		retval = -EINVAL;
>  		goto err_gran;
>  	}
>  	if (vme_offset_low & 0xFFFF) {
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Invalid VME Offset "
>  			"alignment\n");
>  		retval = -EINVAL;
> @@ -1035,7 +1035,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  		temp_ctl |= TSI148_LCSR_OTAT_DBW_32;
>  		break;
>  	default:
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Invalid data width\n");
>  		retval = -EINVAL;
>  		goto err_dwidth;
> @@ -1072,7 +1072,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  		temp_ctl |= TSI148_LCSR_OTAT_AMODE_USER4;
>  		break;
>  	default:
> -		spin_unlock(&(image->lock));
> +		spin_unlock(&image->lock);
>  		dev_err(tsi148_bridge->parent, "Invalid address space\n");
>  		retval = -EINVAL;
>  		goto err_aspace;
> @@ -1109,7 +1109,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  	iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] +
>  		TSI148_LCSR_OFFSET_OTAT);
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  	return 0;
>  
>  err_aspace:
> @@ -1243,12 +1243,12 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
>  {
>  	int retval;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	retval = __tsi148_master_get(image, enabled, vme_base, size, aspace,
>  		cycle, dwidth);
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
>  	return retval;
>  }
> @@ -1266,7 +1266,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
>  
>  	tsi148_bridge = image->parent;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	memcpy_fromio(buf, image->kern_base + offset, (unsigned int)count);
>  	retval = count;
> @@ -1289,7 +1289,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
>  	}
>  
>  skip_chk:
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
>  	return retval;
>  }
> @@ -1312,7 +1312,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
>  
>  	bridge = tsi148_bridge->driver_priv;
>  
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	memcpy_toio(image->kern_base + offset, buf, (unsigned int)count);
>  	retval = count;
> @@ -1352,7 +1352,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
>  	}
>  
>  skip_chk:
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
>  	return retval;
>  }
> @@ -1378,10 +1378,10 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
>  	i = image->number;
>  
>  	/* Locking as we can only do one of these at a time */
> -	mutex_lock(&(bridge->vme_rmw));
> +	mutex_lock(&bridge->vme_rmw);
>  
>  	/* Lock image */
> -	spin_lock(&(image->lock));
> +	spin_lock(&image->lock);
>  
>  	pci_addr_high = ioread32be(bridge->base + TSI148_LCSR_OT[i] +
>  		TSI148_LCSR_OFFSET_OTSAU);
> @@ -1411,9 +1411,9 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
>  	tmp &= ~TSI148_LCSR_VMCTRL_RMWEN;
>  	iowrite32be(tmp, bridge->base + TSI148_LCSR_VMCTRL);
>  
> -	spin_unlock(&(image->lock));
> +	spin_unlock(&image->lock);
>  
> -	mutex_unlock(&(bridge->vme_rmw));
> +	mutex_unlock(&bridge->vme_rmw);
>  
>  	return result;
>  }
> @@ -1633,10 +1633,10 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	}
>  
>  	/* Test descriptor alignment */
> -	if ((unsigned long)&(entry->descriptor) & 0x7) {
> +	if ((unsigned long)&entry->descriptor & 0x7) {
>  		dev_err(tsi148_bridge->parent, "Descriptor not aligned to 8 "
>  			"byte boundary as required: %p\n",
> -			&(entry->descriptor));
> +			&entry->descriptor);
>  		retval = -EINVAL;
>  		goto err_align;
>  	}
> @@ -1644,7 +1644,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	/* Given we are going to fill out the structure, we probably don't
>  	 * need to zero it, but better safe than sorry for now.
>  	 */
> -	memset(&(entry->descriptor), 0, sizeof(struct tsi148_dma_descriptor));
> +	memset(&entry->descriptor, 0, sizeof(struct tsi148_dma_descriptor));
>  
>  	/* Fill out source part */
>  	switch (src->type) {
> @@ -1681,7 +1681,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  		entry->descriptor.dsat = TSI148_LCSR_DSAT_TYP_VME;
>  
>  		retval = tsi148_dma_set_vme_src_attributes(
> -			tsi148_bridge->parent, &(entry->descriptor.dsat),
> +			tsi148_bridge->parent, &entry->descriptor.dsat,
>  			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
>  		if (retval < 0)
>  			goto err_source;
> @@ -1719,7 +1719,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  		entry->descriptor.ddat = TSI148_LCSR_DDAT_TYP_VME;
>  
>  		retval = tsi148_dma_set_vme_dest_attributes(
> -			tsi148_bridge->parent, &(entry->descriptor.ddat),
> +			tsi148_bridge->parent, &entry->descriptor.ddat,
>  			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
>  		if (retval < 0)
>  			goto err_dest;
> @@ -1735,16 +1735,16 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	entry->descriptor.dcnt = (u32)count;
>  
>  	/* Add to list */
> -	list_add_tail(&(entry->list), &(list->entries));
> +	list_add_tail(&entry->list, &list->entries);
>  
>  	/* Fill out previous descriptors "Next Address" */
> -	if (entry->list.prev != &(list->entries)) {
> +	if (entry->list.prev != &list->entries) {
>  		prev = list_entry(entry->list.prev, struct tsi148_dma_entry,
>  			list);
>  		/* We need the bus address for the pointer */
> -		desc_ptr = virt_to_bus(&(entry->descriptor));
> -		reg_split(desc_ptr, &(prev->descriptor.dnlau),
> -			&(prev->descriptor.dnlal));
> +		desc_ptr = virt_to_bus(&entry->descriptor);
> +		reg_split(desc_ptr, &prev->descriptor.dnlau,
> +			&prev->descriptor.dnlal);
>  	}
>  
>  	return 0;
> @@ -1799,30 +1799,30 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
>  
>  	bridge = tsi148_bridge->driver_priv;
>  
> -	mutex_lock(&(ctrlr->mtx));
> +	mutex_lock(&ctrlr->mtx);
>  
>  	channel = ctrlr->number;
>  
> -	if (!list_empty(&(ctrlr->running))) {
> +	if (!list_empty(&ctrlr->running)) {
>  		/*
>  		 * XXX We have an active DMA transfer and currently haven't
>  		 *     sorted out the mechanism for "pending" DMA transfers.
>  		 *     Return busy.
>  		 */
>  		/* Need to add to pending here */
> -		mutex_unlock(&(ctrlr->mtx));
> +		mutex_unlock(&ctrlr->mtx);
>  		return -EBUSY;
>  	} else {
> -		list_add(&(list->list), &(ctrlr->running));
> +		list_add(&list->list, &ctrlr->running);
>  	}
>  
>  	/* Get first bus address and write into registers */
> -	entry = list_first_entry(&(list->entries), struct tsi148_dma_entry,
> +	entry = list_first_entry(&list->entries, struct tsi148_dma_entry,
>  		list);
>  
> -	bus_addr = virt_to_bus(&(entry->descriptor));
> +	bus_addr = virt_to_bus(&entry->descriptor);
>  
> -	mutex_unlock(&(ctrlr->mtx));
> +	mutex_unlock(&ctrlr->mtx);
>  
>  	reg_split(bus_addr, &bus_addr_high, &bus_addr_low);
>  
> @@ -1850,9 +1850,9 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
>  	}
>  
>  	/* Remove list from running list */
> -	mutex_lock(&(ctrlr->mtx));
> -	list_del(&(list->list));
> -	mutex_unlock(&(ctrlr->mtx));
> +	mutex_lock(&ctrlr->mtx);
> +	list_del(&list->list);
> +	mutex_unlock(&ctrlr->mtx);
>  
>  	return retval;
>  }
> @@ -1868,7 +1868,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
>  	struct tsi148_dma_entry *entry;
>  
>  	/* detach and free each entry */
> -	list_for_each_safe(pos, temp, &(list->entries)) {
> +	list_for_each_safe(pos, temp, &list->entries) {
>  		list_del(pos);
>  		entry = list_entry(pos, struct tsi148_dma_entry, list);
>  		kfree(entry);
> @@ -1896,12 +1896,12 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  
>  	bridge = tsi148_bridge->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* If we already have a callback attached, we can't move it! */
>  	for (i = 0; i < lm->monitors; i++) {
>  		if (bridge->lm_callback[i] != NULL) {
> -			mutex_unlock(&(lm->mtx));
> +			mutex_unlock(&lm->mtx);
>  			dev_err(tsi148_bridge->parent, "Location monitor "
>  				"callback attached, can't reset\n");
>  			return -EBUSY;
> @@ -1922,7 +1922,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  		lm_ctl |= TSI148_LCSR_LMAT_AS_A64;
>  		break;
>  	default:
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(tsi148_bridge->parent, "Invalid address space\n");
>  		return -EINVAL;
>  		break;
> @@ -1943,7 +1943,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  	iowrite32be(lm_base_low, bridge->base + TSI148_LCSR_LMBAL);
>  	iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -1959,7 +1959,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  
>  	bridge = lm->parent->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	lm_base_high = ioread32be(bridge->base + TSI148_LCSR_LMBAU);
>  	lm_base_low = ioread32be(bridge->base + TSI148_LCSR_LMBAL);
> @@ -1992,7 +1992,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  	if (lm_ctl & TSI148_LCSR_LMAT_DATA)
>  		*cycle |= VME_DATA;
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return enabled;
>  }
> @@ -2013,12 +2013,12 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
>  
>  	bridge = tsi148_bridge->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* Ensure that the location monitor is configured - need PGM or DATA */
>  	lm_ctl = ioread32be(bridge->base + TSI148_LCSR_LMAT);
>  	if ((lm_ctl & (TSI148_LCSR_LMAT_PGM | TSI148_LCSR_LMAT_DATA)) == 0) {
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(tsi148_bridge->parent, "Location monitor not properly "
>  			"configured\n");
>  		return -EINVAL;
> @@ -2026,7 +2026,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
>  
>  	/* Check that a callback isn't already attached */
>  	if (bridge->lm_callback[monitor] != NULL) {
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  		dev_err(tsi148_bridge->parent, "Existing callback attached\n");
>  		return -EBUSY;
>  	}
> @@ -2049,7 +2049,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
>  		iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
>  	}
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -2064,7 +2064,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
>  
>  	bridge = lm->parent->driver_priv;
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* Disable Location Monitor and ensure previous interrupts are clear */
>  	lm_en = ioread32be(bridge->base + TSI148_LCSR_INTEN);
> @@ -2089,7 +2089,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
>  		iowrite32be(tmp, bridge->base + TSI148_LCSR_LMAT);
>  	}
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	return 0;
>  }
> @@ -2142,7 +2142,7 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
>  
>  	/* Allocate mem for CR/CSR image */
>  	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
> -		&(bridge->crcsr_bus));
> +		&bridge->crcsr_bus);
>  	if (bridge->crcsr_kernel == NULL) {
>  		dev_err(tsi148_bridge->parent, "Failed to allocate memory for "
>  			"CR/CSR image\n");
> @@ -2280,13 +2280,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	}
>  
>  	/* Initialize wait queues & mutual exclusion flags */
> -	init_waitqueue_head(&(tsi148_device->dma_queue[0]));
> -	init_waitqueue_head(&(tsi148_device->dma_queue[1]));
> -	init_waitqueue_head(&(tsi148_device->iack_queue));
> -	mutex_init(&(tsi148_device->vme_int));
> -	mutex_init(&(tsi148_device->vme_rmw));
> +	init_waitqueue_head(&tsi148_device->dma_queue[0]);
> +	init_waitqueue_head(&tsi148_device->dma_queue[1]);
> +	init_waitqueue_head(&tsi148_device->iack_queue);
> +	mutex_init(&tsi148_device->vme_int);
> +	mutex_init(&tsi148_device->vme_rmw);
>  
> -	tsi148_bridge->parent = &(pdev->dev);
> +	tsi148_bridge->parent = &pdev->dev;
>  	strcpy(tsi148_bridge->name, driver_name);
>  
>  	/* Setup IRQ */
> @@ -2314,7 +2314,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_master;
>  		}
>  		tsi148_device->flush_image->parent = tsi148_bridge;
> -		spin_lock_init(&(tsi148_device->flush_image->lock));
> +		spin_lock_init(&tsi148_device->flush_image->lock);
>  		tsi148_device->flush_image->locked = 1;
>  		tsi148_device->flush_image->number = master_num;
>  		tsi148_device->flush_image->address_attr = VME_A16 | VME_A24 |
> @@ -2324,13 +2324,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			VME_2eSST160 | VME_2eSST267 | VME_2eSST320 | VME_SUPER |
>  			VME_USER | VME_PROG | VME_DATA;
>  		tsi148_device->flush_image->width_attr = VME_D16 | VME_D32;
> -		memset(&(tsi148_device->flush_image->bus_resource), 0,
> +		memset(&tsi148_device->flush_image->bus_resource, 0,
>  			sizeof(struct resource));
>  		tsi148_device->flush_image->kern_base  = NULL;
>  	}
>  
>  	/* Add master windows to list */
> -	INIT_LIST_HEAD(&(tsi148_bridge->master_resources));
> +	INIT_LIST_HEAD(&tsi148_bridge->master_resources);
>  	for (i = 0; i < master_num; i++) {
>  		master_image = kmalloc(sizeof(struct vme_master_resource),
>  			GFP_KERNEL);
> @@ -2341,7 +2341,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_master;
>  		}
>  		master_image->parent = tsi148_bridge;
> -		spin_lock_init(&(master_image->lock));
> +		spin_lock_init(&master_image->lock);
>  		master_image->locked = 0;
>  		master_image->number = i;
>  		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> @@ -2351,15 +2351,15 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
>  			VME_PROG | VME_DATA;
>  		master_image->width_attr = VME_D16 | VME_D32;
> -		memset(&(master_image->bus_resource), 0,
> +		memset(&master_image->bus_resource, 0,
>  			sizeof(struct resource));
>  		master_image->kern_base  = NULL;
> -		list_add_tail(&(master_image->list),
> -			&(tsi148_bridge->master_resources));
> +		list_add_tail(&master_image->list,
> +			&tsi148_bridge->master_resources);
>  	}
>  
>  	/* Add slave windows to list */
> -	INIT_LIST_HEAD(&(tsi148_bridge->slave_resources));
> +	INIT_LIST_HEAD(&tsi148_bridge->slave_resources);
>  	for (i = 0; i < TSI148_MAX_SLAVE; i++) {
>  		slave_image = kmalloc(sizeof(struct vme_slave_resource),
>  			GFP_KERNEL);
> @@ -2370,7 +2370,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_slave;
>  		}
>  		slave_image->parent = tsi148_bridge;
> -		mutex_init(&(slave_image->mtx));
> +		mutex_init(&slave_image->mtx);
>  		slave_image->locked = 0;
>  		slave_image->number = i;
>  		slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
> @@ -2380,12 +2380,12 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
>  			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
>  			VME_PROG | VME_DATA;
> -		list_add_tail(&(slave_image->list),
> -			&(tsi148_bridge->slave_resources));
> +		list_add_tail(&slave_image->list,
> +			&tsi148_bridge->slave_resources);
>  	}
>  
>  	/* Add dma engines to list */
> -	INIT_LIST_HEAD(&(tsi148_bridge->dma_resources));
> +	INIT_LIST_HEAD(&tsi148_bridge->dma_resources);
>  	for (i = 0; i < TSI148_MAX_DMA; i++) {
>  		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
>  			GFP_KERNEL);
> @@ -2396,21 +2396,21 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  			goto err_dma;
>  		}
>  		dma_ctrlr->parent = tsi148_bridge;
> -		mutex_init(&(dma_ctrlr->mtx));
> +		mutex_init(&dma_ctrlr->mtx);
>  		dma_ctrlr->locked = 0;
>  		dma_ctrlr->number = i;
>  		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
>  			VME_DMA_MEM_TO_VME | VME_DMA_VME_TO_VME |
>  			VME_DMA_MEM_TO_MEM | VME_DMA_PATTERN_TO_VME |
>  			VME_DMA_PATTERN_TO_MEM;
> -		INIT_LIST_HEAD(&(dma_ctrlr->pending));
> -		INIT_LIST_HEAD(&(dma_ctrlr->running));
> -		list_add_tail(&(dma_ctrlr->list),
> -			&(tsi148_bridge->dma_resources));
> +		INIT_LIST_HEAD(&dma_ctrlr->pending);
> +		INIT_LIST_HEAD(&dma_ctrlr->running);
> +		list_add_tail(&dma_ctrlr->list,
> +			&tsi148_bridge->dma_resources);
>  	}
>  
>  	/* Add location monitor to list */
> -	INIT_LIST_HEAD(&(tsi148_bridge->lm_resources));
> +	INIT_LIST_HEAD(&tsi148_bridge->lm_resources);
>  	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
>  	if (lm == NULL) {
>  		dev_err(&pdev->dev, "Failed to allocate memory for "
> @@ -2419,11 +2419,11 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		goto err_lm;
>  	}
>  	lm->parent = tsi148_bridge;
> -	mutex_init(&(lm->mtx));
> +	mutex_init(&lm->mtx);
>  	lm->locked = 0;
>  	lm->number = 1;
>  	lm->monitors = 4;
> -	list_add_tail(&(lm->list), &(tsi148_bridge->lm_resources));
> +	list_add_tail(&lm->list, &tsi148_bridge->lm_resources);
>  
>  	tsi148_bridge->slave_get = tsi148_slave_get;
>  	tsi148_bridge->slave_set = tsi148_slave_set;
> @@ -2483,28 +2483,28 @@ err_reg:
>  err_crcsr:
>  err_lm:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->lm_resources)) {
> +	list_for_each(pos, &tsi148_bridge->lm_resources) {
>  		lm = list_entry(pos, struct vme_lm_resource, list);
>  		list_del(pos);
>  		kfree(lm);
>  	}
>  err_dma:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
> +	list_for_each(pos, &tsi148_bridge->dma_resources) {
>  		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
>  		list_del(pos);
>  		kfree(dma_ctrlr);
>  	}
>  err_slave:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
> +	list_for_each(pos, &tsi148_bridge->slave_resources) {
>  		slave_image = list_entry(pos, struct vme_slave_resource, list);
>  		list_del(pos);
>  		kfree(slave_image);
>  	}
>  err_master:
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->master_resources)) {
> +	list_for_each(pos, &tsi148_bridge->master_resources) {
>  		master_image = list_entry(pos, struct vme_master_resource,
>  			list);
>  		list_del(pos);
> @@ -2589,21 +2589,21 @@ static void tsi148_remove(struct pci_dev *pdev)
>  	tsi148_crcsr_exit(tsi148_bridge, pdev);
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
> +	list_for_each(pos, &tsi148_bridge->dma_resources) {
>  		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
>  		list_del(pos);
>  		kfree(dma_ctrlr);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
> +	list_for_each(pos, &tsi148_bridge->slave_resources) {
>  		slave_image = list_entry(pos, struct vme_slave_resource, list);
>  		list_del(pos);
>  		kfree(slave_image);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &(tsi148_bridge->master_resources)) {
> +	list_for_each(pos, &tsi148_bridge->master_resources) {
>  		master_image = list_entry(pos, struct vme_master_resource,
>  			list);
>  		list_del(pos);
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index 71bbc52..cbe2e11 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -470,9 +470,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  			 *	to userspace as they are
>  			 */
>  			retval = vme_master_get(image[minor].resource,
> -				&(master.enable), &(master.vme_addr),
> -				&(master.size), &(master.aspace),
> -				&(master.cycle), &(master.dwidth));
> +				&master.enable, &master.vme_addr,
> +				&master.size, &master.aspace,
> +				&master.cycle, &master.dwidth);
>  
>  			copied = copy_to_user((char *)arg, &master,
>  				sizeof(struct vme_master));
> @@ -514,9 +514,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  			 *	to userspace as they are
>  			 */
>  			retval = vme_slave_get(image[minor].resource,
> -				&(slave.enable), &(slave.vme_addr),
> -				&(slave.size), &pci_addr, &(slave.aspace),
> -				&(slave.cycle));
> +				&slave.enable, &slave.vme_addr,
> +				&slave.size, &pci_addr, &slave.aspace,
> +				&slave.cycle);
>  
>  			copied = copy_to_user((char *)arg, &slave,
>  				sizeof(struct vme_slave));
> @@ -683,7 +683,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
>  	for (i = 0; i < VME_DEVS; i++) {
>  		image[i].kern_buf = NULL;
>  		image[i].pci_buf = 0;
> -		sema_init(&(image[i].sem), 1);
> +		sema_init(&image[i].sem, 1);
>  		image[i].device = NULL;
>  		image[i].resource = NULL;
>  		image[i].users = 0;
> @@ -727,7 +727,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
>  		}
>  		image[i].size_buf = PCI_BUF_SIZE;
>  		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
> -			image[i].size_buf, &(image[i].pci_buf));
> +			image[i].size_buf, &image[i].pci_buf);
>  		if (image[i].kern_buf == NULL) {
>  			printk(KERN_WARNING "Unable to allocate memory for "
>  				"buffer\n");
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index 093fbff..47e9d5c 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
> @@ -245,7 +245,7 @@ struct vme_resource *vme_slave_request(struct device *dev,
>  	}
>  
>  	/* Loop through slave resources */
> -	list_for_each(slave_pos, &(bridge->slave_resources)) {
> +	list_for_each(slave_pos, &bridge->slave_resources) {
>  		slave_image = list_entry(slave_pos,
>  			struct vme_slave_resource, list);
>  
> @@ -255,17 +255,17 @@ struct vme_resource *vme_slave_request(struct device *dev,
>  		}
>  
>  		/* Find an unlocked and compatible image */
> -		mutex_lock(&(slave_image->mtx));
> +		mutex_lock(&slave_image->mtx);
>  		if (((slave_image->address_attr & address) == address) &&
>  			((slave_image->cycle_attr & cycle) == cycle) &&
>  			(slave_image->locked == 0)) {
>  
>  			slave_image->locked = 1;
> -			mutex_unlock(&(slave_image->mtx));
> +			mutex_unlock(&slave_image->mtx);
>  			allocated_image = slave_image;
>  			break;
>  		}
> -		mutex_unlock(&(slave_image->mtx));
> +		mutex_unlock(&slave_image->mtx);
>  	}
>  
>  	/* No free image */
> @@ -278,15 +278,15 @@ struct vme_resource *vme_slave_request(struct device *dev,
>  		goto err_alloc;
>  	}
>  	resource->type = VME_SLAVE;
> -	resource->entry = &(allocated_image->list);
> +	resource->entry = &allocated_image->list;
>  
>  	return resource;
>  
>  err_alloc:
>  	/* Unlock image */
> -	mutex_lock(&(slave_image->mtx));
> +	mutex_lock(&slave_image->mtx);
>  	slave_image->locked = 0;
> -	mutex_unlock(&(slave_image->mtx));
> +	mutex_unlock(&slave_image->mtx);
>  err_image:
>  err_bus:
>  	return NULL;
> @@ -369,12 +369,12 @@ void vme_slave_free(struct vme_resource *resource)
>  	}
>  
>  	/* Unlock image */
> -	mutex_lock(&(slave_image->mtx));
> +	mutex_lock(&slave_image->mtx);
>  	if (slave_image->locked == 0)
>  		printk(KERN_ERR "Image is already free\n");
>  
>  	slave_image->locked = 0;
> -	mutex_unlock(&(slave_image->mtx));
> +	mutex_unlock(&slave_image->mtx);
>  
>  	/* Free up resource memory */
>  	kfree(resource);
> @@ -401,7 +401,7 @@ struct vme_resource *vme_master_request(struct device *dev,
>  	}
>  
>  	/* Loop through master resources */
> -	list_for_each(master_pos, &(bridge->master_resources)) {
> +	list_for_each(master_pos, &bridge->master_resources) {
>  		master_image = list_entry(master_pos,
>  			struct vme_master_resource, list);
>  
> @@ -411,18 +411,18 @@ struct vme_resource *vme_master_request(struct device *dev,
>  		}
>  
>  		/* Find an unlocked and compatible image */
> -		spin_lock(&(master_image->lock));
> +		spin_lock(&master_image->lock);
>  		if (((master_image->address_attr & address) == address) &&
>  			((master_image->cycle_attr & cycle) == cycle) &&
>  			((master_image->width_attr & dwidth) == dwidth) &&
>  			(master_image->locked == 0)) {
>  
>  			master_image->locked = 1;
> -			spin_unlock(&(master_image->lock));
> +			spin_unlock(&master_image->lock);
>  			allocated_image = master_image;
>  			break;
>  		}
> -		spin_unlock(&(master_image->lock));
> +		spin_unlock(&master_image->lock);
>  	}
>  
>  	/* Check to see if we found a resource */
> @@ -437,16 +437,16 @@ struct vme_resource *vme_master_request(struct device *dev,
>  		goto err_alloc;
>  	}
>  	resource->type = VME_MASTER;
> -	resource->entry = &(allocated_image->list);
> +	resource->entry = &allocated_image->list;
>  
>  	return resource;
>  
>  	kfree(resource);
>  err_alloc:
>  	/* Unlock image */
> -	spin_lock(&(master_image->lock));
> +	spin_lock(&master_image->lock);
>  	master_image->locked = 0;
> -	spin_unlock(&(master_image->lock));
> +	spin_unlock(&master_image->lock);
>  err_image:
>  err_bus:
>  	return NULL;
> @@ -628,12 +628,12 @@ void vme_master_free(struct vme_resource *resource)
>  	}
>  
>  	/* Unlock image */
> -	spin_lock(&(master_image->lock));
> +	spin_lock(&master_image->lock);
>  	if (master_image->locked == 0)
>  		printk(KERN_ERR "Image is already free\n");
>  
>  	master_image->locked = 0;
> -	spin_unlock(&(master_image->lock));
> +	spin_unlock(&master_image->lock);
>  
>  	/* Free up resource memory */
>  	kfree(resource);
> @@ -662,7 +662,7 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
>  	}
>  
>  	/* Loop through DMA resources */
> -	list_for_each(dma_pos, &(bridge->dma_resources)) {
> +	list_for_each(dma_pos, &bridge->dma_resources) {
>  		dma_ctrlr = list_entry(dma_pos,
>  			struct vme_dma_resource, list);
>  
> @@ -672,16 +672,16 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
>  		}
>  
>  		/* Find an unlocked and compatible controller */
> -		mutex_lock(&(dma_ctrlr->mtx));
> +		mutex_lock(&dma_ctrlr->mtx);
>  		if (((dma_ctrlr->route_attr & route) == route) &&
>  			(dma_ctrlr->locked == 0)) {
>  
>  			dma_ctrlr->locked = 1;
> -			mutex_unlock(&(dma_ctrlr->mtx));
> +			mutex_unlock(&dma_ctrlr->mtx);
>  			allocated_ctrlr = dma_ctrlr;
>  			break;
>  		}
> -		mutex_unlock(&(dma_ctrlr->mtx));
> +		mutex_unlock(&dma_ctrlr->mtx);
>  	}
>  
>  	/* Check to see if we found a resource */
> @@ -694,15 +694,15 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
>  		goto err_alloc;
>  	}
>  	resource->type = VME_DMA;
> -	resource->entry = &(allocated_ctrlr->list);
> +	resource->entry = &allocated_ctrlr->list;
>  
>  	return resource;
>  
>  err_alloc:
>  	/* Unlock image */
> -	mutex_lock(&(dma_ctrlr->mtx));
> +	mutex_lock(&dma_ctrlr->mtx);
>  	dma_ctrlr->locked = 0;
> -	mutex_unlock(&(dma_ctrlr->mtx));
> +	mutex_unlock(&dma_ctrlr->mtx);
>  err_ctrlr:
>  err_bus:
>  	return NULL;
> @@ -729,9 +729,9 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource)
>  		printk(KERN_ERR "Unable to allocate memory for new dma list\n");
>  		return NULL;
>  	}
> -	INIT_LIST_HEAD(&(dma_list->entries));
> +	INIT_LIST_HEAD(&dma_list->entries);
>  	dma_list->parent = ctrlr;
> -	mutex_init(&(dma_list->mtx));
> +	mutex_init(&dma_list->mtx);
>  
>  	return dma_list;
>  }
> @@ -880,14 +880,14 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  		return -EINVAL;
>  	}
>  
> -	if (!mutex_trylock(&(list->mtx))) {
> +	if (!mutex_trylock(&list->mtx)) {
>  		printk(KERN_ERR "Link List already submitted\n");
>  		return -EINVAL;
>  	}
>  
>  	retval = bridge->dma_list_add(list, src, dest, count);
>  
> -	mutex_unlock(&(list->mtx));
> +	mutex_unlock(&list->mtx);
>  
>  	return retval;
>  }
> @@ -903,11 +903,11 @@ int vme_dma_list_exec(struct vme_dma_list *list)
>  		return -EINVAL;
>  	}
>  
> -	mutex_lock(&(list->mtx));
> +	mutex_lock(&list->mtx);
>  
>  	retval = bridge->dma_list_exec(list);
>  
> -	mutex_unlock(&(list->mtx));
> +	mutex_unlock(&list->mtx);
>  
>  	return retval;
>  }
> @@ -923,7 +923,7 @@ int vme_dma_list_free(struct vme_dma_list *list)
>  		return -EINVAL;
>  	}
>  
> -	if (!mutex_trylock(&(list->mtx))) {
> +	if (!mutex_trylock(&list->mtx)) {
>  		printk(KERN_ERR "Link List in use\n");
>  		return -EINVAL;
>  	}
> @@ -935,10 +935,10 @@ int vme_dma_list_free(struct vme_dma_list *list)
>  	retval = bridge->dma_list_empty(list);
>  	if (retval) {
>  		printk(KERN_ERR "Unable to empty link-list entries\n");
> -		mutex_unlock(&(list->mtx));
> +		mutex_unlock(&list->mtx);
>  		return retval;
>  	}
> -	mutex_unlock(&(list->mtx));
> +	mutex_unlock(&list->mtx);
>  	kfree(list);
>  
>  	return retval;
> @@ -956,20 +956,20 @@ int vme_dma_free(struct vme_resource *resource)
>  
>  	ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
>  
> -	if (!mutex_trylock(&(ctrlr->mtx))) {
> +	if (!mutex_trylock(&ctrlr->mtx)) {
>  		printk(KERN_ERR "Resource busy, can't free\n");
>  		return -EBUSY;
>  	}
>  
> -	if (!(list_empty(&(ctrlr->pending)) && list_empty(&(ctrlr->running)))) {
> +	if (!(list_empty(&ctrlr->pending) && list_empty(&ctrlr->running))) {
>  		printk(KERN_WARNING "Resource still processing transfers\n");
> -		mutex_unlock(&(ctrlr->mtx));
> +		mutex_unlock(&ctrlr->mtx);
>  		return -EBUSY;
>  	}
>  
>  	ctrlr->locked = 0;
>  
> -	mutex_unlock(&(ctrlr->mtx));
> +	mutex_unlock(&ctrlr->mtx);
>  
>  	return 0;
>  }
> @@ -1013,10 +1013,10 @@ int vme_irq_request(struct device *dev, int level, int statid,
>  		return -EINVAL;
>  	}
>  
> -	mutex_lock(&(bridge->irq_mtx));
> +	mutex_lock(&bridge->irq_mtx);
>  
>  	if (bridge->irq[level - 1].callback[statid].func) {
> -		mutex_unlock(&(bridge->irq_mtx));
> +		mutex_unlock(&bridge->irq_mtx);
>  		printk(KERN_WARNING "VME Interrupt already taken\n");
>  		return -EBUSY;
>  	}
> @@ -1028,7 +1028,7 @@ int vme_irq_request(struct device *dev, int level, int statid,
>  	/* Enable IRQ level */
>  	bridge->irq_set(bridge, level, 1, 1);
>  
> -	mutex_unlock(&(bridge->irq_mtx));
> +	mutex_unlock(&bridge->irq_mtx);
>  
>  	return 0;
>  }
> @@ -1054,7 +1054,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
>  		return;
>  	}
>  
> -	mutex_lock(&(bridge->irq_mtx));
> +	mutex_lock(&bridge->irq_mtx);
>  
>  	bridge->irq[level - 1].count--;
>  
> @@ -1065,7 +1065,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
>  	bridge->irq[level - 1].callback[statid].func = NULL;
>  	bridge->irq[level - 1].callback[statid].priv_data = NULL;
>  
> -	mutex_unlock(&(bridge->irq_mtx));
> +	mutex_unlock(&bridge->irq_mtx);
>  }
>  EXPORT_SYMBOL(vme_irq_free);
>  
> @@ -1111,7 +1111,7 @@ struct vme_resource *vme_lm_request(struct device *dev)
>  	}
>  
>  	/* Loop through DMA resources */
> -	list_for_each(lm_pos, &(bridge->lm_resources)) {
> +	list_for_each(lm_pos, &bridge->lm_resources) {
>  		lm = list_entry(lm_pos,
>  			struct vme_lm_resource, list);
>  
> @@ -1122,14 +1122,14 @@ struct vme_resource *vme_lm_request(struct device *dev)
>  		}
>  
>  		/* Find an unlocked controller */
> -		mutex_lock(&(lm->mtx));
> +		mutex_lock(&lm->mtx);
>  		if (lm->locked == 0) {
>  			lm->locked = 1;
> -			mutex_unlock(&(lm->mtx));
> +			mutex_unlock(&lm->mtx);
>  			allocated_lm = lm;
>  			break;
>  		}
> -		mutex_unlock(&(lm->mtx));
> +		mutex_unlock(&lm->mtx);
>  	}
>  
>  	/* Check to see if we found a resource */
> @@ -1142,15 +1142,15 @@ struct vme_resource *vme_lm_request(struct device *dev)
>  		goto err_alloc;
>  	}
>  	resource->type = VME_LM;
> -	resource->entry = &(allocated_lm->list);
> +	resource->entry = &allocated_lm->list;
>  
>  	return resource;
>  
>  err_alloc:
>  	/* Unlock image */
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  	lm->locked = 0;
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  err_lm:
>  err_bus:
>  	return NULL;
> @@ -1270,7 +1270,7 @@ void vme_lm_free(struct vme_resource *resource)
>  
>  	lm = list_entry(resource->entry, struct vme_lm_resource, list);
>  
> -	mutex_lock(&(lm->mtx));
> +	mutex_lock(&lm->mtx);
>  
>  	/* XXX
>  	 * Check to see that there aren't any callbacks still attached, if
> @@ -1279,7 +1279,7 @@ void vme_lm_free(struct vme_resource *resource)
>  
>  	lm->locked = 0;
>  
> -	mutex_unlock(&(lm->mtx));
> +	mutex_unlock(&lm->mtx);
>  
>  	kfree(resource);
>  }
> @@ -1343,11 +1343,11 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  	 * specification.
>  	 */
>  	for (i = 0; i < VME_SLOTS_MAX; i++) {
> -		dev = &(bridge->dev[i]);
> +		dev = &bridge->dev[i];
>  		memset(dev, 0, sizeof(struct device));
>  
>  		dev->parent = bridge->parent;
> -		dev->bus = &(vme_bus_type);
> +		dev->bus = &vme_bus_type;
>  		/*
>  		 * We save a pointer to the bridge in platform_data so that we
>  		 * can get to it later. We keep driver_data for use by the
> @@ -1366,7 +1366,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  	i = VME_SLOTS_MAX;
>  err_reg:
>  	while (i > -1) {
> -		dev = &(bridge->dev[i]);
> +		dev = &bridge->dev[i];
>  		device_unregister(dev);
>  	}
>  	vme_free_bus_num(bridge->num);
> @@ -1381,7 +1381,7 @@ void vme_unregister_bridge(struct vme_bridge *bridge)
>  
>  
>  	for (i = 0; i < VME_SLOTS_MAX; i++) {
> -		dev = &(bridge->dev[i]);
> +		dev = &bridge->dev[i];
>  		device_unregister(dev);
>  	}
>  	vme_free_bus_num(bridge->num);
> @@ -1418,7 +1418,7 @@ static int vme_calc_slot(struct device *dev)
>  	/* Determine slot number */
>  	num = 0;
>  	while (num < VME_SLOTS_MAX) {
> -		if (&(bridge->dev[num]) == dev)
> +		if (&bridge->dev[num] == dev)
>  			break;
>  
>  		num++;


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails
  2010-10-26  1:10 ` [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails Emilio G. Cota
@ 2010-10-27  9:25   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:25 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> When init_module fails, 0 is returned anyway; the module is then installed
> and oopses when we try to remove it:
> 
> [ 3236.368009] WARNING: at drivers/base/driver.c:262 driver_unregister+0x36/0x6f()
> [ 3236.368012] Hardware name:
> [ 3236.368014] Unexpected driver unregister!
> [ 3236.368016] Modules linked in: vme_user(-) vme_tsi148 vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: vme]
> [ 3236.368027] Pid: 16162, comm: rmmod Not tainted 2.6.35 #2
> [ 3236.368029] Call Trace:
> [ 3236.368037]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
> [ 3236.368044]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
> [ 3236.368049]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
> [ 3236.368054]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
> [ 3236.368059]  [<ffffffff811e8f78>] driver_unregister+0x36/0x6f
> [ 3236.368066]  [<ffffffffa004aa44>] vme_unregister_driver+0xd/0xf [vme]
> [ 3236.368072]  [<ffffffffa00616c8>] vme_user_exit+0x10/0x1e [vme_user]
> [ 3236.368076]  [<ffffffff810612c1>] sys_delete_module+0x1ba/0x226
> [ 3236.368082]  [<ffffffff812d6e14>] ? do_page_fault+0x25d/0x28a
> [ 3236.368088]  [<ffffffff8100202b>] system_call_fastpath+0x16/0x1b
> [ 3236.368092] ---[ end trace cab6d88ebc44c1de ]---
> 
> The appended fixes it by returning the appropriate error code in module_init
> whenever something goes wrong, thus cancelling the insertion of the module.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index cbe2e11..a6f6116 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -611,6 +611,7 @@ static int __init vme_user_init(void)
>  	if (bus_num == 0) {
>  		printk(KERN_ERR "%s: No cards, skipping registration\n",
>  			driver_name);
> +		retval = -ENODEV;
>  		goto err_nocard;
>  	}
>  
> @@ -629,6 +630,7 @@ static int __init vme_user_init(void)
>  	if (ids == NULL) {
>  		printk(KERN_ERR "%s: Unable to allocate ID table\n",
>  			driver_name);
> +		retval = -ENOMEM;
>  		goto err_id;
>  	}
>  


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 03/30] staging/vme_user: remove unreachable line
  2010-10-26  1:10 ` [PATCH 03/30] staging/vme_user: remove unreachable line Emilio G. Cota
@ 2010-10-27  9:39   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:39 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

This line was provided to aid future development. It is the command
needed to undo the last function call to the function.

On balance I guess this is as likely to end up causing as many problems
as it aims to solve, so I guess it's worth getting rid of it:

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index a6f6116..bdc4e1e 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -654,7 +654,6 @@ static int __init vme_user_init(void)
>  
>  	return retval;
>  
> -	vme_unregister_driver(&vme_user_driver);
>  err_reg:
>  	kfree(ids);
>  err_id:


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers
  2010-10-26  1:10 ` [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers Emilio G. Cota
@ 2010-10-27  9:41   ` Martyn Welch
  2010-10-27 15:13     ` Emilio G. Cota
  0 siblings, 1 reply; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:41 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> In a configuration with several bridges, each bridge is
> assigned a certain bus number depending on the order in which
> vme_register_bridge is called. This can complicate multi-bridge
> installations because the eventual bus numbers will depend
> on the order the bridges were loaded.
> 
> The appended allows bridges to register with a bus number of
> their choice, while keeping the previous 'first come, first
> served' behaviour as the default.
> 

I can't see where this is being used. I assume this is a part of future
changes you wish to make?

Martyn

> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  drivers/staging/vme/bridges/vme_ca91cx42.c |    1 +
>  drivers/staging/vme/bridges/vme_tsi148.c   |    1 +
>  drivers/staging/vme/vme.c                  |   46 +++++++++++++++++++++-------
>  drivers/staging/vme/vme.h                  |    1 +
>  4 files changed, 38 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
> index 1f2089f..14e10a6 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
> @@ -1600,6 +1600,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	}
>  
>  	ca91cx42_bridge->driver_priv = ca91cx42_device;
> +	ca91cx42_bridge->num = -1;
>  
>  	/* Enable the device */
>  	retval = pci_enable_device(pdev);
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index 1cba1fa..e341122 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -2247,6 +2247,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	}
>  
>  	tsi148_bridge->driver_priv = tsi148_device;
> +	tsi148_bridge->num = -1;
>  
>  	/* Enable the device */
>  	retval = pci_enable_device(pdev);
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index 47e9d5c..9fa0609 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
> @@ -1307,20 +1307,42 @@ EXPORT_SYMBOL(vme_slot_get);
>  
>  /* - Bridge Registration --------------------------------------------------- */
>  
> -static int vme_alloc_bus_num(void)
> +/* call with vme_bus_num_mtx held */
> +static int __vme_alloc_bus_num(int *bus)
>  {
> -	int i;
> -
> -	mutex_lock(&vme_bus_num_mtx);
> -	for (i = 0; i < sizeof(vme_bus_numbers) * 8; i++) {
> -		if (((vme_bus_numbers >> i) & 0x1) == 0) {
> -			vme_bus_numbers |= (0x1 << i);
> -			break;
> +	int index;
> +
> +	if (*bus == -1) {
> +		/* try to find a free bus number */
> +		for (index = 0; index < VME_MAX_BRIDGES; index++) {
> +			if (~vme_bus_numbers & 1 << index) {
> +				*bus = index;
> +				break;
> +			}
> +		}
> +		if (index == VME_MAX_BRIDGES) {
> +			pr_warn("vme: No bus numbers left\n");
> +			return -ENODEV;
> +		}
> +	} else {
> +		/* check if the given bus number is already in use */
> +		if (vme_bus_numbers & (1 << *bus)) {
> +			pr_warn("vme: bus number %d already in use\n", *bus);
> +			return -EBUSY;
>  		}
>  	}
> -	mutex_unlock(&vme_bus_num_mtx);
> +	vme_bus_numbers |= 1 << *bus;
> +	return 0;
> +}
> +
> +static int vme_alloc_bus_num(int *bus)
> +{
> +	int ret;
>  
> -	return i;
> +	mutex_lock(&vme_bus_num_mtx);
> +	ret = __vme_alloc_bus_num(bus);
> +	mutex_unlock(&vme_bus_num_mtx);
> +	return ret;
>  }
>  
>  static void vme_free_bus_num(int bus)
> @@ -1336,7 +1358,9 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  	int retval;
>  	int i;
>  
> -	bridge->num = vme_alloc_bus_num();
> +	retval = vme_alloc_bus_num(&bridge->num);
> +	if (retval)
> +		return retval;
>  
>  	/* This creates 32 vme "slot" devices. This equates to a slot for each
>  	 * ID available in a system conforming to the ANSI/VITA 1-1994
> diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
> index 48768ca..5cdfa52 100644
> --- a/drivers/staging/vme/vme.h
> +++ b/drivers/staging/vme/vme.h
> @@ -88,6 +88,7 @@ struct vme_resource {
>  
>  extern struct bus_type vme_bus_type;
>  
> +#define VME_MAX_BRIDGES		32
>  #define VME_SLOT_CURRENT	-1
>  #define VME_SLOT_ALL		-2
>  


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num
  2010-10-26  1:10 ` [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Emilio G. Cota
@ 2010-10-27  9:49   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:49 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/vme.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index 9fa0609..afd2dbd 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
> @@ -1348,7 +1348,7 @@ static int vme_alloc_bus_num(int *bus)
>  static void vme_free_bus_num(int bus)
>  {
>  	mutex_lock(&vme_bus_num_mtx);
> -	vme_bus_numbers |= ~(0x1 << bus);
> +	vme_bus_numbers &= ~(0x1 << bus);
>  	mutex_unlock(&vme_bus_num_mtx);
>  }
>  


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove
  2010-10-26  1:10 ` [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Emilio G. Cota
@ 2010-10-27  9:51   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27  9:51 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> This fixes an oops when removing the module.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index e341122..660968e 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -2532,6 +2532,7 @@ err_struct:
>  static void tsi148_remove(struct pci_dev *pdev)
>  {
>  	struct list_head *pos = NULL;
> +	struct list_head *tmplist;
>  	struct vme_master_resource *master_image;
>  	struct vme_slave_resource *slave_image;
>  	struct vme_dma_resource *dma_ctrlr;
> @@ -2590,21 +2591,21 @@ static void tsi148_remove(struct pci_dev *pdev)
>  	tsi148_crcsr_exit(tsi148_bridge, pdev);
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &tsi148_bridge->dma_resources) {
> +	list_for_each_safe(pos, tmplist, &tsi148_bridge->dma_resources) {
>  		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
>  		list_del(pos);
>  		kfree(dma_ctrlr);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &tsi148_bridge->slave_resources) {
> +	list_for_each_safe(pos, tmplist, &tsi148_bridge->slave_resources) {
>  		slave_image = list_entry(pos, struct vme_slave_resource, list);
>  		list_del(pos);
>  		kfree(slave_image);
>  	}
>  
>  	/* resources are stored in link list */
> -	list_for_each(pos, &tsi148_bridge->master_resources) {
> +	list_for_each_safe(pos, tmplist, &tsi148_bridge->master_resources) {
>  		master_image = list_entry(pos, struct vme_master_resource,
>  			list);
>  		list_del(pos);


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ in .remove
  2010-10-26  1:10 ` [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ " Emilio G. Cota
@ 2010-10-27 10:01   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 10:01 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> tsi148_irq_exit is called twice in .remove, which causes an oops.
> 
> Remove the second call, which apart from being redundant cannot
> possibly work; the CR/CSR space has been already unmapped.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index 660968e..acfbd59 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -2612,8 +2612,6 @@ static void tsi148_remove(struct pci_dev *pdev)
>  		kfree(master_image);
>  	}
>  
> -	tsi148_irq_exit(bridge, pdev);
> -
>  	iounmap(bridge->base);
>  
>  	pci_release_regions(pdev);


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq
  2010-10-26  1:10 ` [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq Emilio G. Cota
@ 2010-10-27 10:23   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 10:23 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> The cookie passed to request_irq isn't the same as the one passed
> to free_irq, which results in the following warning:
> 
> [   63.243533] WARNING: at kernel/irq/manage.c:899 __free_irq+0x9b/0x17d()
> [   63.243533] Hardware name:
> [   63.243533] Trying to free already-free IRQ 17
> [   63.243533] Modules linked in: vme_tsi148(-) vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: scsi_wait_scan]
> [   63.243533] Pid: 2013, comm: rmmod Not tainted 2.6.35 #2
> [   63.243533] Call Trace:
> [   63.243533]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
> [   63.243533]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
> [   63.243533]  [<ffffffff810678c4>] __free_irq+0x9b/0x17d
> [   63.243533]  [<ffffffff810679d9>] free_irq+0x33/0x4e
> [   63.243533]  [<ffffffffa004a897>] tsi148_irq_exit+0x6b/0x70 [vme_tsi148]
> [...]
> [   63.243533] ---[ end trace bbf92311d969efb4 ]---
> 
> Fix it by passing the same cookie to both functions.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.c   |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
>  create mode 100644 drivers/staging/vme/bridges/Module.symvers
> 
> diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers
> new file mode 100644
> index 0000000..e69de29
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index acfbd59..5bb999f 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -374,8 +374,10 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
>  	return 0;
>  }
>  
> -static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
> +static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge, struct pci_dev *pdev)
>  {
> +	struct tsi148_driver *bridge = tsi148_bridge->driver_priv;
> +
>  	/* Turn off interrupts */
>  	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEO);
>  	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEN);
> @@ -384,7 +386,7 @@ static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
>  	iowrite32be(0xFFFFFFFF, bridge->base + TSI148_LCSR_INTC);
>  
>  	/* Detach interrupt handler */
> -	free_irq(pdev->irq, pdev);
> +	free_irq(pdev->irq, tsi148_bridge);
>  }
>  
>  /*
> @@ -2512,7 +2514,7 @@ err_master:
>  		kfree(master_image);
>  	}
>  
> -	tsi148_irq_exit(tsi148_device, pdev);
> +	tsi148_irq_exit(tsi148_bridge, pdev);
>  err_irq:
>  err_test:
>  	iounmap(tsi148_device->base);
> @@ -2584,7 +2586,7 @@ static void tsi148_remove(struct pci_dev *pdev)
>  	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM1);
>  	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM2);
>  
> -	tsi148_irq_exit(bridge, pdev);
> +	tsi148_irq_exit(tsi148_bridge, pdev);
>  
>  	vme_unregister_bridge(tsi148_bridge);
>  


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-26  1:10 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota
@ 2010-10-27 10:54   ` Martyn Welch
  2010-10-27 14:46     ` Emilio G. Cota
  0 siblings, 1 reply; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 10:54 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Without it we get 32 warnings, one per device being released, when
> removing a bridge module.
> 
> After applying this patch, bridge modules can at last be removed
> without any apparent hiccup.
> 
> [Note: tested only on the tsi148, it's the only bridge I've got]
> 

I guess this is an artifact of the current lack of refcounting?

This is definitely an issue, however I don't think masking it by adding
an empty function is the correct way to go.

Martyn

> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  drivers/staging/vme/vme.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index afd2dbd..59650dd 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
> @@ -1352,6 +1352,11 @@ static void vme_free_bus_num(int bus)
>  	mutex_unlock(&vme_bus_num_mtx);
>  }
>  
> +/* Note: device_release(dev) throws a warning if dev->release isn't filled in */
> +static void vme_dev_release(struct device *dev)
> +{
> +}
> +
>  int vme_register_bridge(struct vme_bridge *bridge)
>  {
>  	struct device *dev;
> @@ -1372,6 +1377,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  
>  		dev->parent = bridge->parent;
>  		dev->bus = &vme_bus_type;
> +		dev->release = vme_dev_release;
>  		/*
>  		 * We save a pointer to the bridge in platform_data so that we
>  		 * can get to it later. We keep driver_data for use by the


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 10/30] staging/vme/tsi148: remove unreachable line
  2010-10-26  1:10 ` [PATCH 10/30] staging/vme/tsi148: remove unreachable line Emilio G. Cota
@ 2010-10-27 11:06   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 11:06 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index 5bb999f..c08927e 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -2480,7 +2480,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	return 0;
>  
> -	vme_unregister_bridge(tsi148_bridge);
>  err_reg:
>  	tsi148_crcsr_exit(tsi148_bridge, pdev);
>  err_crcsr:


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 11/30] staging/vme/tsi148: declare static functions as such
  2010-10-26  1:10 ` [PATCH 11/30] staging/vme/tsi148: declare static functions as such Emilio G. Cota
@ 2010-10-27 11:23   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 11:23 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.c |   38 +++++++++++++++---------------
>  1 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
> index c08927e..3ef5f48 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.c
> +++ b/drivers/staging/vme/bridges/vme_tsi148.c
> @@ -392,7 +392,7 @@ static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge, struct pci_dev *pd
>  /*
>   * Check to see if an IACk has been received, return true (1) or false (0).
>   */
> -int tsi148_iack_received(struct tsi148_driver *bridge)
> +static int tsi148_iack_received(struct tsi148_driver *bridge)
>  {
>  	u32 tmp;
>  
> @@ -407,7 +407,7 @@ int tsi148_iack_received(struct tsi148_driver *bridge)
>  /*
>   * Configure VME interrupt
>   */
> -void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
> +static void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
>  	int state, int sync)
>  {
>  	struct pci_dev *pdev;
> @@ -447,7 +447,7 @@ void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
>   * Generate a VME bus interrupt at the requested level & vector. Wait for
>   * interrupt to be acked.
>   */
> -int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
> +static int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
>  {
>  	u32 tmp;
>  	struct tsi148_driver *bridge;
> @@ -547,7 +547,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
>  /*
>   * Initialize a slave window with the requested attributes.
>   */
> -int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
> +static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
>  	unsigned long long vme_base, unsigned long long size,
>  	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
>  {
> @@ -697,7 +697,7 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
>  /*
>   * Get slave window configuration.
>   */
> -int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
> +static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
>  {
> @@ -893,7 +893,7 @@ static void tsi148_free_resource(struct vme_master_resource *image)
>  /*
>   * Set the attributes of an outbound window.
>   */
> -int tsi148_master_set(struct vme_master_resource *image, int enabled,
> +static int tsi148_master_set(struct vme_master_resource *image, int enabled,
>  	unsigned long long vme_base, unsigned long long size,
>  	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
>  {
> @@ -1129,7 +1129,7 @@ err_window:
>   *
>   * XXX Not parsing prefetch information.
>   */
> -int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
> +static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
>  {
> @@ -1239,7 +1239,7 @@ int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
>  }
>  
>  
> -int tsi148_master_get(struct vme_master_resource *image, int *enabled,
> +static int tsi148_master_get(struct vme_master_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
>  {
> @@ -1255,7 +1255,7 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
>  	return retval;
>  }
>  
> -ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
> +static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
>  	size_t count, loff_t offset)
>  {
>  	int retval, enabled;
> @@ -1297,7 +1297,7 @@ skip_chk:
>  }
>  
>  
> -ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
> +static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
>  	size_t count, loff_t offset)
>  {
>  	int retval = 0, enabled;
> @@ -1364,7 +1364,7 @@ skip_chk:
>   *
>   * Requires a previously configured master window, returns final value.
>   */
> -unsigned int tsi148_master_rmw(struct vme_master_resource *image,
> +static unsigned int tsi148_master_rmw(struct vme_master_resource *image,
>  	unsigned int mask, unsigned int compare, unsigned int swap,
>  	loff_t offset)
>  {
> @@ -1611,7 +1611,7 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, u32 *attr,
>  /*
>   * Add a link list descriptor to the list
>   */
> -int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
> +static int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	struct vme_dma_attr *dest, size_t count)
>  {
>  	struct tsi148_dma_entry *entry, *prev;
> @@ -1784,7 +1784,7 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
>   *
>   * XXX Need to provide control register configuration.
>   */
> -int tsi148_dma_list_exec(struct vme_dma_list *list)
> +static int tsi148_dma_list_exec(struct vme_dma_list *list)
>  {
>  	struct vme_dma_resource *ctrlr;
>  	int channel, retval = 0;
> @@ -1864,7 +1864,7 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
>   *
>   * We have a separate function, don't assume that the chain can't be reused.
>   */
> -int tsi148_dma_list_empty(struct vme_dma_list *list)
> +static int tsi148_dma_list_empty(struct vme_dma_list *list)
>  {
>  	struct list_head *pos, *temp;
>  	struct tsi148_dma_entry *entry;
> @@ -1886,7 +1886,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
>   * This does not enable the LM monitor - that should be done when the first
>   * callback is attached and disabled when the last callback is removed.
>   */
> -int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
> +static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  	vme_address_t aspace, vme_cycle_t cycle)
>  {
>  	u32 lm_base_high, lm_base_low, lm_ctl = 0;
> @@ -1953,7 +1953,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  /* Get configuration of the callback monitor and return whether it is enabled
>   * or disabled.
>   */
> -int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
> +static int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  	vme_address_t *aspace, vme_cycle_t *cycle)
>  {
>  	u32 lm_base_high, lm_base_low, lm_ctl, enabled = 0;
> @@ -2004,7 +2004,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>   *
>   * Callback will be passed the monitor triggered.
>   */
> -int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
> +static int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
>  	void (*callback)(int))
>  {
>  	u32 lm_ctl, tmp;
> @@ -2059,7 +2059,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
>  /*
>   * Detach a callback function forn a specific location monitor.
>   */
> -int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
> +static int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
>  {
>  	u32 lm_en, tmp;
>  	struct tsi148_driver *bridge;
> @@ -2099,7 +2099,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
>  /*
>   * Determine Geographical Addressing
>   */
> -int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
> +static int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
>  {
>  	u32 slot = 0;
>  	struct tsi148_driver *bridge;


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 12/30] staging/vme/ca91cx42: declare static functions as such
  2010-10-26  1:10 ` [PATCH 12/30] staging/vme/ca91cx42: " Emilio G. Cota
@ 2010-10-27 11:24   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 11:24 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_ca91cx42.c |   38 ++++++++++++++--------------
>  1 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
> index 14e10a6..6dd895f 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
> @@ -259,7 +259,7 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
>  /*
>   * Set up an VME interrupt
>   */
> -void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
> +static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
>  	int sync)
>  
>  {
> @@ -287,7 +287,7 @@ void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
>  	}
>  }
>  
> -int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
> +static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
>  	int statid)
>  {
>  	u32 tmp;
> @@ -323,7 +323,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
>  	return 0;
>  }
>  
> -int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
> +static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
>  	unsigned long long vme_base, unsigned long long size,
>  	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
>  {
> @@ -429,7 +429,7 @@ int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
>  	return 0;
>  }
>  
> -int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
> +static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
>  {
> @@ -584,7 +584,7 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
>  }
>  
>  
> -int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
> +static int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
>  	unsigned long long vme_base, unsigned long long size,
>  	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
>  {
> @@ -741,7 +741,7 @@ err_window:
>  	return retval;
>  }
>  
> -int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
> +static int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
>  {
> @@ -828,7 +828,7 @@ int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
>  	return 0;
>  }
>  
> -int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
> +static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
>  	unsigned long long *vme_base, unsigned long long *size,
>  	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
>  {
> @@ -844,7 +844,7 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
>  	return retval;
>  }
>  
> -ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
> +static ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
>  	size_t count, loff_t offset)
>  {
>  	ssize_t retval;
> @@ -904,7 +904,7 @@ out:
>  	return retval;
>  }
>  
> -ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
> +static ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
>  	size_t count, loff_t offset)
>  {
>  	ssize_t retval;
> @@ -959,7 +959,7 @@ out:
>  	return retval;
>  }
>  
> -unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
> +static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
>  	unsigned int mask, unsigned int compare, unsigned int swap,
>  	loff_t offset)
>  {
> @@ -1015,7 +1015,7 @@ out:
>  	return result;
>  }
>  
> -int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
> +static int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
>  	struct vme_dma_attr *dest, size_t count)
>  {
>  	struct ca91cx42_dma_entry *entry, *prev;
> @@ -1176,7 +1176,7 @@ static int ca91cx42_dma_busy(struct vme_bridge *ca91cx42_bridge)
>  		return 1;
>  }
>  
> -int ca91cx42_dma_list_exec(struct vme_dma_list *list)
> +static int ca91cx42_dma_list_exec(struct vme_dma_list *list)
>  {
>  	struct vme_dma_resource *ctrlr;
>  	struct ca91cx42_dma_entry *entry;
> @@ -1258,7 +1258,7 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
>  
>  }
>  
> -int ca91cx42_dma_list_empty(struct vme_dma_list *list)
> +static int ca91cx42_dma_list_empty(struct vme_dma_list *list)
>  {
>  	struct list_head *pos, *temp;
>  	struct ca91cx42_dma_entry *entry;
> @@ -1280,7 +1280,7 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
>   * This does not enable the LM monitor - that should be done when the first
>   * callback is attached and disabled when the last callback is removed.
>   */
> -int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
> +static int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  	vme_address_t aspace, vme_cycle_t cycle)
>  {
>  	u32 temp_base, lm_ctl = 0;
> @@ -1348,7 +1348,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
>  /* Get configuration of the callback monitor and return whether it is enabled
>   * or disabled.
>   */
> -int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
> +static int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>  	vme_address_t *aspace, vme_cycle_t *cycle)
>  {
>  	u32 lm_ctl, enabled = 0;
> @@ -1391,7 +1391,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
>   *
>   * Callback will be passed the monitor triggered.
>   */
> -int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
> +static int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
>  	void (*callback)(int))
>  {
>  	u32 lm_ctl, tmp;
> @@ -1440,7 +1440,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
>  /*
>   * Detach a callback function forn a specific location monitor.
>   */
> -int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
> +static int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
>  {
>  	u32 tmp;
>  	struct ca91cx42_driver *bridge;
> @@ -1473,7 +1473,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
>  	return 0;
>  }
>  
> -int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
> +static int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
>  {
>  	u32 slot = 0;
>  	struct ca91cx42_driver *bridge;
> @@ -1833,7 +1833,7 @@ err_struct:
>  
>  }
>  
> -void ca91cx42_remove(struct pci_dev *pdev)
> +static void ca91cx42_remove(struct pci_dev *pdev)
>  {
>  	struct list_head *pos = NULL;
>  	struct vme_master_resource *master_image;


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 13/30] staging/vme_user: declare private variables as static
  2010-10-26  1:10 ` [PATCH 13/30] staging/vme_user: declare private variables as static Emilio G. Cota
@ 2010-10-27 11:29   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 11:29 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:10, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index bdc4e1e..31a74e2 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -114,9 +114,9 @@ typedef struct {
>  } driver_stats_t;
>  static driver_stats_t statistics;
>  
> -struct cdev *vme_user_cdev;		/* Character device */
> -struct class *vme_user_sysfs_class;	/* Sysfs class */
> -struct device *vme_user_bridge;		/* Pointer to the bridge device */
> +static struct cdev *vme_user_cdev;		/* Character device */
> +static struct class *vme_user_sysfs_class;	/* Sysfs class */
> +static struct device *vme_user_bridge;		/* Pointer to the bridge device */
>  
>  
>  static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams
  2010-10-26  1:11 ` [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams Emilio G. Cota
@ 2010-10-27 11:29   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 11:29 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> unsigned int is what struct kparam_array internally uses.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index 31a74e2..e7669a4 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -44,7 +44,7 @@ static DEFINE_MUTEX(vme_user_mutex);
>  static char driver_name[] = "vme_user";
>  
>  static int bus[USER_BUS_MAX];
> -static int bus_num;
> +static unsigned int bus_num;
>  
>  /* Currently Documentation/devices.txt defines the following for VME:
>   *


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates
  2010-10-26  1:11 ` [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates Emilio G. Cota
@ 2010-10-27 12:20   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:20 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> kern_buf is not iomem; it comes from kmalloc and is directly
> dereferenced.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index e7669a4..ead30d2 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -92,7 +92,7 @@ static unsigned int bus_num;
>   * Structure to handle image related parameters.
>   */
>  typedef struct {
> -	void __iomem *kern_buf;	/* Buffer address in kernel space */
> +	void *kern_buf;	/* Buffer address in kernel space */
>  	dma_addr_t pci_buf;	/* Buffer address in PCI address space */
>  	unsigned long long size_buf;	/* Buffer size */
>  	struct semaphore sem;	/* Semaphore for locking image */
> @@ -277,7 +277,7 @@ static ssize_t resource_from_user(unsigned int minor, const char *buf,
>  static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
>  	size_t count, loff_t *ppos)
>  {
> -	void __iomem *image_ptr;
> +	void *image_ptr;
>  	ssize_t retval;
>  
>  	image_ptr = image[minor].kern_buf + *ppos;
> @@ -296,7 +296,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
>  static ssize_t buffer_from_user(unsigned int minor, const char *buf,
>  	size_t count, loff_t *ppos)
>  {
> -	void __iomem *image_ptr;
> +	void *image_ptr;
>  	size_t retval;
>  
>  	image_ptr = image[minor].kern_buf + *ppos;


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 16/30] staging/vme_user: mark user-space buffers with __user
  2010-10-26  1:11 ` [PATCH 16/30] staging/vme_user: mark user-space buffers with __user Emilio G. Cota
@ 2010-10-27 12:20   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:20 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/devices/vme_user.c |   25 +++++++++++--------------
>  1 files changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index ead30d2..a7b97be 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -129,8 +129,8 @@ static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,
>  
>  static int vme_user_open(struct inode *, struct file *);
>  static int vme_user_release(struct inode *, struct file *);
> -static ssize_t vme_user_read(struct file *, char *, size_t, loff_t *);
> -static ssize_t vme_user_write(struct file *, const char *, size_t, loff_t *);
> +static ssize_t vme_user_read(struct file *, char __user *, size_t, loff_t *);
> +static ssize_t vme_user_write(struct file *, const char __user *, size_t, loff_t *);
>  static loff_t vme_user_llseek(struct file *, loff_t, int);
>  static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
>  
> @@ -246,7 +246,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count,
>   * page) transfers will lock the user space buffer into memory and then
>   * transfer the data directly from the user space buffers out to VME.
>   */
> -static ssize_t resource_from_user(unsigned int minor, const char *buf,
> +static ssize_t resource_from_user(unsigned int minor, const char __user *buf,
>  	size_t count, loff_t *ppos)
>  {
>  	ssize_t retval;
> @@ -293,7 +293,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
>  	return retval;
>  }
>  
> -static ssize_t buffer_from_user(unsigned int minor, const char *buf,
> +static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
>  	size_t count, loff_t *ppos)
>  {
>  	void *image_ptr;
> @@ -312,7 +312,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char *buf,
>  	return retval;
>  }
>  
> -static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
> +static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
>  			loff_t *ppos)
>  {
>  	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
> @@ -356,7 +356,7 @@ static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
>  	return retval;
>  }
>  
> -static ssize_t vme_user_write(struct file *file, const char *buf, size_t count,
> +static ssize_t vme_user_write(struct file *file, const char __user *buf, size_t count,
>  			 loff_t *ppos)
>  {
>  	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
> @@ -455,6 +455,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  	unsigned int minor = MINOR(inode->i_rdev);
>  	int retval;
>  	dma_addr_t pci_addr;
> +	void __user *argp = (void __user *)arg;
>  
>  	statistics.ioctls++;
>  
> @@ -474,8 +475,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  				&master.size, &master.aspace,
>  				&master.cycle, &master.dwidth);
>  
> -			copied = copy_to_user((char *)arg, &master,
> -				sizeof(struct vme_master));
> +			copied = copy_to_user(argp, &master, sizeof(struct vme_master));
>  			if (copied != 0) {
>  				printk(KERN_WARNING "Partial copy to "
>  					"userspace\n");
> @@ -487,8 +487,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  
>  		case VME_SET_MASTER:
>  
> -			copied = copy_from_user(&master, (char *)arg,
> -				sizeof(master));
> +			copied = copy_from_user(&master, argp, sizeof(master));
>  			if (copied != 0) {
>  				printk(KERN_WARNING "Partial copy from "
>  					"userspace\n");
> @@ -518,8 +517,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  				&slave.size, &pci_addr, &slave.aspace,
>  				&slave.cycle);
>  
> -			copied = copy_to_user((char *)arg, &slave,
> -				sizeof(struct vme_slave));
> +			copied = copy_to_user(argp, &slave, sizeof(struct vme_slave));
>  			if (copied != 0) {
>  				printk(KERN_WARNING "Partial copy to "
>  					"userspace\n");
> @@ -531,8 +529,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
>  
>  		case VME_SET_SLAVE:
>  
> -			copied = copy_from_user(&slave, (char *)arg,
> -				sizeof(slave));
> +			copied = copy_from_user(&slave, argp, sizeof(slave));
>  			if (copied != 0) {
>  				printk(KERN_WARNING "Partial copy from "
>  					"userspace\n");


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem
  2010-10-26  1:11 ` [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Emilio G. Cota
@ 2010-10-27 12:20   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:20 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/vme_bridge.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/vme_bridge.h b/drivers/staging/vme/vme_bridge.h
> index b653ec0..4c6ec31 100644
> --- a/drivers/staging/vme/vme_bridge.h
> +++ b/drivers/staging/vme/vme_bridge.h
> @@ -20,7 +20,7 @@ struct vme_master_resource {
>  	vme_cycle_t cycle_attr;
>  	vme_width_t width_attr;
>  	struct resource bus_resource;
> -	void *kern_base;
> +	void __iomem *kern_base;
>  };
>  
>  struct vme_slave_resource {


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 18/30] staging/vme/tsi148: mark the registers' base address pointer as __iomem
  2010-10-26  1:11 ` [PATCH 18/30] staging/vme/tsi148: mark the registers' " Emilio G. Cota
@ 2010-10-27 12:20   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:20 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_tsi148.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_tsi148.h b/drivers/staging/vme/bridges/vme_tsi148.h
> index bda64ef..9f97fa8 100644
> --- a/drivers/staging/vme/bridges/vme_tsi148.h
> +++ b/drivers/staging/vme/bridges/vme_tsi148.h
> @@ -35,7 +35,7 @@
>  
>  /* Structure used to hold driver specific information */
>  struct tsi148_driver {
> -	void *base;	/* Base Address of device registers */
> +	void __iomem *base;	/* Base Address of device registers */
>  	wait_queue_head_t dma_queue[2];
>  	wait_queue_head_t iack_queue;
>  	void (*lm_callback[4])(int);	/* Called in interrupt handler */


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 19/30] staging/vme/ca91cx42: mark the registers' base address pointer as __iomem
  2010-10-26  1:11 ` [PATCH 19/30] staging/vme/ca91cx42: " Emilio G. Cota
@ 2010-10-27 12:20   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:20 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Acked-by: Martyn Welch <martyn.welch@ge.com>

> ---
>  drivers/staging/vme/bridges/vme_ca91cx42.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.h b/drivers/staging/vme/bridges/vme_ca91cx42.h
> index e72c65b..02a7c79 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.h
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.h
> @@ -39,7 +39,7 @@
>  
>  /* Structure used to hold driver specific information */
>  struct ca91cx42_driver {
> -	void *base;	/* Base Address of device registers */
> +	void __iomem *base;	/* Base Address of device registers */
>  	wait_queue_head_t dma_queue;
>  	wait_queue_head_t iack_queue;
>  	wait_queue_head_t mbox_queue;


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set
  2010-10-26  1:11 ` [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set Emilio G. Cota
@ 2010-10-27 12:24   ` Martyn Welch
  2010-10-27 14:59     ` Emilio G. Cota
  0 siblings, 1 reply; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 12:24 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 26/10/10 02:11, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> The resource is about to be freed and therefore it is pointless to
> set any of its parameters.

Nope - this is disabling the window, which given that you are about to
unalloc the memory that it is using this is quite important.

Martyn

> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  drivers/staging/vme/devices/vme_user.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index 95c22ff..a1cb85b 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -851,7 +851,6 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus, int cur_sl
>  		kfree(image[i].kern_buf);
>  
>  	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
> -		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
>  		buf_unalloc(i);
>  		vme_slave_free(image[i].resource);
>  	}


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-27 10:54   ` Martyn Welch
@ 2010-10-27 14:46     ` Emilio G. Cota
  2010-10-27 15:03       ` Martyn Welch
  2010-10-28  1:17       ` Greg KH
  0 siblings, 2 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-27 14:46 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 11:54:55 +0100, Martyn Welch wrote:
> On 26/10/10 02:10, Emilio G. Cota wrote:
> > From: Emilio G. Cota <cota@braap.org>
> > 
> > Without it we get 32 warnings, one per device being released, when
> > removing a bridge module.
> > 
> > After applying this patch, bridge modules can at last be removed
> > without any apparent hiccup.
> > 
> > [Note: tested only on the tsi148, it's the only bridge I've got]
> > 
> 
> I guess this is an artifact of the current lack of refcounting?

No, that's orthogonal to this. This has to do with the way the
devices are allocated.

> This is definitely an issue, however I don't think masking it by adding
> an empty function is the correct way to go.

We're not masking anything. The release method is there to free the
struct it protects when its refcount goes to zero; however, in this
case the struct wasn't allocated dynamically--the 32 devices are
stored in struct vme_bridge in an array--and therefore there's
nothing to do in .release, since struct vme_bridge is freed
elsewhere.

While it's true that empty .release methods are usually frowned
upon (as stated in Documentation/kobject.txt), due to the way
things are done here it actually makes sense to have an
empty .release.

Hope this helps

		Emilio



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

* Re: [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set
  2010-10-27 12:24   ` Martyn Welch
@ 2010-10-27 14:59     ` Emilio G. Cota
  0 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-27 14:59 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 13:24:55 +0100, Martyn Welch wrote:
> On 26/10/10 02:11, Emilio G. Cota wrote:
> > From: Emilio G. Cota <cota@braap.org>
> > 
> > The resource is about to be freed and therefore it is pointless to
> > set any of its parameters.
> 
> Nope - this is disabling the window, which given that you are about to
> unalloc the memory that it is using this is quite important.

Aah I didn't realise that 

> > -		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);

disables the window. I thought vme_slave_free would disable it as well.
Forget this one, then.

Thanks

		Emilio


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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-27 14:46     ` Emilio G. Cota
@ 2010-10-27 15:03       ` Martyn Welch
  2010-10-27 15:15         ` Emilio G. Cota
  2010-10-28  1:17       ` Greg KH
  1 sibling, 1 reply; 91+ messages in thread
From: Martyn Welch @ 2010-10-27 15:03 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 27/10/10 15:46, Emilio G. Cota wrote:
> On Wed, Oct 27, 2010 at 11:54:55 +0100, Martyn Welch wrote:
>> On 26/10/10 02:10, Emilio G. Cota wrote:
>>> From: Emilio G. Cota <cota@braap.org>
>>>
>>> Without it we get 32 warnings, one per device being released, when
>>> removing a bridge module.
>>>
>>> After applying this patch, bridge modules can at last be removed
>>> without any apparent hiccup.
>>>
>>> [Note: tested only on the tsi148, it's the only bridge I've got]
>>>
>>
>> I guess this is an artifact of the current lack of refcounting?
> 
> No, that's orthogonal to this. This has to do with the way the
> devices are allocated.
> 
>> This is definitely an issue, however I don't think masking it by adding
>> an empty function is the correct way to go.
> 
> We're not masking anything. The release method is there to free the
> struct it protects when its refcount goes to zero; however, in this
> case the struct wasn't allocated dynamically--the 32 devices are
> stored in struct vme_bridge in an array--and therefore there's
> nothing to do in .release, since struct vme_bridge is freed
> elsewhere.
> 
> While it's true that empty .release methods are usually frowned
> upon (as stated in Documentation/kobject.txt), due to the way
> things are done here it actually makes sense to have an
> empty .release.

Ok, I'm not going to ack this for now as I'd like to discuss
modifications to the approach that is being taken for binding devices
and this patch seems to fall under the scope of this.

Martyn

-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers
  2010-10-27  9:41   ` Martyn Welch
@ 2010-10-27 15:13     ` Emilio G. Cota
  2010-11-04  3:40       ` Emilio G. Cota
  0 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-27 15:13 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 10:41:18 +0100, Martyn Welch wrote:
> On 26/10/10 02:10, Emilio G. Cota wrote:
> > From: Emilio G. Cota <cota@braap.org>
> > 
> > In a configuration with several bridges, each bridge is
> > assigned a certain bus number depending on the order in which
> > vme_register_bridge is called. This can complicate multi-bridge
> > installations because the eventual bus numbers will depend
> > on the order the bridges were loaded.
> > 
> > The appended allows bridges to register with a bus number of
> > their choice, while keeping the previous 'first come, first
> > served' behaviour as the default.
> > 
> 
> I can't see where this is being used.

Each driver's .probe is fed with bus_number and slot_number.
Normally the driver will check that pair against what it received
through modparams and act accordingly.

For this to be reliable bus numbering should be consistent on
a given system, i.e. it should be possible to always allocate
the same bus number to a given bus. Otherwise, depending on
which bridge is installed first, we'd get different bus numbers
assigned.

Does that make it clearer now?

> I assume this is a part of future changes you wish to make?

AFAICT it affects the current model.

Cheers

		Emilio


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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-27 15:03       ` Martyn Welch
@ 2010-10-27 15:15         ` Emilio G. Cota
  0 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-27 15:15 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 16:03:04 +0100, Martyn Welch wrote:
> Ok, I'm not going to ack this for now as I'd like to discuss
> modifications to the approach that is being taken for binding devices
> and this patch seems to fall under the scope of this.

No problem, just bear in mind that without this patch, the current
code throws a warning when removing drivers and bridges.

		Emilio


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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-27 14:46     ` Emilio G. Cota
  2010-10-27 15:03       ` Martyn Welch
@ 2010-10-28  1:17       ` Greg KH
  2010-10-28  6:07         ` Emilio G. Cota
  1 sibling, 1 reply; 91+ messages in thread
From: Greg KH @ 2010-10-28  1:17 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Martyn Welch, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 10:46:42AM -0400, Emilio G. Cota wrote:
> On Wed, Oct 27, 2010 at 11:54:55 +0100, Martyn Welch wrote:
> > On 26/10/10 02:10, Emilio G. Cota wrote:
> > > From: Emilio G. Cota <cota@braap.org>
> > > 
> > > Without it we get 32 warnings, one per device being released, when
> > > removing a bridge module.
> > > 
> > > After applying this patch, bridge modules can at last be removed
> > > without any apparent hiccup.
> > > 
> > > [Note: tested only on the tsi148, it's the only bridge I've got]
> > > 
> > 
> > I guess this is an artifact of the current lack of refcounting?
> 
> No, that's orthogonal to this. This has to do with the way the
> devices are allocated.
> 
> > This is definitely an issue, however I don't think masking it by adding
> > an empty function is the correct way to go.
> 
> We're not masking anything. The release method is there to free the
> struct it protects when its refcount goes to zero; however, in this
> case the struct wasn't allocated dynamically--the 32 devices are
> stored in struct vme_bridge in an array--and therefore there's
> nothing to do in .release, since struct vme_bridge is freed
> elsewhere.
> 
> While it's true that empty .release methods are usually frowned
> upon (as stated in Documentation/kobject.txt), due to the way
> things are done here it actually makes sense to have an
> empty .release.

FROWNED APON?

Heh, if you add one, as per the documentation there, I get to publicly
ridicule you for doing so.

So consider this your ridicule, if you ever are thinking you need to
create an empty release function, YOUR CODE IS WRONG!

Seriously, do you think I just add warnings in there for fun?  So that
you can work around them thinking you know better?

{sigh}

Your implementation is broken, never do this, if you create a kobject,
you HAVE TO FREE IT in the release function.

I would ask why you are even using a kobject in the first place (hint,
if you are writing a driver, or even a subsystem, you shouldn't be, use
'struct device' instead.)

So consider this a rejection of this patch and implementation :)

thanks,

greg k-h

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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-28  1:17       ` Greg KH
@ 2010-10-28  6:07         ` Emilio G. Cota
  2010-10-28 17:56           ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-28  6:07 UTC (permalink / raw)
  To: Greg KH
  Cc: Martyn Welch, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 18:17:11 -0700, Greg KH wrote:
> On Wed, Oct 27, 2010 at 10:46:42AM -0400, Emilio G. Cota wrote:
> > On Wed, Oct 27, 2010 at 11:54:55 +0100, Martyn Welch wrote:
> > > I guess this is an artifact of the current lack of refcounting?
> > 
> > No, that's orthogonal to this. This has to do with the way the
> > devices are allocated.
> > 
> > > This is definitely an issue, however I don't think masking it by adding
> > > an empty function is the correct way to go.
> > 
> > We're not masking anything. The release method is there to free the
> > struct it protects when its refcount goes to zero; however, in this
> > case the struct wasn't allocated dynamically--the 32 devices are
> > stored in struct vme_bridge in an array--and therefore there's
> > nothing to do in .release, since struct vme_bridge is freed
> > elsewhere.
> > 
> > While it's true that empty .release methods are usually frowned
> > upon (as stated in Documentation/kobject.txt), due to the way
> > things are done here it actually makes sense to have an
> > empty .release.
> 
> FROWNED APON?
> 
> Heh, if you add one, as per the documentation there, I get to publicly
> ridicule you for doing so.
> 
> So consider this your ridicule, if you ever are thinking you need to
> create an empty release function, YOUR CODE IS WRONG!
> 
> Seriously, do you think I just add warnings in there for fun?  So that
> you can work around them thinking you know better?
> 
> {sigh}
> 
> Your implementation is broken, never do this, if you create a kobject,
> you HAVE TO FREE IT in the release function.
> 
> I would ask why you are even using a kobject in the first place (hint,
> if you are writing a driver, or even a subsystem, you shouldn't be, use
> 'struct device' instead.)


kobject?

We were talking about a struct device's .release, not about a struct
kobject's .release.

The warning comes from the kobject embedded in struct device, not
from a kobject per se. In fact, let me make it clearer:

		NO KOBJECT IS DIRECTLY OPERATED ON.

proof:
$ find staging/vme -name '*.[ch]' | xargs grep -F 'kobj'
brings no results.



In the current implementation, there's no need to do anything(*) in
struct device's .release, because struct device is, as I said
in my message, freed somewhere else.

(*) Of course this is a bug, but it's a known bug, see below.

All struct device's are freed when struct vme_bridge is freed, and
before that happens, device_unregister() is called for each of the
devices:

@@ void vme_unregister_bridge(struct vme_bridge *bridge)
...
        for (i = 0; i < VME_SLOTS_MAX; i++) {
                dev = &bridge->dev[i];
                device_unregister(dev);
        }

device_unregister(), as you know, calls device_free() which
then calls kobj_del(), deleting the kobject embedded in struct
device. This call to kobj_del() from device_free() is the one
that throws the warning.

> So consider this a rejection of this patch and implementation :)

I don't like the implementation either, and that's why I sent
another patch that fixes this and some other problems--
see patch 27.

Fact: Anything other than freeing struct device in .release is
a bug. So the warning is very well placed there, no question
about it.
Example: when a VME bridge is removed, then all devices are
mercilessly freed, even if their refcounts aren't 0 because
drivers are controlling them. This is a BUG, and both Martin
and I knew it.

Fact: Right now VME drivers MUST be removed before VME
bridges are removed. We all agree on that this is broken--
bridges shouldn't be allowed to be removed if there are
drivers controlling any of their devices. Patch 27
addresses this among other things.

Why did I sent this patch? With it and with some other patches
I wanted to point out some flaws of the current implementation.
However after your email I think sending patch 27 directly
would have been a wiser option--although now we all probably
understand the code a little bit better.

So please let's focus on the important stuff, which is patch
27.

		Emilio, Ridiculous In Chief


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

* Re: [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-28  6:07         ` Emilio G. Cota
@ 2010-10-28 17:56           ` Greg KH
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2010-10-28 17:56 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Martyn Welch, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Thu, Oct 28, 2010 at 02:07:10AM -0400, Emilio G. Cota wrote:
> On Wed, Oct 27, 2010 at 18:17:11 -0700, Greg KH wrote:
> > On Wed, Oct 27, 2010 at 10:46:42AM -0400, Emilio G. Cota wrote:
> > > On Wed, Oct 27, 2010 at 11:54:55 +0100, Martyn Welch wrote:
> > > > I guess this is an artifact of the current lack of refcounting?
> > > 
> > > No, that's orthogonal to this. This has to do with the way the
> > > devices are allocated.
> > > 
> > > > This is definitely an issue, however I don't think masking it by adding
> > > > an empty function is the correct way to go.
> > > 
> > > We're not masking anything. The release method is there to free the
> > > struct it protects when its refcount goes to zero; however, in this
> > > case the struct wasn't allocated dynamically--the 32 devices are
> > > stored in struct vme_bridge in an array--and therefore there's
> > > nothing to do in .release, since struct vme_bridge is freed
> > > elsewhere.
> > > 
> > > While it's true that empty .release methods are usually frowned
> > > upon (as stated in Documentation/kobject.txt), due to the way
> > > things are done here it actually makes sense to have an
> > > empty .release.
> > 
> > FROWNED APON?
> > 
> > Heh, if you add one, as per the documentation there, I get to publicly
> > ridicule you for doing so.
> > 
> > So consider this your ridicule, if you ever are thinking you need to
> > create an empty release function, YOUR CODE IS WRONG!
> > 
> > Seriously, do you think I just add warnings in there for fun?  So that
> > you can work around them thinking you know better?
> > 
> > {sigh}
> > 
> > Your implementation is broken, never do this, if you create a kobject,
> > you HAVE TO FREE IT in the release function.
> > 
> > I would ask why you are even using a kobject in the first place (hint,
> > if you are writing a driver, or even a subsystem, you shouldn't be, use
> > 'struct device' instead.)
> 
> 
> kobject?
> 
> We were talking about a struct device's .release, not about a struct
> kobject's .release.
> 
> The warning comes from the kobject embedded in struct device, not
> from a kobject per se. In fact, let me make it clearer:
> 
> 		NO KOBJECT IS DIRECTLY OPERATED ON.

Ok, thanks, I wasn't paying attention.

Empty device release functions are also incorrect and shouldn't even be
part of a patch series.

> Fact: Anything other than freeing struct device in .release is
> a bug. So the warning is very well placed there, no question
> about it.

Agreed.

> Example: when a VME bridge is removed, then all devices are
> mercilessly freed, even if their refcounts aren't 0 because
> drivers are controlling them. This is a BUG, and both Martin
> and I knew it.

Ok, then patches are gladly accepted to fix it.

> Fact: Right now VME drivers MUST be removed before VME
> bridges are removed. We all agree on that this is broken--

Yup, it's broken, please don't require that.

> bridges shouldn't be allowed to be removed if there are
> drivers controlling any of their devices. Patch 27
> addresses this among other things.

Not true, a bridge should be able to be removed, just that the devices
will then be deleted as well.  See USB bus drivers for examples of how
to do this properly.

thanks,

greg k-h

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

* Re: [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers
  2010-10-27 15:13     ` Emilio G. Cota
@ 2010-11-04  3:40       ` Emilio G. Cota
  2010-11-05 16:29         ` Martyn Welch
  0 siblings, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-11-04  3:40 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Wed, Oct 27, 2010 at 11:13:27 -0400, Emilio G. Cota wrote:
> On Wed, Oct 27, 2010 at 10:41:18 +0100, Martyn Welch wrote:
> > On 26/10/10 02:10, Emilio G. Cota wrote:
> > > From: Emilio G. Cota <cota@braap.org>
> > > 
> > > In a configuration with several bridges, each bridge is
> > > assigned a certain bus number depending on the order in which
> > > vme_register_bridge is called. This can complicate multi-bridge
> > > installations because the eventual bus numbers will depend
> > > on the order the bridges were loaded.
> > > 
> > > The appended allows bridges to register with a bus number of
> > > their choice, while keeping the previous 'first come, first
> > > served' behaviour as the default.
> > > 
> > 
> > I can't see where this is being used.
> 
> Each driver's .probe is fed with bus_number and slot_number.
> Normally the driver will check that pair against what it received
> through modparams and act accordingly.
> 
> For this to be reliable bus numbering should be consistent on
> a given system, i.e. it should be possible to always allocate
> the same bus number to a given bus. Otherwise, depending on
> which bridge is installed first, we'd get different bus numbers
> assigned.
> 
> Does that make it clearer now?
> 
> > I assume this is a part of future changes you wish to make?
> 
> AFAICT it affects the current model.

Martyn,

Have you had time to re-check this one?

Thanks

		Emilio


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

* Re: [PATCH 27/30] staging/vme: rework the bus model
  2010-10-26  1:11 ` [PATCH 27/30] staging/vme: rework the bus model Emilio G. Cota
@ 2010-11-04  4:16   ` Emilio G. Cota
  0 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-11-04  4:16 UTC (permalink / raw)
  To: Martyn Welch
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

Hi Martyn,

Do you have any further comments on this patch?
I quote below the commit message, inlining some comments since
some messages didn't hit some of the recipients the first time.

On Mon, Oct 25, 2010 at 21:11:13 -0400, Emilio G. Cota wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> The way in which VME devices and drivers are currently bound together
> involves unnecessary contortions. Controlling a device with a VME driver
> requires the following steps, in this order:
(snip)
> There are a few things I dislike about the above:

> * installing drivers even before the bridges they need are present
>   seems counter-intuitive and wrong.

My mistake, this isn't true. As we've discussed already(*), binding
happens both when a device is registered AND when a driver is registered.

(*) http://lkml.org/lkml/2010/10/27/284

> * a VME bus may need more than 32 devices--the relation to the 32 slots on
>   a VME crate is artificial and confusing:
(snip)
Which translates into what I described here:
http://lkml.org/lkml/2010/10/27/284

And I resuscitate from that message the following:

> Imagine the following situation:
> 
> - insmod vme_driver1.ko bus=0,0,0 slot=1,2,3
> 
> Then two days after I want to install another driver:
> 
> - insmod vme_driver2.ko bus=0,0,0 slot=X,Y,Z
> 
> Now X,Y,Z cannot be in (1,2,3), because those are understood
> as physical slots, even if they're not (this is not VME64x)
> 
> So, anytime I need to install a device, I must know the slot
> numbers of all other devices--even though there's no
> physical meaning to it!

In the model I proposed device id's ("slots") are unique
to each driver. This way we can install drivers without
caring whether or not other drivers have overlapping "slot" id's
for their devices.

> * .probe and .remove pass a pointer to a struct device representing a VME
>   bridge, instead of representing the device to be added/removed.
> 	* a bridge's module may be removed anytime and things do fall over;
> 	  there is no refcounting at all and thus all drivers attached to
> 	  the removed bus will oops.

As discussed here no one is happy with the current state of affairs:
http://lkml.org/lkml/2010/10/27/264

Greg suggests that when a bridge is removed, all devices on top of it
should go away. In my opinion that's the most convenient solution.

This patch, however, does not allow a bridge to be removed unless all
its devices are removed first. It's not as nice as what Greg proposes,
but at least it's an improvement over what we've got now--it gets
refcounting right, etc.

After having inspected the USB core code I think it wouldn't be hard
to go from this patch to a situation where a bridge can be removed
anytime without the whole thing falling over. Before tackling that
I'd like to hear your opinion.

Thanks,

		Emilio


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

* Re: [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers
  2010-11-04  3:40       ` Emilio G. Cota
@ 2010-11-05 16:29         ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-05 16:29 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Greg KH, LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On 04/11/10 03:40, Emilio G. Cota wrote:
> On Wed, Oct 27, 2010 at 11:13:27 -0400, Emilio G. Cota wrote:
>> On Wed, Oct 27, 2010 at 10:41:18 +0100, Martyn Welch wrote:
>>> On 26/10/10 02:10, Emilio G. Cota wrote:
>>>> From: Emilio G. Cota <cota@braap.org>
>>>>
>>>> In a configuration with several bridges, each bridge is
>>>> assigned a certain bus number depending on the order in which
>>>> vme_register_bridge is called. This can complicate multi-bridge
>>>> installations because the eventual bus numbers will depend
>>>> on the order the bridges were loaded.
>>>>
>>>> The appended allows bridges to register with a bus number of
>>>> their choice, while keeping the previous 'first come, first
>>>> served' behaviour as the default.
>>>>
>>>
>>> I can't see where this is being used.
>>
>> Each driver's .probe is fed with bus_number and slot_number.
>> Normally the driver will check that pair against what it received
>> through modparams and act accordingly.
>>
>> For this to be reliable bus numbering should be consistent on
>> a given system, i.e. it should be possible to always allocate
>> the same bus number to a given bus. Otherwise, depending on
>> which bridge is installed first, we'd get different bus numbers
>> assigned.
>>
>> Does that make it clearer now?
>>
>>> I assume this is a part of future changes you wish to make?
>>
>> AFAICT it affects the current model.
> 
> Martyn,
> 
> Have you had time to re-check this one?
> 

I'm afraid I haven't - I'm rather tied up at the moment. I'll try and
set aside some time next week to look at the remaining patches you sent.

Martyn


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [re-send][-next] staging/vme: various fixes + new driver model for VME
  2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
                   ` (29 preceding siblings ...)
  2010-10-26  1:11 ` [PATCH 30/30] staging/vme: remove _ng suffixes Emilio G. Cota
@ 2010-11-09 23:12 ` Greg KH
  30 siblings, 0 replies; 91+ messages in thread
From: Greg KH @ 2010-11-09 23:12 UTC (permalink / raw)
  To: Emilio G. Cota, Martyn Welch
  Cc: LKML, devel, Juan David Gonzalez Cobas, Bill Pemberton

On Mon, Oct 25, 2010 at 09:10:46PM -0400, Emilio G. Cota wrote:
> This is a re-send of http://lkml.org/lkml/2010/10/22/77 now with
> all the appropriate Cc's. The discussion should continue here.

Martyn, I got lost as to which ones you want applied, and which you do
not.  Can you please send me the patches in this series that you acked?

thanks,

greg k-h

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

* [PATCH 00/17] Series short description
  2010-10-28 17:56           ` Greg KH
@ 2010-11-12 11:13             ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 01/17] staging/vme: style: convert '&(foo)' to '&foo' Martyn Welch
                                 ` (17 more replies)
  0 siblings, 18 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:13 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

The following series implements...

--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 01/17] staging/vme: style: convert '&(foo)' to '&foo'
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 02/17] staging/vme_user: return the appropriate error code when module_init fails Martyn Welch
                                 ` (16 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

done with
find . -name '*.c' | xargs perl -p -i -e 's/&\(([^()]+)\)/&$1/g'

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_ca91cx42.c |  181 ++++++++++++-------------
 drivers/staging/vme/bridges/vme_tsi148.c   |  204 ++++++++++++++--------------
 drivers/staging/vme/devices/vme_user.c     |   16 +-
 drivers/staging/vme/vme.c                  |  114 ++++++++--------
 4 files changed, 258 insertions(+), 257 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 4d74562..1f2089f 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -58,7 +58,7 @@ static struct pci_driver ca91cx42_driver = {
 
 static u32 ca91cx42_DMA_irqhandler(struct ca91cx42_driver *bridge)
 {
-	wake_up(&(bridge->dma_queue));
+	wake_up(&bridge->dma_queue);
 
 	return CA91CX42_LINT_DMA;
 }
@@ -82,14 +82,14 @@ static u32 ca91cx42_LM_irqhandler(struct ca91cx42_driver *bridge, u32 stat)
 /* XXX This needs to be split into 4 queues */
 static u32 ca91cx42_MB_irqhandler(struct ca91cx42_driver *bridge, int mbox_mask)
 {
-	wake_up(&(bridge->mbox_queue));
+	wake_up(&bridge->mbox_queue);
 
 	return CA91CX42_LINT_MBOX;
 }
 
 static u32 ca91cx42_IACK_irqhandler(struct ca91cx42_driver *bridge)
 {
-	wake_up(&(bridge->iack_queue));
+	wake_up(&bridge->iack_queue);
 
 	return CA91CX42_LINT_SW_IACK;
 }
@@ -207,9 +207,9 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
 	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
 
 	/* Initialise list for VME bus errors */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->vme_errors));
+	INIT_LIST_HEAD(&ca91cx42_bridge->vme_errors);
 
-	mutex_init(&(ca91cx42_bridge->irq_mtx));
+	mutex_init(&ca91cx42_bridge->irq_mtx);
 
 	/* Disable interrupts from PCI to VME */
 	iowrite32(0, bridge->base + VINT_EN);
@@ -299,7 +299,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	if (statid & 1)
 		return -EINVAL;
 
-	mutex_lock(&(bridge->vme_int));
+	mutex_lock(&bridge->vme_int);
 
 	tmp = ioread32(bridge->base + VINT_EN);
 
@@ -318,7 +318,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	tmp = tmp & ~(1 << (level + 24));
 	iowrite32(tmp, bridge->base + VINT_EN);
 
-	mutex_unlock(&(bridge->vme_int));
+	mutex_unlock(&bridge->vme_int);
 
 	return 0;
 }
@@ -518,8 +518,8 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 		image->kern_base = NULL;
 		if (image->bus_resource.name != NULL)
 			kfree(image->bus_resource.name);
-		release_resource(&(image->bus_resource));
-		memset(&(image->bus_resource), 0, sizeof(struct resource));
+		release_resource(&image->bus_resource);
+		memset(&image->bus_resource, 0, sizeof(struct resource));
 	}
 
 	if (image->bus_resource.name == NULL) {
@@ -540,7 +540,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 	image->bus_resource.flags = IORESOURCE_MEM;
 
 	retval = pci_bus_alloc_resource(pdev->bus,
-		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
+		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
 		0, NULL, NULL);
 	if (retval) {
 		dev_err(ca91cx42_bridge->parent, "Failed to allocate mem "
@@ -563,10 +563,10 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
 err_remap:
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 err_resource:
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 err_name:
 	return retval;
 }
@@ -578,9 +578,9 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
 {
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 }
 
 
@@ -620,7 +620,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 		goto err_window;
 	}
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/*
 	 * Let's allocate the resource here rather than further up the stack as
@@ -628,7 +628,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	 */
 	retval = ca91cx42_alloc_resource(image, size);
 	if (retval) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Unable to allocate memory "
 			"for resource name\n");
 		retval = -ENOMEM;
@@ -672,7 +672,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= CA91CX42_LSI_CTL_VDW_D64;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Invalid data width\n");
 		retval = -EINVAL;
 		goto err_dwidth;
@@ -704,7 +704,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	case VME_USER3:
 	case VME_USER4:
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(ca91cx42_bridge->parent, "Invalid address space\n");
 		retval = -EINVAL;
 		goto err_aspace;
@@ -730,7 +730,7 @@ int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 
 	iowrite32(temp_ctl, bridge->base + CA91CX42_LSI_CTL[i]);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 	return 0;
 
 err_aspace:
@@ -834,12 +834,12 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 {
 	int retval;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	retval = __ca91cx42_master_get(image, enabled, vme_base, size, aspace,
 		cycle, dwidth);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -855,7 +855,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
 	if (count == 0)
 		return 0;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* The following code handles VME address alignment problem
 	 * in order to assure the maximal data width cycle.
@@ -899,7 +899,7 @@ ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
 	}
 out:
 	retval = count;
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -915,7 +915,7 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
 	if (count == 0)
 		return 0;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* Here we apply for the same strategy we do in master_read
 	 * function in order to assure D16 cycle when required.
@@ -954,7 +954,8 @@ ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
 out:
 	retval = count;
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
+
 	return retval;
 }
 
@@ -974,10 +975,10 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	i = image->number;
 
 	/* Locking as we can only do one of these at a time */
-	mutex_lock(&(bridge->vme_rmw));
+	mutex_lock(&bridge->vme_rmw);
 
 	/* Lock image */
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	pci_addr = (u32)image->kern_base + offset;
 
@@ -1007,9 +1008,9 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	iowrite32(0, bridge->base + SCYC_CTL);
 
 out:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
-	mutex_unlock(&(bridge->vme_rmw));
+	mutex_unlock(&bridge->vme_rmw);
 
 	return result;
 }
@@ -1036,14 +1037,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	}
 
 	/* Test descriptor alignment */
-	if ((unsigned long)&(entry->descriptor) & CA91CX42_DCPP_M) {
+	if ((unsigned long)&entry->descriptor & CA91CX42_DCPP_M) {
 		dev_err(dev, "Descriptor not aligned to 16 byte boundary as "
-			"required: %p\n", &(entry->descriptor));
+			"required: %p\n", &entry->descriptor);
 		retval = -EINVAL;
 		goto err_align;
 	}
 
-	memset(&(entry->descriptor), 0, sizeof(struct ca91cx42_dma_descriptor));
+	memset(&entry->descriptor, 0, sizeof(struct ca91cx42_dma_descriptor));
 
 	if (dest->type == VME_DMA_VME) {
 		entry->descriptor.dctl |= CA91CX42_DCTL_L2V;
@@ -1138,14 +1139,14 @@ int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	entry->descriptor.dcpp = CA91CX42_DCPP_NULL;
 
 	/* Add to list */
-	list_add_tail(&(entry->list), &(list->entries));
+	list_add_tail(&entry->list, &list->entries);
 
 	/* Fill out previous descriptors "Next Address" */
-	if (entry->list.prev != &(list->entries)) {
+	if (entry->list.prev != &list->entries) {
 		prev = list_entry(entry->list.prev, struct ca91cx42_dma_entry,
 			list);
 		/* We need the bus address for the pointer */
-		desc_ptr = virt_to_bus(&(entry->descriptor));
+		desc_ptr = virt_to_bus(&entry->descriptor);
 		prev->descriptor.dcpp = desc_ptr & ~CA91CX42_DCPP_M;
 	}
 
@@ -1190,28 +1191,28 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 	bridge = ctrlr->parent->driver_priv;
 	dev = ctrlr->parent->parent;
 
-	mutex_lock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
 
-	if (!(list_empty(&(ctrlr->running)))) {
+	if (!(list_empty(&ctrlr->running))) {
 		/*
 		 * XXX We have an active DMA transfer and currently haven't
 		 *     sorted out the mechanism for "pending" DMA transfers.
 		 *     Return busy.
 		 */
 		/* Need to add to pending here */
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	} else {
-		list_add(&(list->list), &(ctrlr->running));
+		list_add(&list->list, &ctrlr->running);
 	}
 
 	/* Get first bus address and write into registers */
-	entry = list_first_entry(&(list->entries), struct ca91cx42_dma_entry,
+	entry = list_first_entry(&list->entries, struct ca91cx42_dma_entry,
 		list);
 
-	bus_addr = virt_to_bus(&(entry->descriptor));
+	bus_addr = virt_to_bus(&entry->descriptor);
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	iowrite32(0, bridge->base + DTBC);
 	iowrite32(bus_addr & ~CA91CX42_DCPP_M, bridge->base + DCPP);
@@ -1249,9 +1250,9 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 	}
 
 	/* Remove list from running list */
-	mutex_lock(&(ctrlr->mtx));
-	list_del(&(list->list));
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
+	list_del(&list->list);
+	mutex_unlock(&ctrlr->mtx);
 
 	return retval;
 
@@ -1263,7 +1264,7 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
 	struct ca91cx42_dma_entry *entry;
 
 	/* detach and free each entry */
-	list_for_each_safe(pos, temp, &(list->entries)) {
+	list_for_each_safe(pos, temp, &list->entries) {
 		list_del(pos);
 		entry = list_entry(pos, struct ca91cx42_dma_entry, list);
 		kfree(entry);
@@ -1298,12 +1299,12 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		return -EINVAL;
 	}
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* If we already have a callback attached, we can't move it! */
 	for (i = 0; i < lm->monitors; i++) {
 		if (bridge->lm_callback[i] != NULL) {
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			dev_err(dev, "Location monitor callback attached, "
 				"can't reset\n");
 			return -EBUSY;
@@ -1321,7 +1322,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		lm_ctl |= CA91CX42_LM_CTL_AS_A32;
 		break;
 	default:
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Invalid address space\n");
 		return -EINVAL;
 		break;
@@ -1339,7 +1340,7 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	iowrite32(lm_base, bridge->base + LM_BS);
 	iowrite32(lm_ctl, bridge->base + LM_CTL);
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1355,7 +1356,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	*lm_base = (unsigned long long)ioread32(bridge->base + LM_BS);
 	lm_ctl = ioread32(bridge->base + LM_CTL);
@@ -1380,7 +1381,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	if (lm_ctl & CA91CX42_LM_CTL_DATA)
 		*cycle |= VME_DATA;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return enabled;
 }
@@ -1400,19 +1401,19 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 	bridge = lm->parent->driver_priv;
 	dev = lm->parent->parent;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Ensure that the location monitor is configured - need PGM or DATA */
 	lm_ctl = ioread32(bridge->base + LM_CTL);
 	if ((lm_ctl & (CA91CX42_LM_CTL_PGM | CA91CX42_LM_CTL_DATA)) == 0) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Location monitor not properly configured\n");
 		return -EINVAL;
 	}
 
 	/* Check that a callback isn't already attached */
 	if (bridge->lm_callback[monitor] != NULL) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(dev, "Existing callback attached\n");
 		return -EBUSY;
 	}
@@ -1431,7 +1432,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 		iowrite32(lm_ctl, bridge->base + LM_CTL);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1446,7 +1447,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Disable Location Monitor and ensure previous interrupts are clear */
 	tmp = ioread32(bridge->base + LINT_EN);
@@ -1467,7 +1468,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 		iowrite32(tmp, bridge->base + LM_CTL);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1526,7 +1527,7 @@ static int ca91cx42_crcsr_init(struct vme_bridge *ca91cx42_bridge,
 
 	/* Allocate mem for CR/CSR image */
 	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-		&(bridge->crcsr_bus));
+		&bridge->crcsr_bus);
 	if (bridge->crcsr_kernel == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for CR/CSR "
 			"image\n");
@@ -1632,12 +1633,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Initialize wait queues & mutual exclusion flags */
-	init_waitqueue_head(&(ca91cx42_device->dma_queue));
-	init_waitqueue_head(&(ca91cx42_device->iack_queue));
-	mutex_init(&(ca91cx42_device->vme_int));
-	mutex_init(&(ca91cx42_device->vme_rmw));
+	init_waitqueue_head(&ca91cx42_device->dma_queue);
+	init_waitqueue_head(&ca91cx42_device->iack_queue);
+	mutex_init(&ca91cx42_device->vme_int);
+	mutex_init(&ca91cx42_device->vme_rmw);
 
-	ca91cx42_bridge->parent = &(pdev->dev);
+	ca91cx42_bridge->parent = &pdev->dev;
 	strcpy(ca91cx42_bridge->name, driver_name);
 
 	/* Setup IRQ */
@@ -1648,7 +1649,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Add master windows to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->master_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->master_resources);
 	for (i = 0; i < CA91C142_MAX_MASTER; i++) {
 		master_image = kmalloc(sizeof(struct vme_master_resource),
 			GFP_KERNEL);
@@ -1659,7 +1660,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		master_image->parent = ca91cx42_bridge;
-		spin_lock_init(&(master_image->lock));
+		spin_lock_init(&master_image->lock);
 		master_image->locked = 0;
 		master_image->number = i;
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -1667,15 +1668,15 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		master_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
 			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D8 | VME_D16 | VME_D32 | VME_D64;
-		memset(&(master_image->bus_resource), 0,
+		memset(&master_image->bus_resource, 0,
 			sizeof(struct resource));
 		master_image->kern_base  = NULL;
-		list_add_tail(&(master_image->list),
-			&(ca91cx42_bridge->master_resources));
+		list_add_tail(&master_image->list,
+			&ca91cx42_bridge->master_resources);
 	}
 
 	/* Add slave windows to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->slave_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->slave_resources);
 	for (i = 0; i < CA91C142_MAX_SLAVE; i++) {
 		slave_image = kmalloc(sizeof(struct vme_slave_resource),
 			GFP_KERNEL);
@@ -1686,7 +1687,7 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_slave;
 		}
 		slave_image->parent = ca91cx42_bridge;
-		mutex_init(&(slave_image->mtx));
+		mutex_init(&slave_image->mtx);
 		slave_image->locked = 0;
 		slave_image->number = i;
 		slave_image->address_attr = VME_A24 | VME_A32 | VME_USER1 |
@@ -1698,12 +1699,12 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 		slave_image->cycle_attr = VME_SCT | VME_BLT | VME_MBLT |
 			VME_SUPER | VME_USER | VME_PROG | VME_DATA;
-		list_add_tail(&(slave_image->list),
-			&(ca91cx42_bridge->slave_resources));
+		list_add_tail(&slave_image->list,
+			&ca91cx42_bridge->slave_resources);
 	}
 
 	/* Add dma engines to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->dma_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->dma_resources);
 	for (i = 0; i < CA91C142_MAX_DMA; i++) {
 		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
 			GFP_KERNEL);
@@ -1714,19 +1715,19 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_dma;
 		}
 		dma_ctrlr->parent = ca91cx42_bridge;
-		mutex_init(&(dma_ctrlr->mtx));
+		mutex_init(&dma_ctrlr->mtx);
 		dma_ctrlr->locked = 0;
 		dma_ctrlr->number = i;
 		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
 			VME_DMA_MEM_TO_VME;
-		INIT_LIST_HEAD(&(dma_ctrlr->pending));
-		INIT_LIST_HEAD(&(dma_ctrlr->running));
-		list_add_tail(&(dma_ctrlr->list),
-			&(ca91cx42_bridge->dma_resources));
+		INIT_LIST_HEAD(&dma_ctrlr->pending);
+		INIT_LIST_HEAD(&dma_ctrlr->running);
+		list_add_tail(&dma_ctrlr->list,
+			&ca91cx42_bridge->dma_resources);
 	}
 
 	/* Add location monitor to list */
-	INIT_LIST_HEAD(&(ca91cx42_bridge->lm_resources));
+	INIT_LIST_HEAD(&ca91cx42_bridge->lm_resources);
 	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
 	if (lm == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for "
@@ -1735,11 +1736,11 @@ static int ca91cx42_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_lm;
 	}
 	lm->parent = ca91cx42_bridge;
-	mutex_init(&(lm->mtx));
+	mutex_init(&lm->mtx);
 	lm->locked = 0;
 	lm->number = 1;
 	lm->monitors = 4;
-	list_add_tail(&(lm->list), &(ca91cx42_bridge->lm_resources));
+	list_add_tail(&lm->list, &ca91cx42_bridge->lm_resources);
 
 	ca91cx42_bridge->slave_get = ca91cx42_slave_get;
 	ca91cx42_bridge->slave_set = ca91cx42_slave_set;
@@ -1786,28 +1787,28 @@ err_reg:
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 err_lm:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 err_dma:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 err_slave:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 err_master:
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
@@ -1870,28 +1871,28 @@ void ca91cx42_remove(struct pci_dev *pdev)
 	ca91cx42_crcsr_exit(ca91cx42_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->lm_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->dma_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->slave_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(ca91cx42_bridge->master_resources)) {
+	list_for_each(pos, &ca91cx42_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 492ddb2..1cba1fa 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -81,11 +81,11 @@ static u32 tsi148_DMA_irqhandler(struct tsi148_driver *bridge,
 	u32 serviced = 0;
 
 	if (channel_mask & TSI148_LCSR_INTS_DMA0S) {
-		wake_up(&(bridge->dma_queue[0]));
+		wake_up(&bridge->dma_queue[0]);
 		serviced |= TSI148_LCSR_INTC_DMA0C;
 	}
 	if (channel_mask & TSI148_LCSR_INTS_DMA1S) {
-		wake_up(&(bridge->dma_queue[1]));
+		wake_up(&bridge->dma_queue[1]);
 		serviced |= TSI148_LCSR_INTC_DMA1C;
 	}
 
@@ -191,7 +191,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
 	if (error) {
 		error->address = error_addr;
 		error->attributes = error_attrib;
-		list_add_tail(&(error->list), &(tsi148_bridge->vme_errors));
+		list_add_tail(&error->list, &tsi148_bridge->vme_errors);
 	} else {
 		dev_err(tsi148_bridge->parent, "Unable to alloc memory for "
 			"VMEbus Error reporting\n");
@@ -210,7 +210,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge)
  */
 static u32 tsi148_IACK_irqhandler(struct tsi148_driver *bridge)
 {
-	wake_up(&(bridge->iack_queue));
+	wake_up(&bridge->iack_queue);
 
 	return TSI148_LCSR_INTC_IACKC;
 }
@@ -320,9 +320,9 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
 	bridge = tsi148_bridge->driver_priv;
 
 	/* Initialise list for VME bus errors */
-	INIT_LIST_HEAD(&(tsi148_bridge->vme_errors));
+	INIT_LIST_HEAD(&tsi148_bridge->vme_errors);
 
-	mutex_init(&(tsi148_bridge->irq_mtx));
+	mutex_init(&tsi148_bridge->irq_mtx);
 
 	result = request_irq(pdev->irq,
 			     tsi148_irqhandler,
@@ -452,7 +452,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(bridge->vme_int));
+	mutex_lock(&bridge->vme_int);
 
 	/* Read VICR register */
 	tmp = ioread32be(bridge->base + TSI148_LCSR_VICR);
@@ -470,7 +470,7 @@ int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
 	wait_event_interruptible(bridge->iack_queue,
 		tsi148_iack_received(bridge));
 
-	mutex_unlock(&(bridge->vme_int));
+	mutex_unlock(&bridge->vme_int);
 
 	return 0;
 }
@@ -496,7 +496,7 @@ static struct vme_bus_error *tsi148_find_error(struct vme_bridge *tsi148_bridge,
 	 */
 	err_pos = NULL;
 	/* Iterate through errors */
-	list_for_each(err_pos, &(tsi148_bridge->vme_errors)) {
+	list_for_each(err_pos, &tsi148_bridge->vme_errors) {
 		vme_err = list_entry(err_pos, struct vme_bus_error, list);
 		if ((vme_err->address >= address) &&
 			(vme_err->address < bound)) {
@@ -530,7 +530,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
 	 */
 	err_pos = NULL;
 	/* Iterate through errors */
-	list_for_each_safe(err_pos, temp, &(tsi148_bridge->vme_errors)) {
+	list_for_each_safe(err_pos, temp, &tsi148_bridge->vme_errors) {
 		vme_err = list_entry(err_pos, struct vme_bus_error, list);
 
 		if ((vme_err->address >= address) &&
@@ -819,8 +819,8 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 		image->kern_base = NULL;
 		if (image->bus_resource.name != NULL)
 			kfree(image->bus_resource.name);
-		release_resource(&(image->bus_resource));
-		memset(&(image->bus_resource), 0, sizeof(struct resource));
+		release_resource(&image->bus_resource);
+		memset(&image->bus_resource, 0, sizeof(struct resource));
 	}
 
 	/* Exit here if size is zero */
@@ -845,7 +845,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 	image->bus_resource.flags = IORESOURCE_MEM;
 
 	retval = pci_bus_alloc_resource(pdev->bus,
-		&(image->bus_resource), size, size, PCIBIOS_MIN_MEM,
+		&image->bus_resource, size, size, PCIBIOS_MIN_MEM,
 		0, NULL, NULL);
 	if (retval) {
 		dev_err(tsi148_bridge->parent, "Failed to allocate mem "
@@ -868,10 +868,10 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
 err_remap:
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 err_resource:
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 err_name:
 	return retval;
 }
@@ -883,9 +883,9 @@ static void tsi148_free_resource(struct vme_master_resource *image)
 {
 	iounmap(image->kern_base);
 	image->kern_base = NULL;
-	release_resource(&(image->bus_resource));
+	release_resource(&image->bus_resource);
 	kfree(image->bus_resource.name);
-	memset(&(image->bus_resource), 0, sizeof(struct resource));
+	memset(&image->bus_resource, 0, sizeof(struct resource));
 }
 
 /*
@@ -924,7 +924,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		goto err_window;
 	}
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	/* Let's allocate the resource here rather than further up the stack as
 	 * it avoids pushing loads of bus dependant stuff up the stack. If size
@@ -932,7 +932,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	 */
 	retval = tsi148_alloc_resource(image, size);
 	if (retval) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Unable to allocate memory for "
 			"resource\n");
 		goto err_res;
@@ -959,19 +959,19 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	reg_split(vme_offset, &vme_offset_high, &vme_offset_low);
 
 	if (pci_base_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid PCI base alignment\n");
 		retval = -EINVAL;
 		goto err_gran;
 	}
 	if (pci_bound_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid PCI bound alignment\n");
 		retval = -EINVAL;
 		goto err_gran;
 	}
 	if (vme_offset_low & 0xFFFF) {
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid VME Offset "
 			"alignment\n");
 		retval = -EINVAL;
@@ -1035,7 +1035,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_OTAT_DBW_32;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid data width\n");
 		retval = -EINVAL;
 		goto err_dwidth;
@@ -1072,7 +1072,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 		temp_ctl |= TSI148_LCSR_OTAT_AMODE_USER4;
 		break;
 	default:
-		spin_unlock(&(image->lock));
+		spin_unlock(&image->lock);
 		dev_err(tsi148_bridge->parent, "Invalid address space\n");
 		retval = -EINVAL;
 		goto err_aspace;
@@ -1109,7 +1109,7 @@ int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	iowrite32be(temp_ctl, bridge->base + TSI148_LCSR_OT[i] +
 		TSI148_LCSR_OFFSET_OTAT);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 	return 0;
 
 err_aspace:
@@ -1243,12 +1243,12 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 {
 	int retval;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	retval = __tsi148_master_get(image, enabled, vme_base, size, aspace,
 		cycle, dwidth);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1266,7 +1266,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 
 	tsi148_bridge = image->parent;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	memcpy_fromio(buf, image->kern_base + offset, (unsigned int)count);
 	retval = count;
@@ -1289,7 +1289,7 @@ ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 	}
 
 skip_chk:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1312,7 +1312,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	memcpy_toio(image->kern_base + offset, buf, (unsigned int)count);
 	retval = count;
@@ -1352,7 +1352,7 @@ ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 	}
 
 skip_chk:
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
 	return retval;
 }
@@ -1378,10 +1378,10 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	i = image->number;
 
 	/* Locking as we can only do one of these at a time */
-	mutex_lock(&(bridge->vme_rmw));
+	mutex_lock(&bridge->vme_rmw);
 
 	/* Lock image */
-	spin_lock(&(image->lock));
+	spin_lock(&image->lock);
 
 	pci_addr_high = ioread32be(bridge->base + TSI148_LCSR_OT[i] +
 		TSI148_LCSR_OFFSET_OTSAU);
@@ -1411,9 +1411,9 @@ unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	tmp &= ~TSI148_LCSR_VMCTRL_RMWEN;
 	iowrite32be(tmp, bridge->base + TSI148_LCSR_VMCTRL);
 
-	spin_unlock(&(image->lock));
+	spin_unlock(&image->lock);
 
-	mutex_unlock(&(bridge->vme_rmw));
+	mutex_unlock(&bridge->vme_rmw);
 
 	return result;
 }
@@ -1633,10 +1633,10 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	}
 
 	/* Test descriptor alignment */
-	if ((unsigned long)&(entry->descriptor) & 0x7) {
+	if ((unsigned long)&entry->descriptor & 0x7) {
 		dev_err(tsi148_bridge->parent, "Descriptor not aligned to 8 "
 			"byte boundary as required: %p\n",
-			&(entry->descriptor));
+			&entry->descriptor);
 		retval = -EINVAL;
 		goto err_align;
 	}
@@ -1644,7 +1644,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	/* Given we are going to fill out the structure, we probably don't
 	 * need to zero it, but better safe than sorry for now.
 	 */
-	memset(&(entry->descriptor), 0, sizeof(struct tsi148_dma_descriptor));
+	memset(&entry->descriptor, 0, sizeof(struct tsi148_dma_descriptor));
 
 	/* Fill out source part */
 	switch (src->type) {
@@ -1681,7 +1681,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		entry->descriptor.dsat = TSI148_LCSR_DSAT_TYP_VME;
 
 		retval = tsi148_dma_set_vme_src_attributes(
-			tsi148_bridge->parent, &(entry->descriptor.dsat),
+			tsi148_bridge->parent, &entry->descriptor.dsat,
 			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
 		if (retval < 0)
 			goto err_source;
@@ -1719,7 +1719,7 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		entry->descriptor.ddat = TSI148_LCSR_DDAT_TYP_VME;
 
 		retval = tsi148_dma_set_vme_dest_attributes(
-			tsi148_bridge->parent, &(entry->descriptor.ddat),
+			tsi148_bridge->parent, &entry->descriptor.ddat,
 			vme_attr->aspace, vme_attr->cycle, vme_attr->dwidth);
 		if (retval < 0)
 			goto err_dest;
@@ -1735,16 +1735,16 @@ int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 	entry->descriptor.dcnt = (u32)count;
 
 	/* Add to list */
-	list_add_tail(&(entry->list), &(list->entries));
+	list_add_tail(&entry->list, &list->entries);
 
 	/* Fill out previous descriptors "Next Address" */
-	if (entry->list.prev != &(list->entries)) {
+	if (entry->list.prev != &list->entries) {
 		prev = list_entry(entry->list.prev, struct tsi148_dma_entry,
 			list);
 		/* We need the bus address for the pointer */
-		desc_ptr = virt_to_bus(&(entry->descriptor));
-		reg_split(desc_ptr, &(prev->descriptor.dnlau),
-			&(prev->descriptor.dnlal));
+		desc_ptr = virt_to_bus(&entry->descriptor);
+		reg_split(desc_ptr, &prev->descriptor.dnlau,
+			&prev->descriptor.dnlal);
 	}
 
 	return 0;
@@ -1799,30 +1799,30 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
 
 	channel = ctrlr->number;
 
-	if (!list_empty(&(ctrlr->running))) {
+	if (!list_empty(&ctrlr->running)) {
 		/*
 		 * XXX We have an active DMA transfer and currently haven't
 		 *     sorted out the mechanism for "pending" DMA transfers.
 		 *     Return busy.
 		 */
 		/* Need to add to pending here */
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	} else {
-		list_add(&(list->list), &(ctrlr->running));
+		list_add(&list->list, &ctrlr->running);
 	}
 
 	/* Get first bus address and write into registers */
-	entry = list_first_entry(&(list->entries), struct tsi148_dma_entry,
+	entry = list_first_entry(&list->entries, struct tsi148_dma_entry,
 		list);
 
-	bus_addr = virt_to_bus(&(entry->descriptor));
+	bus_addr = virt_to_bus(&entry->descriptor);
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	reg_split(bus_addr, &bus_addr_high, &bus_addr_low);
 
@@ -1850,9 +1850,9 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
 	}
 
 	/* Remove list from running list */
-	mutex_lock(&(ctrlr->mtx));
-	list_del(&(list->list));
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_lock(&ctrlr->mtx);
+	list_del(&list->list);
+	mutex_unlock(&ctrlr->mtx);
 
 	return retval;
 }
@@ -1868,7 +1868,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
 	struct tsi148_dma_entry *entry;
 
 	/* detach and free each entry */
-	list_for_each_safe(pos, temp, &(list->entries)) {
+	list_for_each_safe(pos, temp, &list->entries) {
 		list_del(pos);
 		entry = list_entry(pos, struct tsi148_dma_entry, list);
 		kfree(entry);
@@ -1896,12 +1896,12 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* If we already have a callback attached, we can't move it! */
 	for (i = 0; i < lm->monitors; i++) {
 		if (bridge->lm_callback[i] != NULL) {
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			dev_err(tsi148_bridge->parent, "Location monitor "
 				"callback attached, can't reset\n");
 			return -EBUSY;
@@ -1922,7 +1922,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 		lm_ctl |= TSI148_LCSR_LMAT_AS_A64;
 		break;
 	default:
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Invalid address space\n");
 		return -EINVAL;
 		break;
@@ -1943,7 +1943,7 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	iowrite32be(lm_base_low, bridge->base + TSI148_LCSR_LMBAL);
 	iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -1959,7 +1959,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	lm_base_high = ioread32be(bridge->base + TSI148_LCSR_LMBAU);
 	lm_base_low = ioread32be(bridge->base + TSI148_LCSR_LMBAL);
@@ -1992,7 +1992,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
 	if (lm_ctl & TSI148_LCSR_LMAT_DATA)
 		*cycle |= VME_DATA;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return enabled;
 }
@@ -2013,12 +2013,12 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 
 	bridge = tsi148_bridge->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Ensure that the location monitor is configured - need PGM or DATA */
 	lm_ctl = ioread32be(bridge->base + TSI148_LCSR_LMAT);
 	if ((lm_ctl & (TSI148_LCSR_LMAT_PGM | TSI148_LCSR_LMAT_DATA)) == 0) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Location monitor not properly "
 			"configured\n");
 		return -EINVAL;
@@ -2026,7 +2026,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 
 	/* Check that a callback isn't already attached */
 	if (bridge->lm_callback[monitor] != NULL) {
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 		dev_err(tsi148_bridge->parent, "Existing callback attached\n");
 		return -EBUSY;
 	}
@@ -2049,7 +2049,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 		iowrite32be(lm_ctl, bridge->base + TSI148_LCSR_LMAT);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -2064,7 +2064,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 
 	bridge = lm->parent->driver_priv;
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* Disable Location Monitor and ensure previous interrupts are clear */
 	lm_en = ioread32be(bridge->base + TSI148_LCSR_INTEN);
@@ -2089,7 +2089,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 		iowrite32be(tmp, bridge->base + TSI148_LCSR_LMAT);
 	}
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	return 0;
 }
@@ -2142,7 +2142,7 @@ static int tsi148_crcsr_init(struct vme_bridge *tsi148_bridge,
 
 	/* Allocate mem for CR/CSR image */
 	bridge->crcsr_kernel = pci_alloc_consistent(pdev, VME_CRCSR_BUF_SIZE,
-		&(bridge->crcsr_bus));
+		&bridge->crcsr_bus);
 	if (bridge->crcsr_kernel == NULL) {
 		dev_err(tsi148_bridge->parent, "Failed to allocate memory for "
 			"CR/CSR image\n");
@@ -2280,13 +2280,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 
 	/* Initialize wait queues & mutual exclusion flags */
-	init_waitqueue_head(&(tsi148_device->dma_queue[0]));
-	init_waitqueue_head(&(tsi148_device->dma_queue[1]));
-	init_waitqueue_head(&(tsi148_device->iack_queue));
-	mutex_init(&(tsi148_device->vme_int));
-	mutex_init(&(tsi148_device->vme_rmw));
+	init_waitqueue_head(&tsi148_device->dma_queue[0]);
+	init_waitqueue_head(&tsi148_device->dma_queue[1]);
+	init_waitqueue_head(&tsi148_device->iack_queue);
+	mutex_init(&tsi148_device->vme_int);
+	mutex_init(&tsi148_device->vme_rmw);
 
-	tsi148_bridge->parent = &(pdev->dev);
+	tsi148_bridge->parent = &pdev->dev;
 	strcpy(tsi148_bridge->name, driver_name);
 
 	/* Setup IRQ */
@@ -2314,7 +2314,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		tsi148_device->flush_image->parent = tsi148_bridge;
-		spin_lock_init(&(tsi148_device->flush_image->lock));
+		spin_lock_init(&tsi148_device->flush_image->lock);
 		tsi148_device->flush_image->locked = 1;
 		tsi148_device->flush_image->number = master_num;
 		tsi148_device->flush_image->address_attr = VME_A16 | VME_A24 |
@@ -2324,13 +2324,13 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eSST160 | VME_2eSST267 | VME_2eSST320 | VME_SUPER |
 			VME_USER | VME_PROG | VME_DATA;
 		tsi148_device->flush_image->width_attr = VME_D16 | VME_D32;
-		memset(&(tsi148_device->flush_image->bus_resource), 0,
+		memset(&tsi148_device->flush_image->bus_resource, 0,
 			sizeof(struct resource));
 		tsi148_device->flush_image->kern_base  = NULL;
 	}
 
 	/* Add master windows to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->master_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->master_resources);
 	for (i = 0; i < master_num; i++) {
 		master_image = kmalloc(sizeof(struct vme_master_resource),
 			GFP_KERNEL);
@@ -2341,7 +2341,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_master;
 		}
 		master_image->parent = tsi148_bridge;
-		spin_lock_init(&(master_image->lock));
+		spin_lock_init(&master_image->lock);
 		master_image->locked = 0;
 		master_image->number = i;
 		master_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -2351,15 +2351,15 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
 		master_image->width_attr = VME_D16 | VME_D32;
-		memset(&(master_image->bus_resource), 0,
+		memset(&master_image->bus_resource, 0,
 			sizeof(struct resource));
 		master_image->kern_base  = NULL;
-		list_add_tail(&(master_image->list),
-			&(tsi148_bridge->master_resources));
+		list_add_tail(&master_image->list,
+			&tsi148_bridge->master_resources);
 	}
 
 	/* Add slave windows to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->slave_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->slave_resources);
 	for (i = 0; i < TSI148_MAX_SLAVE; i++) {
 		slave_image = kmalloc(sizeof(struct vme_slave_resource),
 			GFP_KERNEL);
@@ -2370,7 +2370,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_slave;
 		}
 		slave_image->parent = tsi148_bridge;
-		mutex_init(&(slave_image->mtx));
+		mutex_init(&slave_image->mtx);
 		slave_image->locked = 0;
 		slave_image->number = i;
 		slave_image->address_attr = VME_A16 | VME_A24 | VME_A32 |
@@ -2380,12 +2380,12 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			VME_2eVME | VME_2eSST | VME_2eSSTB | VME_2eSST160 |
 			VME_2eSST267 | VME_2eSST320 | VME_SUPER | VME_USER |
 			VME_PROG | VME_DATA;
-		list_add_tail(&(slave_image->list),
-			&(tsi148_bridge->slave_resources));
+		list_add_tail(&slave_image->list,
+			&tsi148_bridge->slave_resources);
 	}
 
 	/* Add dma engines to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->dma_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->dma_resources);
 	for (i = 0; i < TSI148_MAX_DMA; i++) {
 		dma_ctrlr = kmalloc(sizeof(struct vme_dma_resource),
 			GFP_KERNEL);
@@ -2396,21 +2396,21 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 			goto err_dma;
 		}
 		dma_ctrlr->parent = tsi148_bridge;
-		mutex_init(&(dma_ctrlr->mtx));
+		mutex_init(&dma_ctrlr->mtx);
 		dma_ctrlr->locked = 0;
 		dma_ctrlr->number = i;
 		dma_ctrlr->route_attr = VME_DMA_VME_TO_MEM |
 			VME_DMA_MEM_TO_VME | VME_DMA_VME_TO_VME |
 			VME_DMA_MEM_TO_MEM | VME_DMA_PATTERN_TO_VME |
 			VME_DMA_PATTERN_TO_MEM;
-		INIT_LIST_HEAD(&(dma_ctrlr->pending));
-		INIT_LIST_HEAD(&(dma_ctrlr->running));
-		list_add_tail(&(dma_ctrlr->list),
-			&(tsi148_bridge->dma_resources));
+		INIT_LIST_HEAD(&dma_ctrlr->pending);
+		INIT_LIST_HEAD(&dma_ctrlr->running);
+		list_add_tail(&dma_ctrlr->list,
+			&tsi148_bridge->dma_resources);
 	}
 
 	/* Add location monitor to list */
-	INIT_LIST_HEAD(&(tsi148_bridge->lm_resources));
+	INIT_LIST_HEAD(&tsi148_bridge->lm_resources);
 	lm = kmalloc(sizeof(struct vme_lm_resource), GFP_KERNEL);
 	if (lm == NULL) {
 		dev_err(&pdev->dev, "Failed to allocate memory for "
@@ -2419,11 +2419,11 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		goto err_lm;
 	}
 	lm->parent = tsi148_bridge;
-	mutex_init(&(lm->mtx));
+	mutex_init(&lm->mtx);
 	lm->locked = 0;
 	lm->number = 1;
 	lm->monitors = 4;
-	list_add_tail(&(lm->list), &(tsi148_bridge->lm_resources));
+	list_add_tail(&lm->list, &tsi148_bridge->lm_resources);
 
 	tsi148_bridge->slave_get = tsi148_slave_get;
 	tsi148_bridge->slave_set = tsi148_slave_set;
@@ -2483,28 +2483,28 @@ err_reg:
 err_crcsr:
 err_lm:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->lm_resources)) {
+	list_for_each(pos, &tsi148_bridge->lm_resources) {
 		lm = list_entry(pos, struct vme_lm_resource, list);
 		list_del(pos);
 		kfree(lm);
 	}
 err_dma:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
+	list_for_each(pos, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 err_slave:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
+	list_for_each(pos, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 err_master:
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->master_resources)) {
+	list_for_each(pos, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
@@ -2589,21 +2589,21 @@ static void tsi148_remove(struct pci_dev *pdev)
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->dma_resources)) {
+	list_for_each(pos, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->slave_resources)) {
+	list_for_each(pos, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &(tsi148_bridge->master_resources)) {
+	list_for_each(pos, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 71bbc52..cbe2e11 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -470,9 +470,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			 *	to userspace as they are
 			 */
 			retval = vme_master_get(image[minor].resource,
-				&(master.enable), &(master.vme_addr),
-				&(master.size), &(master.aspace),
-				&(master.cycle), &(master.dwidth));
+				&master.enable, &master.vme_addr,
+				&master.size, &master.aspace,
+				&master.cycle, &master.dwidth);
 
 			copied = copy_to_user((char *)arg, &master,
 				sizeof(struct vme_master));
@@ -514,9 +514,9 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 			 *	to userspace as they are
 			 */
 			retval = vme_slave_get(image[minor].resource,
-				&(slave.enable), &(slave.vme_addr),
-				&(slave.size), &pci_addr, &(slave.aspace),
-				&(slave.cycle));
+				&slave.enable, &slave.vme_addr,
+				&slave.size, &pci_addr, &slave.aspace,
+				&slave.cycle);
 
 			copied = copy_to_user((char *)arg, &slave,
 				sizeof(struct vme_slave));
@@ -683,7 +683,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
 	for (i = 0; i < VME_DEVS; i++) {
 		image[i].kern_buf = NULL;
 		image[i].pci_buf = 0;
-		sema_init(&(image[i].sem), 1);
+		sema_init(&image[i].sem, 1);
 		image[i].device = NULL;
 		image[i].resource = NULL;
 		image[i].users = 0;
@@ -727,7 +727,7 @@ static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
 		}
 		image[i].size_buf = PCI_BUF_SIZE;
 		image[i].kern_buf = vme_alloc_consistent(image[i].resource,
-			image[i].size_buf, &(image[i].pci_buf));
+			image[i].size_buf, &image[i].pci_buf);
 		if (image[i].kern_buf == NULL) {
 			printk(KERN_WARNING "Unable to allocate memory for "
 				"buffer\n");
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 093fbff..47e9d5c 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -245,7 +245,7 @@ struct vme_resource *vme_slave_request(struct device *dev,
 	}
 
 	/* Loop through slave resources */
-	list_for_each(slave_pos, &(bridge->slave_resources)) {
+	list_for_each(slave_pos, &bridge->slave_resources) {
 		slave_image = list_entry(slave_pos,
 			struct vme_slave_resource, list);
 
@@ -255,17 +255,17 @@ struct vme_resource *vme_slave_request(struct device *dev,
 		}
 
 		/* Find an unlocked and compatible image */
-		mutex_lock(&(slave_image->mtx));
+		mutex_lock(&slave_image->mtx);
 		if (((slave_image->address_attr & address) == address) &&
 			((slave_image->cycle_attr & cycle) == cycle) &&
 			(slave_image->locked == 0)) {
 
 			slave_image->locked = 1;
-			mutex_unlock(&(slave_image->mtx));
+			mutex_unlock(&slave_image->mtx);
 			allocated_image = slave_image;
 			break;
 		}
-		mutex_unlock(&(slave_image->mtx));
+		mutex_unlock(&slave_image->mtx);
 	}
 
 	/* No free image */
@@ -278,15 +278,15 @@ struct vme_resource *vme_slave_request(struct device *dev,
 		goto err_alloc;
 	}
 	resource->type = VME_SLAVE;
-	resource->entry = &(allocated_image->list);
+	resource->entry = &allocated_image->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(slave_image->mtx));
+	mutex_lock(&slave_image->mtx);
 	slave_image->locked = 0;
-	mutex_unlock(&(slave_image->mtx));
+	mutex_unlock(&slave_image->mtx);
 err_image:
 err_bus:
 	return NULL;
@@ -369,12 +369,12 @@ void vme_slave_free(struct vme_resource *resource)
 	}
 
 	/* Unlock image */
-	mutex_lock(&(slave_image->mtx));
+	mutex_lock(&slave_image->mtx);
 	if (slave_image->locked == 0)
 		printk(KERN_ERR "Image is already free\n");
 
 	slave_image->locked = 0;
-	mutex_unlock(&(slave_image->mtx));
+	mutex_unlock(&slave_image->mtx);
 
 	/* Free up resource memory */
 	kfree(resource);
@@ -401,7 +401,7 @@ struct vme_resource *vme_master_request(struct device *dev,
 	}
 
 	/* Loop through master resources */
-	list_for_each(master_pos, &(bridge->master_resources)) {
+	list_for_each(master_pos, &bridge->master_resources) {
 		master_image = list_entry(master_pos,
 			struct vme_master_resource, list);
 
@@ -411,18 +411,18 @@ struct vme_resource *vme_master_request(struct device *dev,
 		}
 
 		/* Find an unlocked and compatible image */
-		spin_lock(&(master_image->lock));
+		spin_lock(&master_image->lock);
 		if (((master_image->address_attr & address) == address) &&
 			((master_image->cycle_attr & cycle) == cycle) &&
 			((master_image->width_attr & dwidth) == dwidth) &&
 			(master_image->locked == 0)) {
 
 			master_image->locked = 1;
-			spin_unlock(&(master_image->lock));
+			spin_unlock(&master_image->lock);
 			allocated_image = master_image;
 			break;
 		}
-		spin_unlock(&(master_image->lock));
+		spin_unlock(&master_image->lock);
 	}
 
 	/* Check to see if we found a resource */
@@ -437,16 +437,16 @@ struct vme_resource *vme_master_request(struct device *dev,
 		goto err_alloc;
 	}
 	resource->type = VME_MASTER;
-	resource->entry = &(allocated_image->list);
+	resource->entry = &allocated_image->list;
 
 	return resource;
 
 	kfree(resource);
 err_alloc:
 	/* Unlock image */
-	spin_lock(&(master_image->lock));
+	spin_lock(&master_image->lock);
 	master_image->locked = 0;
-	spin_unlock(&(master_image->lock));
+	spin_unlock(&master_image->lock);
 err_image:
 err_bus:
 	return NULL;
@@ -628,12 +628,12 @@ void vme_master_free(struct vme_resource *resource)
 	}
 
 	/* Unlock image */
-	spin_lock(&(master_image->lock));
+	spin_lock(&master_image->lock);
 	if (master_image->locked == 0)
 		printk(KERN_ERR "Image is already free\n");
 
 	master_image->locked = 0;
-	spin_unlock(&(master_image->lock));
+	spin_unlock(&master_image->lock);
 
 	/* Free up resource memory */
 	kfree(resource);
@@ -662,7 +662,7 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 	}
 
 	/* Loop through DMA resources */
-	list_for_each(dma_pos, &(bridge->dma_resources)) {
+	list_for_each(dma_pos, &bridge->dma_resources) {
 		dma_ctrlr = list_entry(dma_pos,
 			struct vme_dma_resource, list);
 
@@ -672,16 +672,16 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 		}
 
 		/* Find an unlocked and compatible controller */
-		mutex_lock(&(dma_ctrlr->mtx));
+		mutex_lock(&dma_ctrlr->mtx);
 		if (((dma_ctrlr->route_attr & route) == route) &&
 			(dma_ctrlr->locked == 0)) {
 
 			dma_ctrlr->locked = 1;
-			mutex_unlock(&(dma_ctrlr->mtx));
+			mutex_unlock(&dma_ctrlr->mtx);
 			allocated_ctrlr = dma_ctrlr;
 			break;
 		}
-		mutex_unlock(&(dma_ctrlr->mtx));
+		mutex_unlock(&dma_ctrlr->mtx);
 	}
 
 	/* Check to see if we found a resource */
@@ -694,15 +694,15 @@ struct vme_resource *vme_dma_request(struct device *dev, vme_dma_route_t route)
 		goto err_alloc;
 	}
 	resource->type = VME_DMA;
-	resource->entry = &(allocated_ctrlr->list);
+	resource->entry = &allocated_ctrlr->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(dma_ctrlr->mtx));
+	mutex_lock(&dma_ctrlr->mtx);
 	dma_ctrlr->locked = 0;
-	mutex_unlock(&(dma_ctrlr->mtx));
+	mutex_unlock(&dma_ctrlr->mtx);
 err_ctrlr:
 err_bus:
 	return NULL;
@@ -729,9 +729,9 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resource *resource)
 		printk(KERN_ERR "Unable to allocate memory for new dma list\n");
 		return NULL;
 	}
-	INIT_LIST_HEAD(&(dma_list->entries));
+	INIT_LIST_HEAD(&dma_list->entries);
 	dma_list->parent = ctrlr;
-	mutex_init(&(dma_list->mtx));
+	mutex_init(&dma_list->mtx);
 
 	return dma_list;
 }
@@ -880,14 +880,14 @@ int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
 		return -EINVAL;
 	}
 
-	if (!mutex_trylock(&(list->mtx))) {
+	if (!mutex_trylock(&list->mtx)) {
 		printk(KERN_ERR "Link List already submitted\n");
 		return -EINVAL;
 	}
 
 	retval = bridge->dma_list_add(list, src, dest, count);
 
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 
 	return retval;
 }
@@ -903,11 +903,11 @@ int vme_dma_list_exec(struct vme_dma_list *list)
 		return -EINVAL;
 	}
 
-	mutex_lock(&(list->mtx));
+	mutex_lock(&list->mtx);
 
 	retval = bridge->dma_list_exec(list);
 
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 
 	return retval;
 }
@@ -923,7 +923,7 @@ int vme_dma_list_free(struct vme_dma_list *list)
 		return -EINVAL;
 	}
 
-	if (!mutex_trylock(&(list->mtx))) {
+	if (!mutex_trylock(&list->mtx)) {
 		printk(KERN_ERR "Link List in use\n");
 		return -EINVAL;
 	}
@@ -935,10 +935,10 @@ int vme_dma_list_free(struct vme_dma_list *list)
 	retval = bridge->dma_list_empty(list);
 	if (retval) {
 		printk(KERN_ERR "Unable to empty link-list entries\n");
-		mutex_unlock(&(list->mtx));
+		mutex_unlock(&list->mtx);
 		return retval;
 	}
-	mutex_unlock(&(list->mtx));
+	mutex_unlock(&list->mtx);
 	kfree(list);
 
 	return retval;
@@ -956,20 +956,20 @@ int vme_dma_free(struct vme_resource *resource)
 
 	ctrlr = list_entry(resource->entry, struct vme_dma_resource, list);
 
-	if (!mutex_trylock(&(ctrlr->mtx))) {
+	if (!mutex_trylock(&ctrlr->mtx)) {
 		printk(KERN_ERR "Resource busy, can't free\n");
 		return -EBUSY;
 	}
 
-	if (!(list_empty(&(ctrlr->pending)) && list_empty(&(ctrlr->running)))) {
+	if (!(list_empty(&ctrlr->pending) && list_empty(&ctrlr->running))) {
 		printk(KERN_WARNING "Resource still processing transfers\n");
-		mutex_unlock(&(ctrlr->mtx));
+		mutex_unlock(&ctrlr->mtx);
 		return -EBUSY;
 	}
 
 	ctrlr->locked = 0;
 
-	mutex_unlock(&(ctrlr->mtx));
+	mutex_unlock(&ctrlr->mtx);
 
 	return 0;
 }
@@ -1013,10 +1013,10 @@ int vme_irq_request(struct device *dev, int level, int statid,
 		return -EINVAL;
 	}
 
-	mutex_lock(&(bridge->irq_mtx));
+	mutex_lock(&bridge->irq_mtx);
 
 	if (bridge->irq[level - 1].callback[statid].func) {
-		mutex_unlock(&(bridge->irq_mtx));
+		mutex_unlock(&bridge->irq_mtx);
 		printk(KERN_WARNING "VME Interrupt already taken\n");
 		return -EBUSY;
 	}
@@ -1028,7 +1028,7 @@ int vme_irq_request(struct device *dev, int level, int statid,
 	/* Enable IRQ level */
 	bridge->irq_set(bridge, level, 1, 1);
 
-	mutex_unlock(&(bridge->irq_mtx));
+	mutex_unlock(&bridge->irq_mtx);
 
 	return 0;
 }
@@ -1054,7 +1054,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
 		return;
 	}
 
-	mutex_lock(&(bridge->irq_mtx));
+	mutex_lock(&bridge->irq_mtx);
 
 	bridge->irq[level - 1].count--;
 
@@ -1065,7 +1065,7 @@ void vme_irq_free(struct device *dev, int level, int statid)
 	bridge->irq[level - 1].callback[statid].func = NULL;
 	bridge->irq[level - 1].callback[statid].priv_data = NULL;
 
-	mutex_unlock(&(bridge->irq_mtx));
+	mutex_unlock(&bridge->irq_mtx);
 }
 EXPORT_SYMBOL(vme_irq_free);
 
@@ -1111,7 +1111,7 @@ struct vme_resource *vme_lm_request(struct device *dev)
 	}
 
 	/* Loop through DMA resources */
-	list_for_each(lm_pos, &(bridge->lm_resources)) {
+	list_for_each(lm_pos, &bridge->lm_resources) {
 		lm = list_entry(lm_pos,
 			struct vme_lm_resource, list);
 
@@ -1122,14 +1122,14 @@ struct vme_resource *vme_lm_request(struct device *dev)
 		}
 
 		/* Find an unlocked controller */
-		mutex_lock(&(lm->mtx));
+		mutex_lock(&lm->mtx);
 		if (lm->locked == 0) {
 			lm->locked = 1;
-			mutex_unlock(&(lm->mtx));
+			mutex_unlock(&lm->mtx);
 			allocated_lm = lm;
 			break;
 		}
-		mutex_unlock(&(lm->mtx));
+		mutex_unlock(&lm->mtx);
 	}
 
 	/* Check to see if we found a resource */
@@ -1142,15 +1142,15 @@ struct vme_resource *vme_lm_request(struct device *dev)
 		goto err_alloc;
 	}
 	resource->type = VME_LM;
-	resource->entry = &(allocated_lm->list);
+	resource->entry = &allocated_lm->list;
 
 	return resource;
 
 err_alloc:
 	/* Unlock image */
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 	lm->locked = 0;
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 err_lm:
 err_bus:
 	return NULL;
@@ -1270,7 +1270,7 @@ void vme_lm_free(struct vme_resource *resource)
 
 	lm = list_entry(resource->entry, struct vme_lm_resource, list);
 
-	mutex_lock(&(lm->mtx));
+	mutex_lock(&lm->mtx);
 
 	/* XXX
 	 * Check to see that there aren't any callbacks still attached, if
@@ -1279,7 +1279,7 @@ void vme_lm_free(struct vme_resource *resource)
 
 	lm->locked = 0;
 
-	mutex_unlock(&(lm->mtx));
+	mutex_unlock(&lm->mtx);
 
 	kfree(resource);
 }
@@ -1343,11 +1343,11 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	 * specification.
 	 */
 	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		memset(dev, 0, sizeof(struct device));
 
 		dev->parent = bridge->parent;
-		dev->bus = &(vme_bus_type);
+		dev->bus = &vme_bus_type;
 		/*
 		 * We save a pointer to the bridge in platform_data so that we
 		 * can get to it later. We keep driver_data for use by the
@@ -1366,7 +1366,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
 	i = VME_SLOTS_MAX;
 err_reg:
 	while (i > -1) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
 	vme_free_bus_num(bridge->num);
@@ -1381,7 +1381,7 @@ void vme_unregister_bridge(struct vme_bridge *bridge)
 
 
 	for (i = 0; i < VME_SLOTS_MAX; i++) {
-		dev = &(bridge->dev[i]);
+		dev = &bridge->dev[i];
 		device_unregister(dev);
 	}
 	vme_free_bus_num(bridge->num);
@@ -1418,7 +1418,7 @@ static int vme_calc_slot(struct device *dev)
 	/* Determine slot number */
 	num = 0;
 	while (num < VME_SLOTS_MAX) {
-		if (&(bridge->dev[num]) == dev)
+		if (&bridge->dev[num] == dev)
 			break;
 
 		num++;


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 02/17] staging/vme_user: return the appropriate error code when module_init fails
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
  2010-11-12 11:14               ` [PATCH 01/17] staging/vme: style: convert '&(foo)' to '&foo' Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 03/17] staging/vme_user: remove unreachable line Martyn Welch
                                 ` (15 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

When init_module fails, 0 is returned anyway; the module is then installed
and oopses when we try to remove it:

[ 3236.368009] WARNING: at drivers/base/driver.c:262 driver_unregister+0x36/0x6f()
[ 3236.368012] Hardware name:
[ 3236.368014] Unexpected driver unregister!
[ 3236.368016] Modules linked in: vme_user(-) vme_tsi148 vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: vme]
[ 3236.368027] Pid: 16162, comm: rmmod Not tainted 2.6.35 #2
[ 3236.368029] Call Trace:
[ 3236.368037]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
[ 3236.368044]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368049]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
[ 3236.368054]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368059]  [<ffffffff811e8f78>] driver_unregister+0x36/0x6f
[ 3236.368066]  [<ffffffffa004aa44>] vme_unregister_driver+0xd/0xf [vme]
[ 3236.368072]  [<ffffffffa00616c8>] vme_user_exit+0x10/0x1e [vme_user]
[ 3236.368076]  [<ffffffff810612c1>] sys_delete_module+0x1ba/0x226
[ 3236.368082]  [<ffffffff812d6e14>] ? do_page_fault+0x25d/0x28a
[ 3236.368088]  [<ffffffff8100202b>] system_call_fastpath+0x16/0x1b
[ 3236.368092] ---[ end trace cab6d88ebc44c1de ]---

The appended fixes it by returning the appropriate error code in module_init
whenever something goes wrong, thus cancelling the insertion of the module.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index cbe2e11..a6f6116 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -611,6 +611,7 @@ static int __init vme_user_init(void)
 	if (bus_num == 0) {
 		printk(KERN_ERR "%s: No cards, skipping registration\n",
 			driver_name);
+		retval = -ENODEV;
 		goto err_nocard;
 	}
 
@@ -629,6 +630,7 @@ static int __init vme_user_init(void)
 	if (ids == NULL) {
 		printk(KERN_ERR "%s: Unable to allocate ID table\n",
 			driver_name);
+		retval = -ENOMEM;
 		goto err_id;
 	}
 


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 03/17] staging/vme_user: remove unreachable line
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
  2010-11-12 11:14               ` [PATCH 01/17] staging/vme: style: convert '&(foo)' to '&foo' Martyn Welch
  2010-11-12 11:14               ` [PATCH 02/17] staging/vme_user: return the appropriate error code when module_init fails Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 04/17] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Martyn Welch
                                 ` (14 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index a6f6116..bdc4e1e 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -654,7 +654,6 @@ static int __init vme_user_init(void)
 
 	return retval;
 
-	vme_unregister_driver(&vme_user_driver);
 err_reg:
 	kfree(ids);
 err_id:


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 04/17] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (2 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 03/17] staging/vme_user: remove unreachable line Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 05/17] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Martyn Welch
                                 ` (13 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
---

 drivers/staging/vme/vme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 47e9d5c..d9fc864 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1326,7 +1326,7 @@ static int vme_alloc_bus_num(void)
 static void vme_free_bus_num(int bus)
 {
 	mutex_lock(&vme_bus_num_mtx);
-	vme_bus_numbers |= ~(0x1 << bus);
+	vme_bus_numbers &= ~(0x1 << bus);
 	mutex_unlock(&vme_bus_num_mtx);
 }
 


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 05/17] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (3 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 04/17] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 06/17] staging/vme/tsi148: remove double freeing of the IRQ " Martyn Welch
                                 ` (12 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

This fixes an oops when removing the module.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_tsi148.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 1cba1fa..5c25cd8 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2531,6 +2531,7 @@ err_struct:
 static void tsi148_remove(struct pci_dev *pdev)
 {
 	struct list_head *pos = NULL;
+	struct list_head *tmplist;
 	struct vme_master_resource *master_image;
 	struct vme_slave_resource *slave_image;
 	struct vme_dma_resource *dma_ctrlr;
@@ -2589,21 +2590,21 @@ static void tsi148_remove(struct pci_dev *pdev)
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->dma_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->dma_resources) {
 		dma_ctrlr = list_entry(pos, struct vme_dma_resource, list);
 		list_del(pos);
 		kfree(dma_ctrlr);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->slave_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->slave_resources) {
 		slave_image = list_entry(pos, struct vme_slave_resource, list);
 		list_del(pos);
 		kfree(slave_image);
 	}
 
 	/* resources are stored in link list */
-	list_for_each(pos, &tsi148_bridge->master_resources) {
+	list_for_each_safe(pos, tmplist, &tsi148_bridge->master_resources) {
 		master_image = list_entry(pos, struct vme_master_resource,
 			list);
 		list_del(pos);


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 06/17] staging/vme/tsi148: remove double freeing of the IRQ in .remove
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (4 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 05/17] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 07/17] staging/vme/tsi148: fix warning in free_irq Martyn Welch
                                 ` (11 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

tsi148_irq_exit is called twice in .remove, which causes an oops.

Remove the second call, which apart from being redundant cannot
possibly work; the CR/CSR space has been already unmapped.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_tsi148.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 5c25cd8..2f8f399 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2611,8 +2611,6 @@ static void tsi148_remove(struct pci_dev *pdev)
 		kfree(master_image);
 	}
 
-	tsi148_irq_exit(bridge, pdev);
-
 	iounmap(bridge->base);
 
 	pci_release_regions(pdev);


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 07/17] staging/vme/tsi148: fix warning in free_irq
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (5 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 06/17] staging/vme/tsi148: remove double freeing of the IRQ " Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:14               ` [PATCH 08/17] staging/vme/tsi148: remove unreachable line Martyn Welch
                                 ` (10 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

The cookie passed to request_irq isn't the same as the one passed
to free_irq, which results in the following warning:

[   63.243533] WARNING: at kernel/irq/manage.c:899 __free_irq+0x9b/0x17d()
[   63.243533] Hardware name:
[   63.243533] Trying to free already-free IRQ 17
[   63.243533] Modules linked in: vme_tsi148(-) vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: scsi_wait_scan]
[   63.243533] Pid: 2013, comm: rmmod Not tainted 2.6.35 #2
[   63.243533] Call Trace:
[   63.243533]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
[   63.243533]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
[   63.243533]  [<ffffffff810678c4>] __free_irq+0x9b/0x17d
[   63.243533]  [<ffffffff810679d9>] free_irq+0x33/0x4e
[   63.243533]  [<ffffffffa004a897>] tsi148_irq_exit+0x6b/0x70 [vme_tsi148]
[...]
[   63.243533] ---[ end trace bbf92311d969efb4 ]---

Fix it by passing the same cookie to both functions.

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/Module.symvers |    0 
 drivers/staging/vme/bridges/vme_tsi148.c   |   11 +++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
 create mode 100644 drivers/staging/vme/bridges/Module.symvers


diff --git a/drivers/staging/vme/bridges/Module.symvers b/drivers/staging/vme/bridges/Module.symvers
new file mode 100644
index 0000000..e69de29
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 2f8f399..70c9e41 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -374,8 +374,11 @@ static int tsi148_irq_init(struct vme_bridge *tsi148_bridge)
 	return 0;
 }
 
-static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
+static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge,
+	struct pci_dev *pdev)
 {
+	struct tsi148_driver *bridge = tsi148_bridge->driver_priv;
+
 	/* Turn off interrupts */
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEO);
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTEN);
@@ -384,7 +387,7 @@ static void tsi148_irq_exit(struct tsi148_driver *bridge, struct pci_dev *pdev)
 	iowrite32be(0xFFFFFFFF, bridge->base + TSI148_LCSR_INTC);
 
 	/* Detach interrupt handler */
-	free_irq(pdev->irq, pdev);
+	free_irq(pdev->irq, tsi148_bridge);
 }
 
 /*
@@ -2511,7 +2514,7 @@ err_master:
 		kfree(master_image);
 	}
 
-	tsi148_irq_exit(tsi148_device, pdev);
+	tsi148_irq_exit(tsi148_bridge, pdev);
 err_irq:
 err_test:
 	iounmap(tsi148_device->base);
@@ -2583,7 +2586,7 @@ static void tsi148_remove(struct pci_dev *pdev)
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM1);
 	iowrite32be(0x0, bridge->base + TSI148_LCSR_INTM2);
 
-	tsi148_irq_exit(bridge, pdev);
+	tsi148_irq_exit(tsi148_bridge, pdev);
 
 	vme_unregister_bridge(tsi148_bridge);
 


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 08/17] staging/vme/tsi148: remove unreachable line
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (6 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 07/17] staging/vme/tsi148: fix warning in free_irq Martyn Welch
@ 2010-11-12 11:14               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 09/17] staging/vme/tsi148: declare static functions as such Martyn Welch
                                 ` (9 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_tsi148.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 70c9e41..e79a5fa 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -2480,7 +2480,6 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	return 0;
 
-	vme_unregister_bridge(tsi148_bridge);
 err_reg:
 	tsi148_crcsr_exit(tsi148_bridge, pdev);
 err_crcsr:


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 09/17] staging/vme/tsi148: declare static functions as such
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (7 preceding siblings ...)
  2010-11-12 11:14               ` [PATCH 08/17] staging/vme/tsi148: remove unreachable line Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 10/17] staging/vme/ca91cx42: " Martyn Welch
                                 ` (8 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_tsi148.c |   43 +++++++++++++++---------------
 1 files changed, 22 insertions(+), 21 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index e79a5fa..9550b4a 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -393,7 +393,7 @@ static void tsi148_irq_exit(struct vme_bridge *tsi148_bridge,
 /*
  * Check to see if an IACk has been received, return true (1) or false (0).
  */
-int tsi148_iack_received(struct tsi148_driver *bridge)
+static int tsi148_iack_received(struct tsi148_driver *bridge)
 {
 	u32 tmp;
 
@@ -408,7 +408,7 @@ int tsi148_iack_received(struct tsi148_driver *bridge)
 /*
  * Configure VME interrupt
  */
-void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
+static void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
 	int state, int sync)
 {
 	struct pci_dev *pdev;
@@ -448,7 +448,8 @@ void tsi148_irq_set(struct vme_bridge *tsi148_bridge, int level,
  * Generate a VME bus interrupt at the requested level & vector. Wait for
  * interrupt to be acked.
  */
-int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level, int statid)
+static int tsi148_irq_generate(struct vme_bridge *tsi148_bridge, int level,
+	int statid)
 {
 	u32 tmp;
 	struct tsi148_driver *bridge;
@@ -548,7 +549,7 @@ static void tsi148_clear_errors(struct vme_bridge *tsi148_bridge,
 /*
  * Initialize a slave window with the requested attributes.
  */
-int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
+static int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
 {
@@ -698,7 +699,7 @@ int tsi148_slave_set(struct vme_slave_resource *image, int enabled,
 /*
  * Get slave window configuration.
  */
-int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
+static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
@@ -894,7 +895,7 @@ static void tsi148_free_resource(struct vme_master_resource *image)
 /*
  * Set the attributes of an outbound window.
  */
-int tsi148_master_set(struct vme_master_resource *image, int enabled,
+static int tsi148_master_set(struct vme_master_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
 {
@@ -1130,7 +1131,7 @@ err_window:
  *
  * XXX Not parsing prefetch information.
  */
-int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
+static int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -1240,7 +1241,7 @@ int __tsi148_master_get(struct vme_master_resource *image, int *enabled,
 }
 
 
-int tsi148_master_get(struct vme_master_resource *image, int *enabled,
+static int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -1256,7 +1257,7 @@ int tsi148_master_get(struct vme_master_resource *image, int *enabled,
 	return retval;
 }
 
-ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
+static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	int retval, enabled;
@@ -1298,7 +1299,7 @@ skip_chk:
 }
 
 
-ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
+static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
 	size_t count, loff_t offset)
 {
 	int retval = 0, enabled;
@@ -1365,7 +1366,7 @@ skip_chk:
  *
  * Requires a previously configured master window, returns final value.
  */
-unsigned int tsi148_master_rmw(struct vme_master_resource *image,
+static unsigned int tsi148_master_rmw(struct vme_master_resource *image,
 	unsigned int mask, unsigned int compare, unsigned int swap,
 	loff_t offset)
 {
@@ -1612,8 +1613,8 @@ static int tsi148_dma_set_vme_dest_attributes(struct device *dev, u32 *attr,
 /*
  * Add a link list descriptor to the list
  */
-int tsi148_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
-	struct vme_dma_attr *dest, size_t count)
+static int tsi148_dma_list_add(struct vme_dma_list *list,
+	struct vme_dma_attr *src, struct vme_dma_attr *dest, size_t count)
 {
 	struct tsi148_dma_entry *entry, *prev;
 	u32 address_high, address_low;
@@ -1785,7 +1786,7 @@ static int tsi148_dma_busy(struct vme_bridge *tsi148_bridge, int channel)
  *
  * XXX Need to provide control register configuration.
  */
-int tsi148_dma_list_exec(struct vme_dma_list *list)
+static int tsi148_dma_list_exec(struct vme_dma_list *list)
 {
 	struct vme_dma_resource *ctrlr;
 	int channel, retval = 0;
@@ -1865,7 +1866,7 @@ int tsi148_dma_list_exec(struct vme_dma_list *list)
  *
  * We have a separate function, don't assume that the chain can't be reused.
  */
-int tsi148_dma_list_empty(struct vme_dma_list *list)
+static int tsi148_dma_list_empty(struct vme_dma_list *list)
 {
 	struct list_head *pos, *temp;
 	struct tsi148_dma_entry *entry;
@@ -1887,7 +1888,7 @@ int tsi148_dma_list_empty(struct vme_dma_list *list)
  * This does not enable the LM monitor - that should be done when the first
  * callback is attached and disabled when the last callback is removed.
  */
-int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
+static int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 	vme_address_t aspace, vme_cycle_t cycle)
 {
 	u32 lm_base_high, lm_base_low, lm_ctl = 0;
@@ -1954,8 +1955,8 @@ int tsi148_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 /* Get configuration of the callback monitor and return whether it is enabled
  * or disabled.
  */
-int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
-	vme_address_t *aspace, vme_cycle_t *cycle)
+static int tsi148_lm_get(struct vme_lm_resource *lm,
+	unsigned long long *lm_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
 	u32 lm_base_high, lm_base_low, lm_ctl, enabled = 0;
 	struct tsi148_driver *bridge;
@@ -2005,7 +2006,7 @@ int tsi148_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
  *
  * Callback will be passed the monitor triggered.
  */
-int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
+static int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 	void (*callback)(int))
 {
 	u32 lm_ctl, tmp;
@@ -2060,7 +2061,7 @@ int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor,
 /*
  * Detach a callback function forn a specific location monitor.
  */
-int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
+static int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 {
 	u32 lm_en, tmp;
 	struct tsi148_driver *bridge;
@@ -2100,7 +2101,7 @@ int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor)
 /*
  * Determine Geographical Addressing
  */
-int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
+static int tsi148_slot_get(struct vme_bridge *tsi148_bridge)
 {
 	u32 slot = 0;
 	struct tsi148_driver *bridge;


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 10/17] staging/vme/ca91cx42: declare static functions as such
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (8 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 09/17] staging/vme/tsi148: declare static functions as such Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 11/17] staging/vme_user: declare private variables as static Martyn Welch
                                 ` (7 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_ca91cx42.c |   52 ++++++++++++++--------------
 1 files changed, 26 insertions(+), 26 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index 1f2089f..3ddc93b 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -259,8 +259,8 @@ static void ca91cx42_irq_exit(struct ca91cx42_driver *bridge,
 /*
  * Set up an VME interrupt
  */
-void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
-	int sync)
+static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level,
+	int state, int sync)
 
 {
 	struct pci_dev *pdev;
@@ -287,7 +287,7 @@ void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level, int state,
 	}
 }
 
-int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
+static int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	int statid)
 {
 	u32 tmp;
@@ -323,7 +323,7 @@ int ca91cx42_irq_generate(struct vme_bridge *ca91cx42_bridge, int level,
 	return 0;
 }
 
-int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
+static int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	dma_addr_t pci_base, vme_address_t aspace, vme_cycle_t cycle)
 {
@@ -429,7 +429,7 @@ int ca91cx42_slave_set(struct vme_slave_resource *image, int enabled,
 	return 0;
 }
 
-int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
+static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	dma_addr_t *pci_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
@@ -584,7 +584,7 @@ static void ca91cx42_free_resource(struct vme_master_resource *image)
 }
 
 
-int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
+static int ca91cx42_master_set(struct vme_master_resource *image, int enabled,
 	unsigned long long vme_base, unsigned long long size,
 	vme_address_t aspace, vme_cycle_t cycle, vme_width_t dwidth)
 {
@@ -741,8 +741,8 @@ err_window:
 	return retval;
 }
 
-int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
-	unsigned long long *vme_base, unsigned long long *size,
+static int __ca91cx42_master_get(struct vme_master_resource *image,
+	int *enabled, unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
 	unsigned int i, ctl;
@@ -828,7 +828,7 @@ int __ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	return 0;
 }
 
-int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
+static int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	unsigned long long *vme_base, unsigned long long *size,
 	vme_address_t *aspace, vme_cycle_t *cycle, vme_width_t *dwidth)
 {
@@ -844,8 +844,8 @@ int ca91cx42_master_get(struct vme_master_resource *image, int *enabled,
 	return retval;
 }
 
-ssize_t ca91cx42_master_read(struct vme_master_resource *image, void *buf,
-	size_t count, loff_t offset)
+static ssize_t ca91cx42_master_read(struct vme_master_resource *image,
+	void *buf, size_t count, loff_t offset)
 {
 	ssize_t retval;
 	void *addr = image->kern_base + offset;
@@ -904,8 +904,8 @@ out:
 	return retval;
 }
 
-ssize_t ca91cx42_master_write(struct vme_master_resource *image, void *buf,
-	size_t count, loff_t offset)
+static ssize_t ca91cx42_master_write(struct vme_master_resource *image,
+	void *buf, size_t count, loff_t offset)
 {
 	ssize_t retval;
 	void *addr = image->kern_base + offset;
@@ -959,7 +959,7 @@ out:
 	return retval;
 }
 
-unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
+static unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
 	unsigned int mask, unsigned int compare, unsigned int swap,
 	loff_t offset)
 {
@@ -1015,8 +1015,8 @@ out:
 	return result;
 }
 
-int ca91cx42_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src,
-	struct vme_dma_attr *dest, size_t count)
+static int ca91cx42_dma_list_add(struct vme_dma_list *list,
+	struct vme_dma_attr *src, struct vme_dma_attr *dest, size_t count)
 {
 	struct ca91cx42_dma_entry *entry, *prev;
 	struct vme_dma_pci *pci_attr;
@@ -1176,7 +1176,7 @@ static int ca91cx42_dma_busy(struct vme_bridge *ca91cx42_bridge)
 		return 1;
 }
 
-int ca91cx42_dma_list_exec(struct vme_dma_list *list)
+static int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 {
 	struct vme_dma_resource *ctrlr;
 	struct ca91cx42_dma_entry *entry;
@@ -1258,7 +1258,7 @@ int ca91cx42_dma_list_exec(struct vme_dma_list *list)
 
 }
 
-int ca91cx42_dma_list_empty(struct vme_dma_list *list)
+static int ca91cx42_dma_list_empty(struct vme_dma_list *list)
 {
 	struct list_head *pos, *temp;
 	struct ca91cx42_dma_entry *entry;
@@ -1280,8 +1280,8 @@ int ca91cx42_dma_list_empty(struct vme_dma_list *list)
  * This does not enable the LM monitor - that should be done when the first
  * callback is attached and disabled when the last callback is removed.
  */
-int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
-	vme_address_t aspace, vme_cycle_t cycle)
+static int ca91cx42_lm_set(struct vme_lm_resource *lm,
+	unsigned long long lm_base, vme_address_t aspace, vme_cycle_t cycle)
 {
 	u32 temp_base, lm_ctl = 0;
 	int i;
@@ -1348,8 +1348,8 @@ int ca91cx42_lm_set(struct vme_lm_resource *lm, unsigned long long lm_base,
 /* Get configuration of the callback monitor and return whether it is enabled
  * or disabled.
  */
-int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
-	vme_address_t *aspace, vme_cycle_t *cycle)
+static int ca91cx42_lm_get(struct vme_lm_resource *lm,
+	unsigned long long *lm_base, vme_address_t *aspace, vme_cycle_t *cycle)
 {
 	u32 lm_ctl, enabled = 0;
 	struct ca91cx42_driver *bridge;
@@ -1391,7 +1391,7 @@ int ca91cx42_lm_get(struct vme_lm_resource *lm, unsigned long long *lm_base,
  *
  * Callback will be passed the monitor triggered.
  */
-int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
+static int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 	void (*callback)(int))
 {
 	u32 lm_ctl, tmp;
@@ -1440,7 +1440,7 @@ int ca91cx42_lm_attach(struct vme_lm_resource *lm, int monitor,
 /*
  * Detach a callback function forn a specific location monitor.
  */
-int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
+static int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 {
 	u32 tmp;
 	struct ca91cx42_driver *bridge;
@@ -1473,7 +1473,7 @@ int ca91cx42_lm_detach(struct vme_lm_resource *lm, int monitor)
 	return 0;
 }
 
-int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
+static int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
 {
 	u32 slot = 0;
 	struct ca91cx42_driver *bridge;
@@ -1832,7 +1832,7 @@ err_struct:
 
 }
 
-void ca91cx42_remove(struct pci_dev *pdev)
+static void ca91cx42_remove(struct pci_dev *pdev)
 {
 	struct list_head *pos = NULL;
 	struct vme_master_resource *master_image;


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 11/17] staging/vme_user: declare private variables as static
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (9 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 10/17] staging/vme/ca91cx42: " Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 12/17] staging/vme_user: use an unsigned int for counting the number of kparams Martyn Welch
                                 ` (6 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index bdc4e1e..f7fa02d 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -114,9 +114,9 @@ typedef struct {
 } driver_stats_t;
 static driver_stats_t statistics;
 
-struct cdev *vme_user_cdev;		/* Character device */
-struct class *vme_user_sysfs_class;	/* Sysfs class */
-struct device *vme_user_bridge;		/* Pointer to the bridge device */
+static struct cdev *vme_user_cdev;		/* Character device */
+static struct class *vme_user_sysfs_class;	/* Sysfs class */
+static struct device *vme_user_bridge;		/* Pointer to bridge device */
 
 
 static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 12/17] staging/vme_user: use an unsigned int for counting the number of kparams
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (10 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 11/17] staging/vme_user: declare private variables as static Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 13/17] staging/vme_user: remove __iomem marking from kern_buf and derivates Martyn Welch
                                 ` (5 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

unsigned int is what struct kparam_array internally uses.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index f7fa02d..7c61adc 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -44,7 +44,7 @@ static DEFINE_MUTEX(vme_user_mutex);
 static char driver_name[] = "vme_user";
 
 static int bus[USER_BUS_MAX];
-static int bus_num;
+static unsigned int bus_num;
 
 /* Currently Documentation/devices.txt defines the following for VME:
  *


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 13/17] staging/vme_user: remove __iomem marking from kern_buf and derivates
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (11 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 12/17] staging/vme_user: use an unsigned int for counting the number of kparams Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 14/17] staging/vme_user: mark user-space buffers with __user Martyn Welch
                                 ` (4 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

kern_buf is not iomem; it comes from kmalloc and is directly
dereferenced.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 7c61adc..5d3a39b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -92,7 +92,7 @@ static unsigned int bus_num;
  * Structure to handle image related parameters.
  */
 typedef struct {
-	void __iomem *kern_buf;	/* Buffer address in kernel space */
+	void *kern_buf;	/* Buffer address in kernel space */
 	dma_addr_t pci_buf;	/* Buffer address in PCI address space */
 	unsigned long long size_buf;	/* Buffer size */
 	struct semaphore sem;	/* Semaphore for locking image */
@@ -277,7 +277,7 @@ static ssize_t resource_from_user(unsigned int minor, const char *buf,
 static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 	size_t count, loff_t *ppos)
 {
-	void __iomem *image_ptr;
+	void *image_ptr;
 	ssize_t retval;
 
 	image_ptr = image[minor].kern_buf + *ppos;
@@ -296,7 +296,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 static ssize_t buffer_from_user(unsigned int minor, const char *buf,
 	size_t count, loff_t *ppos)
 {
-	void __iomem *image_ptr;
+	void *image_ptr;
 	size_t retval;
 
 	image_ptr = image[minor].kern_buf + *ppos;


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 14/17] staging/vme_user: mark user-space buffers with __user
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (12 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 13/17] staging/vme_user: remove __iomem marking from kern_buf and derivates Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 15/17] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Martyn Welch
                                 ` (3 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 5d3a39b..3638148 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -129,8 +129,9 @@ static const int type[VME_DEVS] = {	MASTER_MINOR,	MASTER_MINOR,
 
 static int vme_user_open(struct inode *, struct file *);
 static int vme_user_release(struct inode *, struct file *);
-static ssize_t vme_user_read(struct file *, char *, size_t, loff_t *);
-static ssize_t vme_user_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t vme_user_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t vme_user_write(struct file *, const char __user *, size_t,
+	loff_t *);
 static loff_t vme_user_llseek(struct file *, loff_t, int);
 static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 
@@ -246,7 +247,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count,
  * page) transfers will lock the user space buffer into memory and then
  * transfer the data directly from the user space buffers out to VME.
  */
-static ssize_t resource_from_user(unsigned int minor, const char *buf,
+static ssize_t resource_from_user(unsigned int minor, const char __user *buf,
 	size_t count, loff_t *ppos)
 {
 	ssize_t retval;
@@ -293,7 +294,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf,
 	return retval;
 }
 
-static ssize_t buffer_from_user(unsigned int minor, const char *buf,
+static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
 	size_t count, loff_t *ppos)
 {
 	void *image_ptr;
@@ -312,7 +313,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char *buf,
 	return retval;
 }
 
-static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
+static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
 			loff_t *ppos)
 {
 	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
@@ -356,8 +357,8 @@ static ssize_t vme_user_read(struct file *file, char *buf, size_t count,
 	return retval;
 }
 
-static ssize_t vme_user_write(struct file *file, const char *buf, size_t count,
-			 loff_t *ppos)
+static ssize_t vme_user_write(struct file *file, const char __user *buf,
+			size_t count, loff_t *ppos)
 {
 	unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
 	ssize_t retval;
@@ -455,6 +456,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	unsigned int minor = MINOR(inode->i_rdev);
 	int retval;
 	dma_addr_t pci_addr;
+	void __user *argp = (void __user *)arg;
 
 	statistics.ioctls++;
 
@@ -474,7 +476,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				&master.size, &master.aspace,
 				&master.cycle, &master.dwidth);
 
-			copied = copy_to_user((char *)arg, &master,
+			copied = copy_to_user(argp, &master,
 				sizeof(struct vme_master));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy to "
@@ -487,8 +489,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 		case VME_SET_MASTER:
 
-			copied = copy_from_user(&master, (char *)arg,
-				sizeof(master));
+			copied = copy_from_user(&master, argp, sizeof(master));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from "
 					"userspace\n");
@@ -518,7 +519,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 				&slave.size, &pci_addr, &slave.aspace,
 				&slave.cycle);
 
-			copied = copy_to_user((char *)arg, &slave,
+			copied = copy_to_user(argp, &slave,
 				sizeof(struct vme_slave));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy to "
@@ -531,8 +532,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 
 		case VME_SET_SLAVE:
 
-			copied = copy_from_user(&slave, (char *)arg,
-				sizeof(slave));
+			copied = copy_from_user(&slave, argp, sizeof(slave));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from "
 					"userspace\n");


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 15/17] staging/vme: mark struct vme_master_resource's base address pointer as __iomem
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (13 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 14/17] staging/vme_user: mark user-space buffers with __user Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 16/17] staging/vme/tsi148: mark the registers' " Martyn Welch
                                 ` (2 subsequent siblings)
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/vme_bridge.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/vme_bridge.h b/drivers/staging/vme/vme_bridge.h
index b653ec0..4c6ec31 100644
--- a/drivers/staging/vme/vme_bridge.h
+++ b/drivers/staging/vme/vme_bridge.h
@@ -20,7 +20,7 @@ struct vme_master_resource {
 	vme_cycle_t cycle_attr;
 	vme_width_t width_attr;
 	struct resource bus_resource;
-	void *kern_base;
+	void __iomem *kern_base;
 };
 
 struct vme_slave_resource {


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 16/17] staging/vme/tsi148: mark the registers' base address pointer as __iomem
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (14 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 15/17] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:15               ` [PATCH 17/17] staging/vme/ca91cx42: " Martyn Welch
  2010-11-12 11:23               ` [PATCH 00/17] Series short description Martyn Welch
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_tsi148.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_tsi148.h b/drivers/staging/vme/bridges/vme_tsi148.h
index bda64ef..9f97fa8 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.h
+++ b/drivers/staging/vme/bridges/vme_tsi148.h
@@ -35,7 +35,7 @@
 
 /* Structure used to hold driver specific information */
 struct tsi148_driver {
-	void *base;	/* Base Address of device registers */
+	void __iomem *base;	/* Base Address of device registers */
 	wait_queue_head_t dma_queue[2];
 	wait_queue_head_t iack_queue;
 	void (*lm_callback[4])(int);	/* Called in interrupt handler */


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 17/17] staging/vme/ca91cx42: mark the registers' base address pointer as __iomem
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (15 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 16/17] staging/vme/tsi148: mark the registers' " Martyn Welch
@ 2010-11-12 11:15               ` Martyn Welch
  2010-11-12 11:23               ` [PATCH 00/17] Series short description Martyn Welch
  17 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:15 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/bridges/vme_ca91cx42.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.h b/drivers/staging/vme/bridges/vme_ca91cx42.h
index e72c65b..02a7c79 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.h
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.h
@@ -39,7 +39,7 @@
 
 /* Structure used to hold driver specific information */
 struct ca91cx42_driver {
-	void *base;	/* Base Address of device registers */
+	void __iomem *base;	/* Base Address of device registers */
 	wait_queue_head_t dma_queue;
 	wait_queue_head_t iack_queue;
 	wait_queue_head_t mbox_queue;


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 00/17] Series short description
  2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
                                 ` (16 preceding siblings ...)
  2010-11-12 11:15               ` [PATCH 17/17] staging/vme/ca91cx42: " Martyn Welch
@ 2010-11-12 11:23               ` Martyn Welch
  2010-11-12 15:11                 ` Emilio G. Cota
  2010-11-16 19:40                 ` Greg KH
  17 siblings, 2 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 11:23 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML



On 12/11/10 11:13, Martyn Welch wrote:
> The following series implements...
> 

Grr. Stacked GIT decided to send the cover before I'd finished writing
it! What I meant to say is:

Hi Greg,

Here's the series of patches from Emilio I have been through and Acked.

Sorry for not sending this sooner, bad health kept me from work. I have
promised to work through the remaining patches for Emilio, however the
absence from work and work commitments means this is going to take a
little longer than I had hoped (sorry Emilio). It is on my "todo" list.

I have applied minor edits to some of the patches to remove checkpatch
warnings, stacked git has the habit of correcting chunk offsets (which
may occur when re-ordering patches etc.), but I believe the others are
as sent by Emilio (with the addition of my ack).

Martyn

-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 00/17] Series short description
  2010-11-12 11:23               ` [PATCH 00/17] Series short description Martyn Welch
@ 2010-11-12 15:11                 ` Emilio G. Cota
  2010-11-12 15:52                   ` Martyn Welch
  2010-11-16 19:40                 ` Greg KH
  1 sibling, 1 reply; 91+ messages in thread
From: Emilio G. Cota @ 2010-11-12 15:11 UTC (permalink / raw)
  To: Martyn Welch; +Cc: Greg KH, devel, Juan David Gonzalez Cobas, LKML

On Fri, Nov 12, 2010 at 11:23:13 +0000, Martyn Welch wrote:
> Hi Greg,
> 
> Here's the series of patches from Emilio I have been through and Acked.
> 
> Sorry for not sending this sooner, bad health kept me from work. I have
> promised to work through the remaining patches for Emilio, however the
> absence from work and work commitments means this is going to take a
> little longer than I had hoped (sorry Emilio). It is on my "todo" list.

Don't worry, as I said there's no rush in getting this merged (in
production we're still using a fairly old kernel).

Hope you're well now.

> I have applied minor edits to some of the patches to remove checkpatch
> warnings, stacked git has the habit of correcting chunk offsets (which
> may occur when re-ordering patches etc.), but I believe the others are
> as sent by Emilio (with the addition of my ack).

Just FYI, if those checkpatch warnings were about lines exceeding 80
characters, I consciously ignored them. After reading this[1] message I
stopped trimming long lines, especially if they're just a few characters
over the magic number.

Anyway this is just code formatting, either way is fine with me.

Thanks,

		Emilio

[1] http://lkml.org/lkml/2009/12/17/229


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

* Re: [PATCH 00/17] Series short description
  2010-11-12 15:11                 ` Emilio G. Cota
@ 2010-11-12 15:52                   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-11-12 15:52 UTC (permalink / raw)
  To: Emilio G. Cota; +Cc: Greg KH, devel, Juan David Gonzalez Cobas, LKML

On 12/11/10 15:11, Emilio G. Cota wrote:
> On Fri, Nov 12, 2010 at 11:23:13 +0000, Martyn Welch wrote:
>> Hi Greg,
>>
>> Here's the series of patches from Emilio I have been through and Acked.
>>
>> Sorry for not sending this sooner, bad health kept me from work. I have
>> promised to work through the remaining patches for Emilio, however the
>> absence from work and work commitments means this is going to take a
>> little longer than I had hoped (sorry Emilio). It is on my "todo" list.
> 
> Don't worry, as I said there's no rush in getting this merged (in
> production we're still using a fairly old kernel).
> 
> Hope you're well now.
> 

Getting there cheers, I'm off the hardcore pain-killers, not in
excruciating pain and fed up with day-time TV, so back at work ;)

>> I have applied minor edits to some of the patches to remove checkpatch
>> warnings, stacked git has the habit of correcting chunk offsets (which
>> may occur when re-ordering patches etc.), but I believe the others are
>> as sent by Emilio (with the addition of my ack).
> 
> Just FYI, if those checkpatch warnings were about lines exceeding 80
> characters, I consciously ignored them. After reading this[1] message I
> stopped trimming long lines, especially if they're just a few characters
> over the magic number.
> 

Yeah they were. I have a little python GUI I knocked up to help make
sure I send patch series correctly and don't have to keep working out
the options I need (long way from perfect yet), it refuses to allow me
to send if check patch doesn't pass and the few warnings were easier to
deal with than looking at improving the GUI!

Martyn

> Anyway this is just code formatting, either way is fine with me.
> 
> Thanks,
> 
> 		Emilio
> 
> [1] http://lkml.org/lkml/2009/12/17/229
> 


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH 00/17] Series short description
  2010-11-12 11:23               ` [PATCH 00/17] Series short description Martyn Welch
  2010-11-12 15:11                 ` Emilio G. Cota
@ 2010-11-16 19:40                 ` Greg KH
  1 sibling, 0 replies; 91+ messages in thread
From: Greg KH @ 2010-11-16 19:40 UTC (permalink / raw)
  To: Martyn Welch; +Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML

On Fri, Nov 12, 2010 at 11:23:13AM +0000, Martyn Welch wrote:
> 
> 
> On 12/11/10 11:13, Martyn Welch wrote:
> > The following series implements...
> > 
> 
> Grr. Stacked GIT decided to send the cover before I'd finished writing
> it! What I meant to say is:
> 
> Hi Greg,
> 
> Here's the series of patches from Emilio I have been through and Acked.

Heh, no problem, all applied and pushed out now.

thanks,

greg k-h

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

* [PATCH] staging/vme_user: fix usage of the slave resources after they've been freed
  2010-10-26  1:11 ` [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed Emilio G. Cota
@ 2010-12-03  9:05   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-12-03  9:05 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Emilio G. Cota, LKML, Bill Pemberton

From: Emilio G. Cota <cota@braap.org>

buf_unalloc() frees the memory buffers allocated with vme_alloc_consistent.
The associated VME resource is needed in both vme_alloc_consistent and
vme_free_consistent; however the slave VME resources are being freed before
the calls to vme_free_consistent are made, which means the buffers
are never returned.

Fix this by freeing the VME resources only after the consistent buffers have
been returned.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 3638148..dc7175b 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -829,8 +829,8 @@ err_master:
 err_slave:
 	while (i > SLAVE_MINOR) {
 		i--;
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 err_class:
 	cdev_del(vme_user_cdev);
@@ -855,8 +855,8 @@ static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
 		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);
-		vme_slave_free(image[i].resource);
 		buf_unalloc(i);
+		vme_slave_free(image[i].resource);
 	}
 
 	/* Unregister device driver */


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH] staging/vme/vme_user: use __dev{init, exit} for .probe and .remove
  2010-10-26  1:11 ` [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove Emilio G. Cota
@ 2010-12-03 13:44   ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-12-03 13:44 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Bill Pemberton, Emilio G. Cota, LKML

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: Fixed checkpatch line length warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index dc7175b..db445ed 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -135,8 +135,8 @@ static ssize_t vme_user_write(struct file *, const char __user *, size_t,
 static loff_t vme_user_llseek(struct file *, loff_t, int);
 static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long);
 
-static int __init vme_user_probe(struct device *, int, int);
-static int __exit vme_user_remove(struct device *, int, int);
+static int __devinit vme_user_probe(struct device *, int, int);
+static int __devexit vme_user_remove(struct device *, int, int);
 
 static struct file_operations vme_user_fops = {
 	.open = vme_user_open,
@@ -596,7 +596,7 @@ static void buf_unalloc(int num)
 static struct vme_driver vme_user_driver = {
 	.name = driver_name,
 	.probe = vme_user_probe,
-	.remove = vme_user_remove,
+	.remove = __devexit_p(vme_user_remove),
 };
 
 
@@ -666,7 +666,8 @@ err_nocard:
  * as practical. We will therefore reserve the buffers and request the images
  * here so that we don't have to do it later.
  */
-static int __init vme_user_probe(struct device *dev, int cur_bus, int cur_slot)
+static int __devinit vme_user_probe(struct device *dev, int cur_bus,
+	int cur_slot)
 {
 	int i, err;
 	char name[12];
@@ -841,7 +842,8 @@ err_dev:
 	return err;
 }
 
-static int __exit vme_user_remove(struct device *dev, int cur_bus, int cur_slot)
+static int __devexit vme_user_remove(struct device *dev, int cur_bus,
+	int cur_slot)
 {
 	int i;
 


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH] staging/vme_user: add missing calls to vme_master_free calls in .remove
  2010-10-26  1:11 ` [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove Emilio G. Cota
@ 2010-12-03 14:20   ` Martyn Welch
  2010-12-03 14:44     ` Greg KH
  0 siblings, 1 reply; 91+ messages in thread
From: Martyn Welch @ 2010-12-03 14:20 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Bill Pemberton, Emilio G. Cota, LKML

From: Emilio G. Cota <cota@braap.org>

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
---

 drivers/staging/vme/devices/vme_user.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index db445ed..a571173 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -852,8 +852,10 @@ static int __devexit vme_user_remove(struct device *dev, int cur_bus,
 		device_destroy(vme_user_sysfs_class, MKDEV(VME_MAJOR, i));
 	class_destroy(vme_user_sysfs_class);
 
-	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++)
+	for (i = MASTER_MINOR; i < (MASTER_MAX + 1); i++) {
 		kfree(image[i].kern_buf);
+		vme_master_free(image[i].resource);
+	}
 
 	for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
 		vme_slave_set(image[i].resource, 0, 0, 0, 0, VME_A32, 0);


--
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* Re: [PATCH] staging/vme_user: add missing calls to vme_master_free calls in .remove
  2010-12-03 14:20   ` [PATCH] " Martyn Welch
@ 2010-12-03 14:44     ` Greg KH
  2010-12-03 15:29       ` Martyn Welch
  0 siblings, 1 reply; 91+ messages in thread
From: Greg KH @ 2010-12-03 14:44 UTC (permalink / raw)
  To: Martyn Welch
  Cc: devel, Juan David Gonzalez Cobas, Bill Pemberton, Emilio G. Cota, LKML

On Fri, Dec 03, 2010 at 02:20:51PM +0000, Martyn Welch wrote:
> From: Emilio G. Cota <cota@braap.org>
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> Acked-by: Martyn Welch <martyn.welch@ge.com>
> ---

Does this need to be in .37 or can it wait for .38?

thanks,

greg k-h

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

* Re: [PATCH] staging/vme_user: add missing calls to vme_master_free calls in .remove
  2010-12-03 14:44     ` Greg KH
@ 2010-12-03 15:29       ` Martyn Welch
  0 siblings, 0 replies; 91+ messages in thread
From: Martyn Welch @ 2010-12-03 15:29 UTC (permalink / raw)
  To: Greg KH
  Cc: devel, Juan David Gonzalez Cobas, Bill Pemberton, Emilio G. Cota, LKML

On 03/12/10 14:44, Greg KH wrote:
> On Fri, Dec 03, 2010 at 02:20:51PM +0000, Martyn Welch wrote:
>> From: Emilio G. Cota <cota@braap.org>
>>
>> Signed-off-by: Emilio G. Cota <cota@braap.org>
>> Acked-by: Martyn Welch <martyn.welch@ge.com>
>> ---
> 
> Does this need to be in .37 or can it wait for .38?
> 

Given that this is in the vme_user device in the staging tree, I think
it can safely wait until .38.

Martyn

> thanks,
> 
> greg k-h


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square,
Manchester,
E martyn.welch@ge.com                        |   M2 3AB  VAT:GB 927559189

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

* [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP
  2010-10-22  6:36 [-next] " Emilio G. Cota
@ 2010-10-22  6:36 ` Emilio G. Cota
  0 siblings, 0 replies; 91+ messages in thread
From: Emilio G. Cota @ 2010-10-22  6:36 UTC (permalink / raw)
  To: Greg KH; +Cc: Martyn Welch, LKML, Juan David Gonzalez Cobas

From: Emilio G. Cota <cota@braap.org>

Without it we get 32 warnings, one per device being released, when
removing a bridge module.

After applying this patch, bridge modules can at last be removed
without any apparent hiccup.

[Note: tested only on the tsi148, it's the only bridge I've got]

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 drivers/staging/vme/vme.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index afd2dbd..59650dd 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1352,6 +1352,11 @@ static void vme_free_bus_num(int bus)
 	mutex_unlock(&vme_bus_num_mtx);
 }
 
+/* Note: device_release(dev) throws a warning if dev->release isn't filled in */
+static void vme_dev_release(struct device *dev)
+{
+}
+
 int vme_register_bridge(struct vme_bridge *bridge)
 {
 	struct device *dev;
@@ -1372,6 +1377,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
 
 		dev->parent = bridge->parent;
 		dev->bus = &vme_bus_type;
+		dev->release = vme_dev_release;
 		/*
 		 * We save a pointer to the bridge in platform_data so that we
 		 * can get to it later. We keep driver_data for use by the
-- 
1.7.1


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

end of thread, other threads:[~2010-12-03 15:29 UTC | newest]

Thread overview: 91+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-26  1:10 [re-send][-next] staging/vme: various fixes + new driver model for VME Emilio G. Cota
2010-10-26  1:10 ` [PATCH 01/30] staging/vme: style: convert '&(foo)' to '&foo' Emilio G. Cota
2010-10-27  9:17   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 02/30] staging/vme_user: return the appropriate error code when module_init fails Emilio G. Cota
2010-10-27  9:25   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 03/30] staging/vme_user: remove unreachable line Emilio G. Cota
2010-10-27  9:39   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 04/30] staging/vme: allow non-dynamic allocation of bus numbers Emilio G. Cota
2010-10-27  9:41   ` Martyn Welch
2010-10-27 15:13     ` Emilio G. Cota
2010-11-04  3:40       ` Emilio G. Cota
2010-11-05 16:29         ` Martyn Welch
2010-10-26  1:10 ` [PATCH 05/30] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Emilio G. Cota
2010-10-27  9:49   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 06/30] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Emilio G. Cota
2010-10-27  9:51   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 07/30] staging/vme/tsi148: remove double freeing of the IRQ " Emilio G. Cota
2010-10-27 10:01   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 08/30] staging/vme/tsi148: fix warning in free_irq Emilio G. Cota
2010-10-27 10:23   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota
2010-10-27 10:54   ` Martyn Welch
2010-10-27 14:46     ` Emilio G. Cota
2010-10-27 15:03       ` Martyn Welch
2010-10-27 15:15         ` Emilio G. Cota
2010-10-28  1:17       ` Greg KH
2010-10-28  6:07         ` Emilio G. Cota
2010-10-28 17:56           ` Greg KH
2010-11-12 11:13             ` [PATCH 00/17] Series short description Martyn Welch
2010-11-12 11:14               ` [PATCH 01/17] staging/vme: style: convert '&(foo)' to '&foo' Martyn Welch
2010-11-12 11:14               ` [PATCH 02/17] staging/vme_user: return the appropriate error code when module_init fails Martyn Welch
2010-11-12 11:14               ` [PATCH 03/17] staging/vme_user: remove unreachable line Martyn Welch
2010-11-12 11:14               ` [PATCH 04/17] staging/vme: fix bogus clearing of the bus number in vme_free_bus_num Martyn Welch
2010-11-12 11:14               ` [PATCH 05/17] staging/vme/tsi148: use list_for_each_safe when deleting resources in .remove Martyn Welch
2010-11-12 11:14               ` [PATCH 06/17] staging/vme/tsi148: remove double freeing of the IRQ " Martyn Welch
2010-11-12 11:14               ` [PATCH 07/17] staging/vme/tsi148: fix warning in free_irq Martyn Welch
2010-11-12 11:14               ` [PATCH 08/17] staging/vme/tsi148: remove unreachable line Martyn Welch
2010-11-12 11:15               ` [PATCH 09/17] staging/vme/tsi148: declare static functions as such Martyn Welch
2010-11-12 11:15               ` [PATCH 10/17] staging/vme/ca91cx42: " Martyn Welch
2010-11-12 11:15               ` [PATCH 11/17] staging/vme_user: declare private variables as static Martyn Welch
2010-11-12 11:15               ` [PATCH 12/17] staging/vme_user: use an unsigned int for counting the number of kparams Martyn Welch
2010-11-12 11:15               ` [PATCH 13/17] staging/vme_user: remove __iomem marking from kern_buf and derivates Martyn Welch
2010-11-12 11:15               ` [PATCH 14/17] staging/vme_user: mark user-space buffers with __user Martyn Welch
2010-11-12 11:15               ` [PATCH 15/17] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Martyn Welch
2010-11-12 11:15               ` [PATCH 16/17] staging/vme/tsi148: mark the registers' " Martyn Welch
2010-11-12 11:15               ` [PATCH 17/17] staging/vme/ca91cx42: " Martyn Welch
2010-11-12 11:23               ` [PATCH 00/17] Series short description Martyn Welch
2010-11-12 15:11                 ` Emilio G. Cota
2010-11-12 15:52                   ` Martyn Welch
2010-11-16 19:40                 ` Greg KH
2010-10-26  1:10 ` [PATCH 10/30] staging/vme/tsi148: remove unreachable line Emilio G. Cota
2010-10-27 11:06   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 11/30] staging/vme/tsi148: declare static functions as such Emilio G. Cota
2010-10-27 11:23   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 12/30] staging/vme/ca91cx42: " Emilio G. Cota
2010-10-27 11:24   ` Martyn Welch
2010-10-26  1:10 ` [PATCH 13/30] staging/vme_user: declare private variables as static Emilio G. Cota
2010-10-27 11:29   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 14/30] staging/vme_user: use an unsigned int for counting the number of kparams Emilio G. Cota
2010-10-27 11:29   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 15/30] staging/vme_user: remove __iomem marking from kern_buf and derivates Emilio G. Cota
2010-10-27 12:20   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 16/30] staging/vme_user: mark user-space buffers with __user Emilio G. Cota
2010-10-27 12:20   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 17/30] staging/vme: mark struct vme_master_resource's base address pointer as __iomem Emilio G. Cota
2010-10-27 12:20   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 18/30] staging/vme/tsi148: mark the registers' " Emilio G. Cota
2010-10-27 12:20   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 19/30] staging/vme/ca91cx42: " Emilio G. Cota
2010-10-27 12:20   ` Martyn Welch
2010-10-26  1:11 ` [PATCH 20/30] staging/vme: trivial: rename vme_bus_num_mtx to vme_buses_lock Emilio G. Cota
2010-10-26  1:11 ` [PATCH 21/30] staging/vme: keep a list of registered buses (bridges) Emilio G. Cota
2010-10-26  1:11 ` [PATCH 22/30] staging/vme/vme_user: use __dev{init,exit} for .probe and .remove Emilio G. Cota
2010-12-03 13:44   ` [PATCH] staging/vme/vme_user: use __dev{init, exit} " Martyn Welch
2010-10-26  1:11 ` [PATCH 23/30] staging/vme_user: fix usage of the slave resources after they've been freed Emilio G. Cota
2010-12-03  9:05   ` [PATCH] " Martyn Welch
2010-10-26  1:11 ` [PATCH 24/30] staging/vme_user: remove unnecessary call to vme_slave_set Emilio G. Cota
2010-10-27 12:24   ` Martyn Welch
2010-10-27 14:59     ` Emilio G. Cota
2010-10-26  1:11 ` [PATCH 25/30] staging/vme_user: add missing calls to vme_master_free calls in .remove Emilio G. Cota
2010-12-03 14:20   ` [PATCH] " Martyn Welch
2010-12-03 14:44     ` Greg KH
2010-12-03 15:29       ` Martyn Welch
2010-10-26  1:11 ` [PATCH 26/30] staging/vme: move all contents of vme_bridge.h to vme.h Emilio G. Cota
2010-10-26  1:11 ` [PATCH 27/30] staging/vme: rework the bus model Emilio G. Cota
2010-11-04  4:16   ` Emilio G. Cota
2010-10-26  1:11 ` [PATCH 28/30] staging/vme: convert vme_* users to vme_*_ng Emilio G. Cota
2010-10-26  1:11 ` [PATCH 29/30] staging/vme: remove unused vme_* functions and related code Emilio G. Cota
2010-10-26  1:11 ` [PATCH 30/30] staging/vme: remove _ng suffixes Emilio G. Cota
2010-11-09 23:12 ` [re-send][-next] staging/vme: various fixes + new driver model for VME Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-10-22  6:36 [-next] " Emilio G. Cota
2010-10-22  6:36 ` [PATCH 09/30] staging/vme: fill in struct device's .release, even if it's a NOOP Emilio G. Cota

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).