Skip to content

Commit

Permalink
Staging: vme: Extend VME core probing for special matches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martyn Welch authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent df45517 commit a37b0da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/staging/vme/vme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/staging/vme/vme.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a37b0da

Please sign in to comment.