summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vme/devices
diff options
context:
space:
mode:
authorMartyn Welch2013-11-08 12:58:34 +0100
committerGreg Kroah-Hartman2013-12-03 20:15:58 +0100
commit978f47d64365fa1659178e54c5106154c315b595 (patch)
tree00df9ed48a7bd0d95ba9095134b7e21f3fdc682c /drivers/staging/vme/devices
parentstaging: dwc2: fix sparse non static symbol warning (diff)
downloadkernel-qcow2-linux-978f47d64365fa1659178e54c5106154c315b595.tar.gz
kernel-qcow2-linux-978f47d64365fa1659178e54c5106154c315b595.tar.xz
kernel-qcow2-linux-978f47d64365fa1659178e54c5106154c315b595.zip
VME: Provide access to VME bus enumeration and fix vme_user match function
The match function for vme_user is completely wrong. It will blindly bind against the first VME slot on each bus (at this point that would be just the first bus as the driver can only handle one bus). The original intention (before some major subsystem changes) was that the driver bind against the slot to which the bridge was attached in the VME system and to the bus(es) provided via the "bus" module parameter. To do this cleanly (i.e. without poking arround in the subsystems internal stuctures) a functionality has been added to provide access to the bus enumeration. Signed-off-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vme/devices')
-rw-r--r--drivers/staging/vme/devices/vme_user.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index daec15565a43..caee906f9b38 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -663,9 +663,16 @@ err_nocard:
static int vme_user_match(struct vme_dev *vdev)
{
- if (vdev->num >= VME_USER_BUS_MAX)
- return 0;
- return 1;
+ int i;
+
+ int cur_bus = vme_bus_num(vdev);
+ int cur_slot = vme_slot_get(vdev);
+
+ for (i = 0; i < bus_num; i++)
+ if ((cur_bus == bus[i]) && (cur_slot == vdev->num))
+ return 1;
+
+ return 0;
}
/*