aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vme
diff options
context:
space:
mode:
authorMartyn Welch <martyn.welch@gefanuc.com>2009-08-06 09:43:07 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:02:10 -0700
commita37b0dad8b3d278fa64482ccd2381c947f432bf7 (patch)
treebc6c6227bc1b79c238e82401be9ce317c796b152 /drivers/staging/vme
parentStaging: vme: Correct tsi-148 VME interrupt free routine (diff)
downloadlinux-dev-a37b0dad8b3d278fa64482ccd2381c947f432bf7.tar.xz
linux-dev-a37b0dad8b3d278fa64482ccd2381c947f432bf7.zip
Staging: vme: Extend VME core probing for special matches
Add the ability to define all slots and current slot in the VME buses bind table. Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme')
-rw-r--r--drivers/staging/vme/vme.c14
-rw-r--r--drivers/staging/vme/vme.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 8ee11925b19b..d6ad12e3cb54 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -1302,9 +1302,17 @@ static int vme_bus_match(struct device *dev, struct device_driver *drv)
while((driver->bind_table[i].bus != 0) ||
(driver->bind_table[i].slot != 0)) {
- if ((bridge->num == driver->bind_table[i].bus) &&
- (num == driver->bind_table[i].slot))
- return 1;
+ 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++;
}
diff --git a/drivers/staging/vme/vme.h b/drivers/staging/vme/vme.h
index 5291782a71eb..a092138e3a73 100644
--- a/drivers/staging/vme/vme.h
+++ b/drivers/staging/vme/vme.h
@@ -79,6 +79,9 @@ struct vme_resource {
extern struct bus_type vme_bus_type;
+#define VME_SLOT_CURRENT -1
+#define VME_SLOT_ALL -2
+
struct vme_device_id {
int bus;
int slot;