aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vme/vme.c
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@ge.com>2013-11-08 06:58:34 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-03 14:15:58 -0500
commit978f47d64365fa1659178e54c5106154c315b595 (patch)
tree00df9ed48a7bd0d95ba9095134b7e21f3fdc682c /drivers/vme/vme.c
parent49cf10c67bfbd68bc646390cd1f4cbe77aea12d5 (diff)
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/vme/vme.c')
-rw-r--r--drivers/vme/vme.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index f6856b427496..8df5e4efc1ca 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -1293,6 +1293,19 @@ int vme_slot_get(struct vme_dev *vdev)
1293} 1293}
1294EXPORT_SYMBOL(vme_slot_get); 1294EXPORT_SYMBOL(vme_slot_get);
1295 1295
1296int vme_bus_num(struct vme_dev *vdev)
1297{
1298 struct vme_bridge *bridge;
1299
1300 bridge = vdev->bridge;
1301 if (bridge == NULL) {
1302 pr_err("Can't find VME bus\n");
1303 return -EINVAL;
1304 }
1305
1306 return bridge->num;
1307}
1308EXPORT_SYMBOL(vme_bus_num);
1296 1309
1297/* - Bridge Registration --------------------------------------------------- */ 1310/* - Bridge Registration --------------------------------------------------- */
1298 1311