VME: Provide access to VME bus enumeration and fix vme_user match function
[cascardo/linux.git] / drivers / staging / vme / devices / vme_user.c
index daec155..caee906 100644 (file)
@@ -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;
 }
 
 /*